solid-baseui 0.1.0-alpha.0 → 0.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +133 -15
  3. package/dist/lib/client/DialogHandle-DluOK_7u.js +521 -0
  4. package/dist/lib/client/DialogPopup-CfEb3F54.js +138 -0
  5. package/dist/lib/client/FieldControl-eDe-Jnp9.js +142 -0
  6. package/dist/lib/client/{FieldRootContext-izCEh80D.js → FieldRootContext-D3fuVjs3.js} +1 -1
  7. package/dist/lib/client/{FocusManager-grSdNHqW.js → FocusManager-q7z7PMV1.js} +94 -91
  8. package/dist/lib/client/{FormContext-BB05lWOI.js → FormContext-CwLBtm_d.js} +1 -0
  9. package/dist/lib/client/{InternalBackdrop-cSK13gaM.js → InternalBackdrop-B8_lfUvf.js} +1 -1
  10. package/dist/lib/client/{LabelableContext-DKsB0fIx.js → LabelableContext-CmQF-TX2.js} +3 -6
  11. package/dist/lib/client/MenuSubmenuTrigger-DMb5CwTF.js +1584 -0
  12. package/dist/lib/client/{PopupHandle-CcJG4NMy.js → PopupHandle-DyX5gY1e.js} +17 -11
  13. package/dist/lib/client/{PopupStore-DjB-wO88.js → PopupStore-BjRwcvbG.js} +138 -115
  14. package/dist/lib/client/PopupViewport-BanYHrD-.js +154 -0
  15. package/dist/lib/client/Separator-D5oJzlA3.js +27 -0
  16. package/dist/lib/client/TriggerFocusGuards-Fzspp3Y1.js +51 -0
  17. package/dist/lib/client/accordion/index.js +1 -1
  18. package/dist/lib/client/accordion-CA2DfX67.js +381 -0
  19. package/dist/lib/client/alert-dialog/index.js +1 -1
  20. package/dist/lib/client/{alert-dialog-BH_3ndio.js → alert-dialog-Bup88Dpx.js} +2 -2
  21. package/dist/lib/client/autocomplete/index.js +1 -1
  22. package/dist/lib/client/{autocomplete-Cob_FZEP.js → autocomplete-oyy_uRpU.js} +30 -25
  23. package/dist/lib/client/avatar/index.js +1 -1
  24. package/dist/lib/client/avatar-DNZ4fnBd.js +191 -0
  25. package/dist/lib/client/button/index.js +1 -1
  26. package/dist/lib/client/button-BJZYmCVv.js +88 -0
  27. package/dist/lib/client/checkbox/index.js +1 -1
  28. package/dist/lib/client/checkbox-group/index.js +1 -1
  29. package/dist/lib/client/checkbox-group-DGyrciZJ.js +135 -0
  30. package/dist/lib/client/checkbox-sQHYTbpB.js +425 -0
  31. package/dist/lib/client/collapsible/index.js +1 -1
  32. package/dist/lib/client/collapsible-BENbFFCc.js +230 -0
  33. package/dist/lib/client/combobox/index.js +2 -2
  34. package/dist/lib/client/combobox-BGH8QLXH.js +401 -0
  35. package/dist/lib/client/compositeNavigation-DCt1sQon.js +82 -0
  36. package/dist/lib/client/{constants-BYjBUIIi.js → constants-ByOMFJAe.js} +105 -101
  37. package/dist/lib/client/context-menu/index.js +1 -1
  38. package/dist/lib/client/context-menu-xQ1sBCET.js +220 -0
  39. package/dist/lib/client/{createAnchorPositioning-DcxDXUgB.js → createAnchorPositioning-DCXIApS1.js} +149 -146
  40. package/dist/lib/client/{createAnchoredPopupScrollLock-Cx0cbh1_.js → createAnchoredPopupScrollLock-BxKpJbCE.js} +2 -2
  41. package/dist/lib/client/{createClickInteraction-CTaIFBiV.js → createClickInteraction-BeBsTqtY.js} +1 -1
  42. package/dist/lib/client/{createCollapsiblePanel-DeDu0O2t.js → createCollapsiblePanel-BQ8r4RTi.js} +1 -1
  43. package/dist/lib/client/createFocusInteraction-DQPWkZe2.js +60 -0
  44. package/dist/lib/client/createLabelableId-DxJRwMUJ.js +14 -0
  45. package/dist/lib/client/{createPopupAutoResize-CGNiLhGq.js → createPopupAutoResize-CSNpMz5v.js} +4 -4
  46. package/dist/lib/client/{createTransitionStatus-B1L-whed.js → createTransitionStatus-BL_cPSEA.js} +12 -12
  47. package/dist/lib/client/dialog/index.js +1 -1
  48. package/dist/lib/client/{dialog-DkaQwIgP.js → dialog-C0EF0a5u.js} +2 -2
  49. package/dist/lib/client/{dom-BEAeQ9Eb.js → dom-lDdayFF_.js} +25 -15
  50. package/dist/lib/client/drawer/index.js +1 -1
  51. package/dist/lib/client/drawer-uKoNBwDU.js +1540 -0
  52. package/dist/lib/client/field/index.js +1 -1
  53. package/dist/lib/client/field-DIMrgpBW.js +483 -0
  54. package/dist/lib/client/fieldset/index.js +1 -1
  55. package/dist/lib/client/fieldset-Byqk3noT.js +70 -0
  56. package/dist/lib/client/form/index.js +1 -1
  57. package/dist/lib/client/form-Bqq8wSLY.js +109 -0
  58. package/dist/lib/client/index.js +44 -42
  59. package/dist/lib/client/input/index.js +1 -1
  60. package/dist/lib/client/{input-gb0ejxkm.js → input-YthuKwIE.js} +1 -1
  61. package/dist/lib/client/internals/composeEventHandlers.js +14 -8
  62. package/dist/lib/client/internals/field-root-context/index.js +2 -2
  63. package/dist/lib/client/internals/form-context/index.js +1 -1
  64. package/dist/lib/client/internals/labelable-provider/index.js +1 -1
  65. package/dist/lib/client/{mergeStyleValue-C4ITiiIV.js → isSolidAccessor-BH_FevwH.js} +8 -15
  66. package/dist/lib/client/menu/index.js +1 -1
  67. package/dist/lib/client/menu-4rNLN6aX.js +334 -0
  68. package/dist/lib/client/menubar/index.js +1 -1
  69. package/dist/lib/client/menubar-nFQGtNmY.js +163 -0
  70. package/dist/lib/client/mergeStyleValue-Dcd36yxZ.js +12 -0
  71. package/dist/lib/client/meter/index.js +1 -1
  72. package/dist/lib/client/meter-BvWdppcx.js +178 -0
  73. package/dist/lib/client/navigation-menu/index.js +1 -1
  74. package/dist/lib/client/navigation-menu-BbRyun3a.js +1070 -0
  75. package/dist/lib/client/number-field/index.js +1 -1
  76. package/dist/lib/client/number-field-hT_H0hVu.js +1043 -0
  77. package/dist/lib/client/otp-field/index.js +1 -1
  78. package/dist/lib/client/otp-field-lsy2iGID.js +584 -0
  79. package/dist/lib/client/popover/index.js +1 -1
  80. package/dist/lib/client/popover-Cmvmuf1L.js +940 -0
  81. package/dist/lib/client/popupStateMapping-nhukB8NK.js +371 -0
  82. package/dist/lib/client/preview-card/index.js +1 -1
  83. package/dist/lib/client/preview-card-Dtu8AnBN.js +632 -0
  84. package/dist/lib/client/progress/index.js +1 -1
  85. package/dist/lib/client/progress-AVKxvgpc.js +195 -0
  86. package/dist/lib/client/radio/index.js +1 -1
  87. package/dist/lib/client/radio-CeCU-Qqi.js +284 -0
  88. package/dist/lib/client/radio-group/index.js +1 -1
  89. package/dist/lib/client/radio-group-NbuJvjQe.js +195 -0
  90. package/dist/lib/client/runOnceAnimationsFinish-CFADb4CN.js +49 -0
  91. package/dist/lib/client/{safePolygon--bbKn0c8.js → safePolygon-DVAR5dQD.js} +74 -70
  92. package/dist/lib/client/scroll-area/index.js +1 -1
  93. package/dist/lib/client/scroll-area-DqbvoAd7.js +717 -0
  94. package/dist/lib/client/{scrollable-SRNYlhF7.js → scrollable-BVaDUXng.js} +12 -12
  95. package/dist/lib/client/select/index.js +1 -1
  96. package/dist/lib/client/select-Dad51Xbn.js +1934 -0
  97. package/dist/lib/client/separator/index.js +1 -1
  98. package/dist/lib/client/slider/index.js +1 -1
  99. package/dist/lib/client/slider-CLSKFq_M.js +927 -0
  100. package/dist/lib/client/switch/index.js +1 -1
  101. package/dist/lib/client/switch-Bzuu5EIg.js +306 -0
  102. package/dist/lib/client/tabs/index.js +1 -1
  103. package/dist/lib/client/tabs-DWiBDv8D.js +695 -0
  104. package/dist/lib/client/toast/index.js +1 -1
  105. package/dist/lib/client/toast-DmtPJW2k.js +1118 -0
  106. package/dist/lib/client/toggle/index.js +1 -1
  107. package/dist/lib/client/toggle-CAe-Z8Xn.js +142 -0
  108. package/dist/lib/client/toggle-group/index.js +1 -1
  109. package/dist/lib/client/toggle-group-BbQg5s-m.js +134 -0
  110. package/dist/lib/client/toolbar/index.js +1 -1
  111. package/dist/lib/client/toolbar-BXT_g-oX.js +504 -0
  112. package/dist/lib/client/tooltip/index.js +1 -1
  113. package/dist/lib/client/tooltip-h2r2_Xuo.js +850 -0
  114. package/dist/lib/client/use-render/index.js +2 -0
  115. package/dist/lib/client/useFilteredItems-BX0BEuSI.js +2301 -0
  116. package/dist/lib/client/useRender-CxZ8PI-g.js +12 -0
  117. package/dist/lib/server/{DialogHandle-ATZlm9RC.js → DialogHandle-BGIISmG7.js} +37 -46
  118. package/dist/lib/server/{DialogPopup-BebI-w5P.js → DialogPopup-C2ZDGf42.js} +12 -15
  119. package/dist/lib/server/{FieldControl-Y_kI7ARp.js → FieldControl-CDMMyvuj.js} +62 -26
  120. package/dist/lib/server/{FieldRootContext-IC-LWzVp.js → FieldRootContext-Bfpna6gA.js} +3 -3
  121. package/dist/lib/server/{FocusManager-BrbZVWME.js → FocusManager-D-xgblGs.js} +9 -5
  122. package/dist/lib/server/{FormContext-pvESt85v.js → FormContext-CYwo_ZnB.js} +1 -0
  123. package/dist/lib/server/{InternalBackdrop-C_iDPVR-.js → InternalBackdrop-D_2zAWnl.js} +1 -1
  124. package/dist/lib/server/{LabelableContext-DZP3rgAY.js → LabelableContext-BTeF0IWb.js} +4 -6
  125. package/dist/lib/server/{MenuSubmenuTrigger-DA4gsv6z.js → MenuSubmenuTrigger-BMQKlOvU.js} +177 -210
  126. package/dist/lib/server/{PopupHandle-DthPgNjy.js → PopupHandle-QNj4mED2.js} +14 -5
  127. package/dist/lib/server/{PopupStore-DEs3FAEe.js → PopupStore-evylvVnN.js} +42 -15
  128. package/dist/lib/server/{PopupViewport-3r_KTFwX.js → PopupViewport-BDttjORN.js} +38 -28
  129. package/dist/lib/server/{Separator-vhhYxWGr.js → Separator-DTvtnxzP.js} +4 -6
  130. package/dist/lib/server/TriggerFocusGuards-B9GNbLrL.js +61 -0
  131. package/dist/lib/server/accordion/index.js +39 -77
  132. package/dist/lib/server/alert-dialog/index.js +2 -2
  133. package/dist/lib/server/autocomplete/index.js +14 -5
  134. package/dist/lib/server/avatar/index.js +90 -51
  135. package/dist/lib/server/button/index.js +14 -15
  136. package/dist/lib/server/checkbox/index.js +37 -64
  137. package/dist/lib/server/checkbox-group/index.js +21 -11
  138. package/dist/lib/server/collapsible/index.js +42 -49
  139. package/dist/lib/server/combobox/index.js +79 -50
  140. package/dist/lib/server/{compositeNavigation-BRVT1C38.js → compositeNavigation-D5jKM4yk.js} +32 -1
  141. package/dist/lib/server/{constants-9H__9xbS.js → constants-ByqXubhO.js} +10 -5
  142. package/dist/lib/server/context-menu/index.js +14 -16
  143. package/dist/lib/server/{createAnchorPositioning-C-cVOPwz.js → createAnchorPositioning-DrQYe7RS.js} +12 -7
  144. package/dist/lib/server/{createAnchoredPopupScrollLock-DFuUrykR.js → createAnchoredPopupScrollLock-q6gnOSmv.js} +2 -2
  145. package/dist/lib/server/{createClickInteraction-BYsMgvup.js → createClickInteraction-D7oc1Vco.js} +1 -1
  146. package/dist/lib/server/{createCollapsiblePanel-DTyVJz0G.js → createCollapsiblePanel-B45kTe6v.js} +1 -1
  147. package/dist/lib/server/{createFocusInteraction-EIS0QOel.js → createFocusInteraction-DFKr4G7a.js} +22 -2
  148. package/dist/lib/server/createLabelableId-WMUKtY6s.js +18 -0
  149. package/dist/lib/server/{createPopupAutoResize-DO50jjNX.js → createPopupAutoResize-Cg0-lLf4.js} +2 -2
  150. package/dist/lib/server/{createTransitionStatus-BTlrerSS.js → createTransitionStatus-184v7j3-.js} +2 -2
  151. package/dist/lib/server/dialog/index.js +2 -2
  152. package/dist/lib/server/{dom-Crg_2R-j.js → dom-D8_aB1yy.js} +14 -1
  153. package/dist/lib/server/drawer/index.js +96 -100
  154. package/dist/lib/server/field/index.js +110 -98
  155. package/dist/lib/server/fieldset/index.js +13 -16
  156. package/dist/lib/server/form/index.js +18 -14
  157. package/dist/lib/server/index.js +5 -3
  158. package/dist/lib/server/input/index.js +1 -1
  159. package/dist/lib/server/internals/composeEventHandlers.js +15 -9
  160. package/dist/lib/server/internals/field-root-context/index.js +1 -1
  161. package/dist/lib/server/internals/form-context/index.js +1 -1
  162. package/dist/lib/server/internals/labelable-provider/index.js +1 -1
  163. package/dist/lib/server/{mergeStyleValue-Db8bRCM4.js → isSolidAccessor-CZpzAH5l.js} +7 -21
  164. package/dist/lib/server/menu/index.js +30 -29
  165. package/dist/lib/server/menubar/index.js +10 -35
  166. package/dist/lib/server/mergeStyleValue-DecVaoac.js +20 -0
  167. package/dist/lib/server/meter/index.js +20 -32
  168. package/dist/lib/server/navigation-menu/index.js +67 -138
  169. package/dist/lib/server/number-field/index.js +64 -62
  170. package/dist/lib/server/otp-field/index.js +19 -22
  171. package/dist/lib/server/popover/index.js +61 -77
  172. package/dist/lib/server/{popupStateMapping-nKoUwoke.js → popupStateMapping-VHqr6M4H.js} +19 -17
  173. package/dist/lib/server/preview-card/index.js +39 -50
  174. package/dist/lib/server/progress/index.js +21 -33
  175. package/dist/lib/server/radio/index.js +24 -45
  176. package/dist/lib/server/radio-group/index.js +12 -13
  177. package/dist/lib/server/{runOnceAnimationsFinish-DCHzXWZU.js → runOnceAnimationsFinish-CYq38H8J.js} +2 -1
  178. package/dist/lib/server/{safePolygon-CAm5RJGv.js → safePolygon-B8QtiIZ3.js} +6 -1
  179. package/dist/lib/server/scroll-area/index.js +40 -49
  180. package/dist/lib/server/{scrollable-CjsSxbGr.js → scrollable-C9Pgq8T5.js} +1 -1
  181. package/dist/lib/server/select/index.js +128 -213
  182. package/dist/lib/server/separator/index.js +1 -1
  183. package/dist/lib/server/slider/index.js +39 -52
  184. package/dist/lib/server/switch/index.js +22 -32
  185. package/dist/lib/server/tabs/index.js +197 -137
  186. package/dist/lib/server/toast/index.js +78 -95
  187. package/dist/lib/server/toggle/index.js +11 -13
  188. package/dist/lib/server/toggle-group/index.js +11 -9
  189. package/dist/lib/server/toolbar/index.js +76 -93
  190. package/dist/lib/server/tooltip/index.js +53 -57
  191. package/dist/lib/server/use-render/index.js +2 -0
  192. package/dist/lib/server/{useFilteredItems-DvuctLt3.js → useFilteredItems-BmhL0nf1.js} +335 -316
  193. package/dist/lib/server/useRender-CryVdCjs.js +16 -0
  194. package/dist/lib/types/accordion/header/AccordionHeader.d.ts +1 -1
  195. package/dist/lib/types/accordion/item/AccordionItem.d.ts +1 -1
  196. package/dist/lib/types/accordion/panel/AccordionPanel.d.ts +1 -1
  197. package/dist/lib/types/accordion/root/AccordionRoot.d.ts +2 -7
  198. package/dist/lib/types/accordion/trigger/AccordionTrigger.d.ts +7 -7
  199. package/dist/lib/types/alert-dialog/trigger/AlertDialogTrigger.d.ts +1 -2
  200. package/dist/lib/types/autocomplete/trigger/AutocompleteTrigger.d.ts +1 -0
  201. package/dist/lib/types/avatar/fallback/AvatarFallback.d.ts +2 -2
  202. package/dist/lib/types/avatar/image/AvatarImage.d.ts +9 -3
  203. package/dist/lib/types/avatar/image/createImageLoadingStatus.d.ts +3 -2
  204. package/dist/lib/types/avatar/root/AvatarRoot.d.ts +1 -1
  205. package/dist/lib/types/button/Button.d.ts +1 -1
  206. package/dist/lib/types/checkbox-group/CheckboxGroupContext.d.ts +4 -1
  207. package/dist/lib/types/collapsible/panel/CollapsiblePanel.d.ts +1 -1
  208. package/dist/lib/types/collapsible/root/CollapsibleRoot.d.ts +1 -1
  209. package/dist/lib/types/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
  210. package/dist/lib/types/combobox/chip/ComboboxChip.d.ts +2 -0
  211. package/dist/lib/types/combobox/index.d.ts +2 -0
  212. package/dist/lib/types/combobox/index.parts.d.ts +1 -0
  213. package/dist/lib/types/combobox/items/createItems.d.ts +42 -0
  214. package/dist/lib/types/combobox/root/AriaCombobox.d.ts +4 -0
  215. package/dist/lib/types/combobox/root/ComboboxRoot.d.ts +17 -8
  216. package/dist/lib/types/combobox/root/ComboboxRootContext.d.ts +2 -0
  217. package/dist/lib/types/combobox/store/ComboboxStore.d.ts +1 -0
  218. package/dist/lib/types/combobox/trigger/ComboboxTrigger.d.ts +1 -0
  219. package/dist/lib/types/combobox/utils/handleInputPress.d.ts +1 -1
  220. package/dist/lib/types/dialog/backdrop/DialogBackdrop.d.ts +1 -1
  221. package/dist/lib/types/dialog/description/DialogDescription.d.ts +1 -1
  222. package/dist/lib/types/dialog/title/DialogTitle.d.ts +1 -1
  223. package/dist/lib/types/dialog/viewport/DialogViewport.d.ts +1 -1
  224. package/dist/lib/types/drawer/backdrop/DrawerBackdrop.d.ts +1 -1
  225. package/dist/lib/types/drawer/content/DrawerContent.d.ts +1 -1
  226. package/dist/lib/types/drawer/indent/DrawerIndent.d.ts +1 -1
  227. package/dist/lib/types/drawer/indent-background/DrawerIndentBackground.d.ts +1 -1
  228. package/dist/lib/types/field/control/FieldControl.d.ts +5 -5
  229. package/dist/lib/types/field/root/FieldRoot.d.ts +1 -1
  230. package/dist/lib/types/field/root/createFieldValidation.d.ts +3 -2
  231. package/dist/lib/types/fieldset/legend/FieldsetLegend.d.ts +1 -1
  232. package/dist/lib/types/fieldset/root/FieldsetRoot.d.ts +1 -1
  233. package/dist/lib/types/index.d.ts +1 -0
  234. package/dist/lib/types/internals/composeEventHandlers.d.ts +9 -2
  235. package/dist/lib/types/internals/createTransitionStatus.d.ts +1 -1
  236. package/dist/lib/types/internals/field-root-context/FieldRootContext.d.ts +1 -0
  237. package/dist/lib/types/internals/form-context/FormContext.d.ts +1 -0
  238. package/dist/lib/types/internals/labelable-provider/LabelableContext.d.ts +1 -0
  239. package/dist/lib/types/internals/labelable-provider/createLabelableId.d.ts +3 -0
  240. package/dist/lib/types/internals/overlay/PopupPortal.d.ts +4 -2
  241. package/dist/lib/types/internals/overlay/createPopupPresence.d.ts +1 -0
  242. package/dist/lib/types/internals/overlay/dom.d.ts +2 -0
  243. package/dist/lib/types/menu/root/MenuRootContext.d.ts +1 -0
  244. package/dist/lib/types/meter/indicator/MeterIndicator.d.ts +1 -1
  245. package/dist/lib/types/meter/label/MeterLabel.d.ts +1 -1
  246. package/dist/lib/types/meter/root/MeterRoot.d.ts +1 -1
  247. package/dist/lib/types/meter/track/MeterTrack.d.ts +1 -1
  248. package/dist/lib/types/meter/value/MeterValue.d.ts +1 -1
  249. package/dist/lib/types/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -0
  250. package/dist/lib/types/number-field/input/NumberFieldInput.d.ts +5 -5
  251. package/dist/lib/types/number-field/root/NumberFieldRootContext.d.ts +1 -0
  252. package/dist/lib/types/popover/arrow/PopoverArrow.d.ts +1 -1
  253. package/dist/lib/types/popover/backdrop/PopoverBackdrop.d.ts +1 -1
  254. package/dist/lib/types/popover/description/PopoverDescription.d.ts +1 -1
  255. package/dist/lib/types/popover/positioner/PopoverPositioner.d.ts +1 -1
  256. package/dist/lib/types/popover/title/PopoverTitle.d.ts +1 -1
  257. package/dist/lib/types/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
  258. package/dist/lib/types/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
  259. package/dist/lib/types/preview-card/positioner/PreviewCardPositioner.d.ts +1 -1
  260. package/dist/lib/types/progress/indicator/ProgressIndicator.d.ts +1 -1
  261. package/dist/lib/types/progress/label/ProgressLabel.d.ts +1 -1
  262. package/dist/lib/types/progress/root/ProgressRoot.d.ts +1 -1
  263. package/dist/lib/types/progress/track/ProgressTrack.d.ts +1 -1
  264. package/dist/lib/types/progress/value/ProgressValue.d.ts +1 -1
  265. package/dist/lib/types/radio/indicator/RadioIndicator.d.ts +2 -2
  266. package/dist/lib/types/scroll-area/content/ScrollAreaContent.d.ts +1 -1
  267. package/dist/lib/types/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
  268. package/dist/lib/types/scroll-area/root/ScrollAreaRoot.d.ts +1 -1
  269. package/dist/lib/types/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -1
  270. package/dist/lib/types/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
  271. package/dist/lib/types/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
  272. package/dist/lib/types/separator/Separator.d.ts +1 -1
  273. package/dist/lib/types/slider/track/SliderTrack.d.ts +2 -2
  274. package/dist/lib/types/tabs/indicator/prehydrationScript.d.ts +1 -1
  275. package/dist/lib/types/tabs/list/TabsList.d.ts +1 -1
  276. package/dist/lib/types/tabs/panel/TabsPanel.d.ts +1 -1
  277. package/dist/lib/types/tabs/root/TabsRoot.d.ts +1 -1
  278. package/dist/lib/types/tabs/tab/TabsTab.d.ts +1 -1
  279. package/dist/lib/types/toast/createToastManager.d.ts +2 -2
  280. package/dist/lib/types/toast/store/ToastStore.d.ts +1 -1
  281. package/dist/lib/types/toast/useToastManager.d.ts +1 -1
  282. package/dist/lib/types/toggle/Toggle.d.ts +1 -1
  283. package/dist/lib/types/toggle-group/ToggleGroup.d.ts +1 -1
  284. package/dist/lib/types/toolbar/group/ToolbarGroup.d.ts +1 -1
  285. package/dist/lib/types/toolbar/link/ToolbarLink.d.ts +10 -3
  286. package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +10 -4
  287. package/dist/lib/types/toolbar/separator/ToolbarSeparator.d.ts +1 -1
  288. package/dist/lib/types/tooltip/arrow/TooltipArrow.d.ts +1 -1
  289. package/dist/lib/types/tooltip/positioner/TooltipPositioner.d.ts +1 -1
  290. package/dist/lib/types/types/index.d.ts +7 -3
  291. package/dist/lib/types/use-render/index.d.ts +2 -0
  292. package/dist/lib/types/use-render/useRender.d.ts +10 -0
  293. package/package.json +24 -11
  294. package/dist/lib/client/DialogHandle-DrN2YWCv.js +0 -518
  295. package/dist/lib/client/DialogPopup-ZlqmGfdk.js +0 -136
  296. package/dist/lib/client/FieldControl-Bc-z2og6.js +0 -116
  297. package/dist/lib/client/MenuSubmenuTrigger-QZkQ0F2v.js +0 -1570
  298. package/dist/lib/client/PopupViewport-DgrIqQea.js +0 -152
  299. package/dist/lib/client/Separator-9DboD_Si.js +0 -25
  300. package/dist/lib/client/TriggerFocusGuards-CQ-JuASy.js +0 -56
  301. package/dist/lib/client/accordion-sOXt9AlG.js +0 -399
  302. package/dist/lib/client/avatar-AF9vyD4q.js +0 -146
  303. package/dist/lib/client/button-DpUi-2g8.js +0 -82
  304. package/dist/lib/client/checkbox-BbAwOptH.js +0 -441
  305. package/dist/lib/client/checkbox-group-CSSp_805.js +0 -128
  306. package/dist/lib/client/collapsible-BIbje_ub.js +0 -232
  307. package/dist/lib/client/combobox-8O-vgTLL.js +0 -352
  308. package/dist/lib/client/compositeNavigation-sxniYTc7.js +0 -58
  309. package/dist/lib/client/context-menu-BTMkXtrs.js +0 -217
  310. package/dist/lib/client/createFocusInteraction-D4w1-235.js +0 -50
  311. package/dist/lib/client/drawer-Ce2cChLt.js +0 -1550
  312. package/dist/lib/client/field-C-o7jzKW.js +0 -469
  313. package/dist/lib/client/fieldset-BQTAWv2L.js +0 -65
  314. package/dist/lib/client/form-BINBiW5L.js +0 -106
  315. package/dist/lib/client/menu-DeMT08oD.js +0 -326
  316. package/dist/lib/client/menubar-C4aomSYv.js +0 -185
  317. package/dist/lib/client/meter-xSU37Q0m.js +0 -171
  318. package/dist/lib/client/navigation-menu-ZILQmdn6.js +0 -1083
  319. package/dist/lib/client/number-field-B8CsTb_8.js +0 -1035
  320. package/dist/lib/client/otp-field-DBkMcnog.js +0 -582
  321. package/dist/lib/client/popover-CQwyp-fs.js +0 -929
  322. package/dist/lib/client/popupStateMapping-C9eZl19i.js +0 -367
  323. package/dist/lib/client/preview-card-D_2Q8lpC.js +0 -625
  324. package/dist/lib/client/progress-D7r0xAC9.js +0 -188
  325. package/dist/lib/client/radio-CzGQ81z1.js +0 -299
  326. package/dist/lib/client/radio-group-DpHlBKA6.js +0 -193
  327. package/dist/lib/client/runOnceAnimationsFinish-15EM-Z4l.js +0 -48
  328. package/dist/lib/client/scroll-area-CffM4U0R.js +0 -701
  329. package/dist/lib/client/select-IFhiEg73.js +0 -1940
  330. package/dist/lib/client/slider-BCagYmGp.js +0 -921
  331. package/dist/lib/client/switch-RIJeDnvS.js +0 -308
  332. package/dist/lib/client/tabs-fOAKs7r3.js +0 -696
  333. package/dist/lib/client/toast-D2P8UqUs.js +0 -1108
  334. package/dist/lib/client/toggle-group-0Aue0owJ.js +0 -129
  335. package/dist/lib/client/toggle-momVEIBL.js +0 -138
  336. package/dist/lib/client/toolbar-Du22aKCv.js +0 -492
  337. package/dist/lib/client/tooltip-CyK61fl1.js +0 -844
  338. package/dist/lib/client/useFilteredItems-DTekHz39.js +0 -2223
  339. package/dist/lib/client/withoutComponentBinding-CcCW7fSc.js +0 -13
  340. package/dist/lib/server/TriggerFocusGuards-sbGwf45f.js +0 -63
  341. package/dist/lib/server/withoutComponentBinding-BHaWr5kU.js +0 -20
  342. package/dist/lib/types/internals/withoutComponentBinding.d.ts +0 -7
@@ -1,2223 +0,0 @@
1
- import { getStateAttributesProps as e } from "./internals/getStateAttributesProps.js";
2
- import { E as t, S as n, b as r, g as i, h as a, i as o, l as s, r as c, t as l, v as u, w as d, y as f } from "./reasons-Co5CzjKq.js";
3
- import { n as p, t as m } from "./resolveStyle-XcgAuaKR.js";
4
- import { createChangeEventDetails as h, createGenericEventDetails as g } from "./internals/createBaseUIEventDetails.js";
5
- import { transitionStatusMapping as _ } from "./internals/stateAttributesMapping.js";
6
- import { composeEventHandlers as v } from "./internals/composeEventHandlers.js";
7
- import { t as y } from "./runOnceAnimationsFinish-15EM-Z4l.js";
8
- import { a as b, c as x, l as S, n as C, o as w, p as ee } from "./dom-BEAeQ9Eb.js";
9
- import { i as T, n as E, r as D, t as O } from "./compositeNavigation-sxniYTc7.js";
10
- import { t as te } from "./createAnchorPositioning-DcxDXUgB.js";
11
- import { t as ne } from "./InternalBackdrop-cSK13gaM.js";
12
- import { t as k } from "./createAnchoredPopupScrollLock-Cx0cbh1_.js";
13
- import { t as re } from "./createClickInteraction-CTaIFBiV.js";
14
- import { c as ie, i as ae, n as oe, r as se, s as ce, t as le } from "./FloatingTree-23B7KKPD.js";
15
- import { a as ue, n as de, o as fe, t as pe } from "./PopupStore-DjB-wO88.js";
16
- import { t as A } from "./createTransitionStatus-B1L-whed.js";
17
- import { a as me, i as he, n as ge, o as j, r as _e } from "./popupStateMapping-C9eZl19i.js";
18
- import { t as ve } from "./FocusManager-grSdNHqW.js";
19
- import { a as ye, i as be, n as M, r as xe, t as N } from "./buttonSemantics-paljfpOX.js";
20
- import { t as Se } from "./setRef-fXF6OIo3.js";
21
- import { n as Ce } from "./DirectionContext-BwMabICS.js";
22
- import { DEFAULT_FIELD_STATE_ATTRIBUTES as we, fieldStateAttributesMapping as Te } from "./internals/field-constants.js";
23
- import { n as Ee } from "./FieldRootContext-izCEh80D.js";
24
- import { n as De } from "./FormContext-BB05lWOI.js";
25
- import { a as Oe, c as ke, i as Ae, l as je, n as Me, o as Ne, r as Pe, s as Fe, t as Ie } from "./mergeStyleValue-C4ITiiIV.js";
26
- import { r as Le } from "./LabelableContext-DKsB0fIx.js";
27
- import { i as Re } from "./scrollable-SRNYlhF7.js";
28
- import { t as ze } from "./platform-Bk5Q32mf.js";
29
- import { Dynamic as P, createComponent as F, delegateEvents as Be, effect as Ve, getNextElement as He, insert as Ue, memo as We, mergeProps as I, ref as Ge, runHydrationEvents as Ke, setAttribute as L, spread as qe, style as Je, template as R } from "@solidjs/web";
30
- import { For as Ye, Show as z, createContext as Xe, createEffect as B, createMemo as V, createSignal as H, createUniqueId as Ze, flush as Qe, omit as U, onCleanup as W, untrack as G, useContext as $e } from "solid-js";
31
- //#region src/internals/overlay/createListNavigation.ts
32
- function et(e) {
33
- let t = () => e.enabled?.() ?? !0, r = () => e.orientation?.() ?? "vertical", i = (e) => e === "Home" || e === "End" || r() !== "horizontal" && (e === "ArrowDown" || e === "ArrowUp") || r() !== "vertical" && (e === "ArrowLeft" || e === "ArrowRight"), a = null, o = (t) => t === "Home" || t === "ArrowDown" ? !0 : t === "End" || t === "ArrowUp" ? !1 : t === (e.rtl?.() ?? !1 ? "ArrowLeft" : "ArrowRight"), s = (t, n, i = !1) => {
34
- let a = e.activeIndex() ?? e.selectedIndex?.() ?? -1;
35
- if (i) a = o(t.key) ? E(n, e.disabledIndices?.()) : O(n, e.disabledIndices?.());
36
- else {
37
- let i = e.loopFocus?.() ?? !1, o = i && (e.allowEscape?.() ?? !1), s = D({
38
- list: n,
39
- currentIndex: a,
40
- key: t.key,
41
- orientation: r(),
42
- rtl: e.rtl?.() ?? !1,
43
- loop: o ? a === -1 : i,
44
- cols: e.cols?.() ?? 1,
45
- disabledIndices: e.disabledIndices?.()
46
- }), c = t.key === "Home" || t.key === "End";
47
- a = s === a && o && a !== -1 && !c ? -1 : s;
48
- }
49
- e.onNavigate(a === -1 ? null : a, t), !(e.virtual?.() ?? !1) && a >= 0 && n[a]?.focus({ preventScroll: !0 });
50
- };
51
- return B(() => ({
52
- open: e.context.track().open,
53
- list: e.list()
54
- }), (e) => {
55
- if (!a || !e.open || e.list.length === 0) return;
56
- let t = a;
57
- a = null, G(() => s(t.event, e.list, !0));
58
- }), {
59
- onKeyDown(r) {
60
- if (!t() || !i(r.key)) return;
61
- if (r.preventDefault(), r.stopPropagation(), !e.context.state.open) {
62
- let t = r.key.startsWith("Arrow");
63
- if (!(e.openOnArrowKeyDown?.() ?? !0) || !t) return;
64
- a = { event: r };
65
- let i = h(n, r, e.context.state.domReferenceElement ?? void 0);
66
- if (e.context.setOpen(!0, i), i.isCanceled) {
67
- a = null;
68
- return;
69
- }
70
- let o = e.list();
71
- e.context.state.open && o.length > 0 && (a = null, s(r, o, !0));
72
- return;
73
- }
74
- let o = e.list();
75
- o.length > 0 && s(r, o);
76
- },
77
- onItemPointerMove(n, r) {
78
- !t() || !(e.focusItemOnHover?.() ?? !0) || T(e.list(), r, e.disabledIndices?.()) || (e.onNavigate(r, n), (e.virtual?.() ?? !1) || e.list()[r]?.focus({ preventScroll: !0 }));
79
- },
80
- onItemPointerLeave(n) {
81
- t() && (e.virtual?.() ?? !1) && e.onNavigate(null, n);
82
- }
83
- };
84
- }
85
- //#endregion
86
- //#region src/internals/overlay/createTypeahead.ts
87
- function tt(e) {
88
- let t = "", n = G(() => e.selectedIndex?.() ?? e.activeIndex() ?? -1), r = null, i, a = () => {
89
- clearTimeout(i), t = "", n = r ?? n, e.onTyping?.(!1);
90
- };
91
- W(a), B(() => ({
92
- open: e.context.track().open,
93
- selected: e.selectedIndex?.() ?? null
94
- }), (e) => {
95
- (e.open || e.selected === null) && (clearTimeout(i), r = null, t = "");
96
- });
97
- let o = (t) => {
98
- let n = e.elements?.()[t];
99
- if (n && !w(n) || n?.matches(":disabled")) return !1;
100
- let r = e.disabledIndices?.();
101
- return !r || !T([], t, r);
102
- }, s = (t, n) => {
103
- let r = e.list();
104
- if (!r.length) return -1;
105
- let i = (n % r.length + r.length) % r.length, a = t.toLowerCase();
106
- for (let e = 0; e < r.length; e += 1) {
107
- let t = (i + e) % r.length;
108
- if (r[t]?.toLowerCase().startsWith(a) && o(t)) return t;
109
- }
110
- return -1;
111
- };
112
- return {
113
- onKeyDown(c) {
114
- if (!(e.enabled?.() ?? !0) || c.key.length !== 1 || c.ctrlKey || c.metaKey || c.altKey) return;
115
- let l = e.list();
116
- t && c.key === " " && (c.preventDefault(), c.stopPropagation(), e.onTyping?.(!0));
117
- let u = t === "";
118
- u && (n = e.selectedIndex?.() ?? e.activeIndex() ?? -1), l.every((e, t) => e && o(t) ? e[0]?.toLowerCase() !== e[1]?.toLowerCase() : !0) && t === c.key && (t = "", n = r ?? n), t += c.key, clearTimeout(i), i = setTimeout(a, e.resetMs?.() ?? 750);
119
- let d = (u ? e.selectedIndex?.() ?? e.activeIndex() ?? -1 : n) + 1, f = s(t, d);
120
- f === -1 ? c.key !== " " && a() : (e.context.state.open && c.key !== " " && (c.preventDefault(), c.stopPropagation()), e.onTyping?.(!0), e.onMatch(f), r = f);
121
- },
122
- onBlur(t) {
123
- let n = t.relatedTarget;
124
- !C(e.context.state.domReferenceElement, n) && !C(e.context.state.floatingElement, n) && a();
125
- }
126
- };
127
- }
128
- //#endregion
129
- //#region src/internals/valueLabel.ts
130
- function nt(e) {
131
- if (e == null) return "";
132
- if (typeof e == "string") return e;
133
- try {
134
- return JSON.stringify(e) ?? String(e);
135
- } catch {
136
- return String(e);
137
- }
138
- }
139
- function rt(e) {
140
- return Array.isArray(e) && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
141
- }
142
- function it(e) {
143
- return Array.isArray(e) ? rt(e) ? e.flatMap((e) => e.items) : e : [];
144
- }
145
- function at(e) {
146
- if (e == null) return !1;
147
- if (!Array.isArray(e)) return "null" in e;
148
- for (let t of it(e)) {
149
- let e = t;
150
- if (e && typeof e == "object" && e.value == null && e.label != null) return !0;
151
- }
152
- return !1;
153
- }
154
- function K(e, t) {
155
- if (t && e != null) return t(e) ?? "";
156
- if (e && typeof e == "object") {
157
- if ("label" in e && e.label != null) return String(e.label);
158
- if ("value" in e) return String(e.value);
159
- }
160
- return nt(e);
161
- }
162
- function ot(e, t) {
163
- return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? nt(e.value) : nt(e);
164
- }
165
- function st(e, t, n) {
166
- let r = () => K(e, n);
167
- if (n && e != null) return n(e);
168
- if (e && typeof e == "object" && "label" in e && e.label != null) return e.label;
169
- if (t && !Array.isArray(t)) return t[String(e)] ?? r();
170
- if (Array.isArray(t)) {
171
- let n = it(t);
172
- if (typeof e != "object" || !e) {
173
- let t = n.find((t) => t && t.value === e);
174
- return t && t.label != null ? t.label : r();
175
- }
176
- if ("value" in e) {
177
- let t = n.find((t) => t && t.value === e.value);
178
- if (t && t.label != null) return t.label;
179
- }
180
- }
181
- return r();
182
- }
183
- function ct(e, t, n) {
184
- return e.flatMap((e, r) => {
185
- let i = st(e, t, n);
186
- return r === 0 ? [i] : [", ", i];
187
- });
188
- }
189
- //#endregion
190
- //#region src/internals/filter.ts
191
- var lt = /* @__PURE__ */ new Map();
192
- function q(e) {
193
- return Array.isArray(e) ? e.map((e) => q(e)).join(",") : e == null ? "" : String(e);
194
- }
195
- function ut(e = {}) {
196
- let t = {
197
- usage: "search",
198
- sensitivity: "base",
199
- ignorePunctuation: !0,
200
- ...e
201
- }, n = `${q(e.locale)}|${JSON.stringify(t)}`, r = lt.get(n);
202
- if (r) return r;
203
- let i = new Intl.Collator(e.locale, t), a = {
204
- contains(e, t, n) {
205
- if (!t) return !0;
206
- let r = K(e, n);
207
- for (let e = 0; e <= r.length - t.length; e += 1) if (i.compare(r.slice(e, e + t.length), t) === 0) return !0;
208
- return !1;
209
- },
210
- startsWith(e, t, n) {
211
- if (!t) return !0;
212
- let r = K(e, n);
213
- return i.compare(r.slice(0, t.length), t) === 0;
214
- },
215
- endsWith(e, t, n) {
216
- if (!t) return !0;
217
- let r = K(e, n), a = t.length;
218
- return r.length >= a && i.compare(r.slice(r.length - a), t) === 0;
219
- }
220
- };
221
- return lt.set(n, a), a;
222
- }
223
- //#endregion
224
- //#region src/combobox/store/ComboboxItemRegistry.ts
225
- var dt = class {
226
- registrations = /* @__PURE__ */ new Map();
227
- revision;
228
- setRevision;
229
- order = 0;
230
- constructor() {
231
- let [e, t] = H(0, { ownedWrite: !0 });
232
- this.revision = e, this.setRevision = t;
233
- }
234
- register(e) {
235
- let t = {
236
- ...e,
237
- order: this.order
238
- };
239
- return this.order += 1, this.registrations.set(e.token, t), this.touch(), () => {
240
- this.registrations.delete(e.token) && this.touch();
241
- };
242
- }
243
- touch() {
244
- this.setRevision((e) => e + 1);
245
- }
246
- items() {
247
- return this.revision(), Array.from(this.registrations.values()).sort(ft);
248
- }
249
- indexOf(e) {
250
- let t = this.items(), n = t.findIndex((t) => t.token === e);
251
- return n === -1 ? -1 : t[n]?.index() ?? n;
252
- }
253
- elements() {
254
- let e = this.items(), t = [];
255
- e.forEach((e, n) => {
256
- t[e.index() ?? n] = e.element();
257
- });
258
- for (let e = 0; e < t.length; e += 1) t[e] ??= null;
259
- return t;
260
- }
261
- values() {
262
- let e = this.items(), t = [];
263
- return e.forEach((e, n) => {
264
- t[e.index() ?? n] = e.value();
265
- }), t;
266
- }
267
- labels() {
268
- return this.elements().map((e) => e?.textContent ?? null);
269
- }
270
- disabledIndices() {
271
- return this.items().flatMap((e, t) => e.disabled() ? [e.index() ?? t] : []);
272
- }
273
- size() {
274
- return this.items().length;
275
- }
276
- };
277
- function ft(e, t) {
278
- let n = e.index(), r = t.index();
279
- if (n !== void 0 && r !== void 0) return n - r;
280
- let i = e.element(), a = t.element();
281
- if (i && a && i !== a && i.isConnected && a.isConnected) {
282
- let e = i.compareDocumentPosition(a);
283
- if (e & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
284
- if (e & Node.DOCUMENT_POSITION_PRECEDING) return 1;
285
- }
286
- return e.order - t.order;
287
- }
288
- //#endregion
289
- //#region src/combobox/store/ComboboxStore.ts
290
- function J(e) {
291
- let [t, n] = H(() => e, { ownedWrite: !0 });
292
- return [t, (e) => {
293
- n(() => e);
294
- }];
295
- }
296
- var pt = class extends pe {
297
- collection = new dt();
298
- keyboardActive = !0;
299
- pointerDownItem = null;
300
- selectionEvent = null;
301
- chipsContainerElement = null;
302
- clearElement = null;
303
- emptyElement = null;
304
- startDismissElement = null;
305
- endDismissElement = null;
306
- activeIndex;
307
- setActiveIndex;
308
- selectedIndex;
309
- setSelectedIndex;
310
- forceMounted;
311
- setForceMounted;
312
- labelId;
313
- setLabelId;
314
- listElement;
315
- setListElement;
316
- popupSide;
317
- setPopupSide;
318
- openMethod;
319
- setOpenMethod;
320
- inputInsidePopup;
321
- setInputInsidePopup;
322
- inputOwnsFormValue;
323
- setInputOwnsFormValue;
324
- constructor(e) {
325
- super(e), [this.activeIndex, this.setActiveIndex] = J(null), [this.selectedIndex, this.setSelectedIndex] = J(null), [this.forceMounted, this.setForceMounted] = J(!1), [this.labelId, this.setLabelId] = J(void 0), [this.listElement, this.setListElement] = J(null), [this.popupSide, this.setPopupSide] = J(null), [this.openMethod, this.setOpenMethod] = J(null), [this.inputInsidePopup, this.setInputInsidePopup] = J(!0), [this.inputOwnsFormValue, this.setInputOwnsFormValue] = J(!1);
326
- }
327
- elements() {
328
- return this.collection.elements();
329
- }
330
- resolvedPopupSide() {
331
- return this.track().mounted && this.track().positionerElement ? this.popupSide() : null;
332
- }
333
- resetAfterClose() {
334
- this.setOpenMethod(null), this.pointerDownItem = null, this.selectionEvent = null;
335
- }
336
- }, mt = Symbol("ComboboxRootContext"), ht = Xe(mt);
337
- function Y() {
338
- let e = $e(ht);
339
- if (e === mt) throw Error("Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.");
340
- return e;
341
- }
342
- var gt = Symbol("ComboboxGroupCollectionContext"), _t = Xe(gt);
343
- function vt() {
344
- let e = $e(_t);
345
- return e === gt ? void 0 : e;
346
- }
347
- //#endregion
348
- //#region src/combobox/root/AriaCombobox.tsx
349
- var yt = /* @__PURE__ */ R("<input tabindex=-1 aria-hidden=true>"), bt = /* @__PURE__ */ R("<input type=hidden>"), xt = {
350
- "clip-path": "inset(50%)",
351
- overflow: "hidden",
352
- "white-space": "nowrap",
353
- border: "0",
354
- padding: "0",
355
- width: "1px",
356
- height: "1px",
357
- margin: "-1px",
358
- position: "fixed",
359
- top: "0",
360
- left: "0"
361
- }, St = {
362
- ...xt,
363
- position: "absolute"
364
- }, Ct = Symbol("none"), wt = {
365
- value: Ct,
366
- index: -1
367
- };
368
- function Tt(e) {
369
- let n = Ee(!0), a = De(), o = Le(), s = Ce(), c = ie(), l = ce(), p = c ?? new se(), m = Symbol("Combobox"), _ = `base-ui-${Ze()}`, v = `base-ui-${Ze()}`, y = Ze(), b = G(() => e.selectedValue !== void 0), S = G(() => e.inputValue !== void 0), w = G(() => e.open !== void 0), ee = G(() => e.inputValue !== void 0 || e.defaultInputValue !== void 0), T = V(() => e.selectionMode), E = V(() => e.selectionMode === "multiple"), D = V(() => e.selectionMode === "single"), O = V(() => e.isItemEqualToValue ?? Oe), te = () => e.itemToStringLabel, ne = () => e.itemToStringValue, k = G(() => {
370
- let t = e.defaultSelectedValue;
371
- return t == null ? e.selectionMode === "multiple" ? [] : t ?? null : Array.isArray(t) ? t.slice() : t;
372
- }), [de, pe] = H(() => k), A = V(() => b ? e.selectedValue ?? null : de()), me = G(() => ee ? e.defaultInputValue ?? e.inputValue ?? "" : e.selectionMode === "single" ? K(A(), e.itemToStringLabel) : ""), [he, ge] = H(me), j = V(() => S ? e.inputValue ?? "" : he()), [_e, ve] = H(!1), [ye, be] = H(null), [M, xe] = H(null, { ownedWrite: !0 }), [N, Se] = H(null, { ownedWrite: !0 }), [we, Te] = H(null, { ownedWrite: !0 }), [Me, Ne] = H(null, { ownedWrite: !0 }), [Pe, Ie] = H(null, { ownedWrite: !0 }), ze = V(() => e.id ?? _), P = V(() => n.disabled() || (e.disabled ?? !1)), Be = V(() => e.readOnly ?? !1), Ue = V(() => e.required ?? !1), I = V(() => e.modal ?? !1), Ke = V(() => e.grid ?? !1), qe = V(() => e.virtualized ?? !1), R = V(() => e.inline ?? !1), z = V(() => e.openOnInputClick ?? !0), Xe = V(() => e.keepHighlight ?? !1), Qe = V(() => e.highlightItemOnHover ?? !0), U = V(() => e.loopFocus ?? !0), $e = V(() => e.submitOnItemClick ?? !1), tt = V(() => e.autoComplete ?? "list"), nt = V(() => e.limit ?? -1), at = V(() => n.name() ?? e.name), st = V(() => e.form), ct = V(() => e.items !== void 0), lt = V(() => e.filteredItems !== void 0), q = V(() => e.autoHighlight === "always" ? "always" : e.autoHighlight ? "input-change" : !1), dt = V(() => ut({ locale: e.locale })), ft = V(() => {
373
- if (e.filter === null) return () => !0;
374
- if (e.filter !== void 0) return e.filter;
375
- let t = dt(), n = e.itemToStringLabel;
376
- return (e, r) => e != null && t.contains(e, r, n);
377
- }), J = V(() => ye() ?? String(j()).trim()), mt = V(() => D() ? K(A(), e.itemToStringLabel) : ""), Y = V(() => {
378
- let e = mt(), t = J();
379
- return D() && !_e() && t !== "" && e.length === t.length && dt().contains(e, t);
380
- }), gt = V(() => Y() ? "" : J()), _t = V(() => ct() && lt() && Y()), vt = V(() => it(e.items)), Tt = V(() => {
381
- if (e.filteredItems !== void 0 && !_t()) return e.filteredItems;
382
- let t = e.items;
383
- if (t === void 0) return [];
384
- let n = gt(), r = nt(), i = ft(), a = e.itemToStringLabel;
385
- if (rt(t)) {
386
- let e = [], o = 0;
387
- for (let s of t) {
388
- if (r > -1 && o >= r) break;
389
- let t = r > -1 ? r - o : Infinity, c = n === "" ? s.items.slice(0, t) : [];
390
- if (n !== "") for (let e of s.items) {
391
- if (c.length >= t) break;
392
- i(e, n, a) && c.push(e);
393
- }
394
- c.length > 0 && (e.push({
395
- ...s,
396
- items: c
397
- }), o += c.length);
398
- }
399
- return e;
400
- }
401
- let o = vt();
402
- if (n === "") return r > -1 ? o.slice(0, r) : o;
403
- let s = [];
404
- for (let e of o) {
405
- if (r > -1 && s.length >= r) break;
406
- i(e, n, a) && s.push(e);
407
- }
408
- return s;
409
- }), kt = V(() => {
410
- let e = Tt();
411
- return rt(e) ? e.flatMap((e) => e.items) : e;
412
- }), At = V(() => Tt().length === 0), jt = !1, Mt = wt, Nt = null, Pt = null, Ft = !1, It = Et(G(A)), Lt = G(j), Rt = G(() => e.items), zt = G(J), X = new pt({
413
- controlledOpen: () => w ? e.open : void 0,
414
- floatingId: v,
415
- nodeId: y,
416
- onOpenChange: () => (t, n) => {
417
- X.open() !== t && (!t && e.actionsRef && n.preventUnmountOnClose(), n.reason === "escape-key" && ct() && kt().length === 0 && !X.emptyElement && n.allowPropagation(), e.onOpenChange?.(t, n), !n.isCanceled && tn(t, n));
418
- },
419
- onOpenChangeComplete: () => e.onOpenChangeComplete
420
- });
421
- X.update({ open: G(() => e.open ?? e.defaultOpen ?? !1) }), X.configureTriggerUnmount({ closeOnActiveTriggerUnmount: !1 }), X.setInputOwnsFormValue(G(() => e.selectionMode === "none"));
422
- let Bt = ae({
423
- tree: p,
424
- id: y,
425
- parentId: l,
426
- context: () => X.context.floatingRoot
427
- }), Vt = ue(X, () => Ht(), { onUnmount: () => ln() });
428
- function Ht() {
429
- return R() ? X.track().positionerElement?.closest("[role=\"dialog\"]") ?? null : X.track().popupElement;
430
- }
431
- let Z = V(() => ct() || lt() ? kt() : X.collection.values()), Ut = V(() => {
432
- let t = X.collection.labels();
433
- if (!ct()) return t;
434
- let n = kt().map((t) => K(t, e.itemToStringLabel));
435
- return X.forceMounted() ? n.map((e, n) => t[n] ?? e) : n;
436
- }), Wt = V(() => {
437
- let e = X.collection.elements(), t = Z().length;
438
- return e.length < t && (e.length = t), e;
439
- }), Gt = V(() => {
440
- if (!Ke()) return 1;
441
- X.collection.items();
442
- let e = X.listElement()?.querySelector("[role=\"row\"]");
443
- return Math.max(1, e?.childElementCount ?? 1);
444
- }), Kt = V(() => {
445
- let e = A();
446
- return e == null ? !1 : E() && Array.isArray(e) ? e.length > 0 : !0;
447
- }), qt = V(() => {
448
- let e = A();
449
- return Array.isArray(e) && e.length > 0;
450
- }), Jt = V(() => T() === "none" ? j() : A()), Yt = V(() => {
451
- if (T() === "none") return j();
452
- let t = A();
453
- return Array.isArray(t) ? t.map((t) => ot(t, e.itemToStringValue)) : ot(t, e.itemToStringValue);
454
- }), Xt = V(() => {
455
- let t = Jt();
456
- return Array.isArray(t) ? "" : ot(t, e.itemToStringValue);
457
- }), Zt = V(() => E() || T() === "none" && X.inputOwnsFormValue() ? void 0 : at());
458
- function Qt(t, n, r) {
459
- if (n === -1) {
460
- if (Mt === wt) return;
461
- Mt = wt;
462
- } else Mt = {
463
- value: t,
464
- index: n
465
- };
466
- e.onItemHighlighted?.(t, g(r, void 0, { index: n }));
467
- }
468
- function Q(e) {
469
- if (e.selectedIndex !== void 0 && X.setSelectedIndex(e.selectedIndex), e.activeIndex === void 0) return;
470
- X.setActiveIndex(e.activeIndex);
471
- let t = e.type || "none";
472
- e.activeIndex === null ? Qt(void 0, -1, t) : Qt(G(Z)[e.activeIndex], e.activeIndex, t);
473
- }
474
- function $t() {
475
- let e = X.listElement();
476
- if (qe() || !e) return;
477
- let t = X.track().popupElement, n = e.firstElementChild ?? e;
478
- for (; x(n) && !(t ? !C(t, n) : n.getAttribute("role") === "dialog");) {
479
- if (Re(n)) {
480
- n.scrollTop = 0;
481
- break;
482
- }
483
- n = n.parentElement;
484
- }
485
- }
486
- function $(t, n) {
487
- if (jt = n.reason === i, e.onInputValueChange?.(t, n), !n.isCanceled) {
488
- if (n.reason === "input-change") {
489
- X.open() && ye() !== null && be(null);
490
- let e = n.event, r = e.inputType;
491
- if (e.type === "compositionend" || r != null && r !== "" && r !== "insertReplacementText") {
492
- let e = t.trim() !== "";
493
- e && ve(!0), Nt = { hasQuery: e }, $t(), e && q() && X.activeIndex() == null && (X.open() || R()) && X.setActiveIndex(0);
494
- }
495
- } else n.reason === "input-clear" && t === "" && X.inputInsidePopup() && (Nt = {
496
- hasQuery: !1,
497
- selection: !0
498
- });
499
- S || ge(t);
500
- }
501
- }
502
- function en(e, t) {
503
- return X.setOpen(e, t);
504
- }
505
- function tn(e, t) {
506
- if (e && X.inputInsidePopup() && !R() && ye() !== null && (ve(!1), be(null), j() !== "" && t.reason !== "input-change" && $("", h(i, t.event))), !e && _e()) {
507
- let e = J();
508
- D() ? (R() || be(e), e === "" && ve(!1)) : E() && (R() || be(e), X.inputInsidePopup() && Q({ activeIndex: null }), (!X.inputInsidePopup() || R()) && $("", h(i, t.event)));
509
- }
510
- !e && X.inputInsidePopup() && (t.reason === "focus-out" || t.reason === "outside-press") && (n.setTouched(!0), n.setFocused(!1), n.validationMode() === "onBlur" && n.validation.commit(G(Jt)));
511
- }
512
- function nn(t, n) {
513
- e.onSelectedValueChange?.(t, n), !n.isCanceled && (b || pe(() => t), (T() === "none" && X.track().popupElement != null && (e.fillInputOnItemPress ?? !0) || D() && !X.inputInsidePopup()) && $(K(t, e.itemToStringLabel), h(n.reason, n.event)));
514
- }
515
- function rn(e, t) {
516
- let n = e.target, r = X.selectionEvent ?? e;
517
- X.selectionEvent = null;
518
- let a = h(f, r), o = n?.closest("a")?.getAttribute("href");
519
- if (o) {
520
- o.startsWith("#") && en(!1, a);
521
- return;
522
- }
523
- if (E()) {
524
- let e = Array.isArray(A()) ? A() : [];
525
- if (nn(je(e, t, O()) ? ke(e, t, O()) : [...e, t], a), a.isCanceled || (M()?.value.trim() ?? "") === "") return;
526
- X.inputInsidePopup() ? $("", h(i, a.event)) : en(!1, a);
527
- return;
528
- }
529
- nn(t, a), !a.isCanceled && en(!1, a);
530
- }
531
- function an() {
532
- let e = n.validation.getInputControl()?.closest("form") ?? Pe()?.form ?? M()?.form;
533
- e && typeof e.requestSubmit == "function" && e.requestSubmit();
534
- }
535
- function on() {
536
- e.items || X.setForceMounted(!0);
537
- }
538
- function sn() {
539
- M()?.focus();
540
- }
541
- function cn(e, t) {
542
- let n = G(Wt)[e];
543
- n && (X.selectionEvent = t, n.click(), X.selectionEvent = null);
544
- }
545
- function ln() {
546
- ve(!1), be(null), X.resetAfterClose(), T() === "none" ? Q({
547
- activeIndex: null,
548
- selectedIndex: null
549
- }) : Q({ activeIndex: null });
550
- let t = M();
551
- if (E() && t && t.value !== "" && !jt && $("", h(i)), D()) {
552
- if (X.inputInsidePopup()) t && t.value !== "" && $("", h(i));
553
- else {
554
- let n = K(A(), e.itemToStringLabel);
555
- t && t.value !== n && $(n, h(n === "" ? i : d));
556
- }
557
- }
558
- }
559
- let un = { unmount() {
560
- Vt.forceUnmount();
561
- } }, dn = V(() => X.open() || R()), fn = V(() => {
562
- let e = M(), t = e?.tagName === "INPUT", n = e == null || t, r = n || dn(), i = n ? {
563
- autocomplete: "off",
564
- spellcheck: "false",
565
- autocorrect: "off",
566
- autocapitalize: "none"
567
- } : {};
568
- return r && (i.role = "combobox", i["aria-expanded"] = dn() ? "true" : "false", i["aria-haspopup"] = Ke() ? "grid" : "listbox", i["aria-controls"] = dn() ? X.listElement()?.id : void 0, i["aria-autocomplete"] = tt()), i;
569
- }), pn = re({
570
- context: X.context.floatingRoot,
571
- enabled: () => !Be() && !P() && z(),
572
- event: () => "mousedown-only",
573
- toggle: () => !1,
574
- reason: () => u,
575
- touchOpenDelay: () => X.inputInsidePopup() ? 0 : 100
576
- }), mn = fe({
577
- context: X.context.floatingRoot,
578
- tree: () => p,
579
- enabled: () => !Be() && !P() && !R(),
580
- outsidePressEvent: () => ({
581
- mouse: "sloppy",
582
- touch: "intentional"
583
- }),
584
- bubbles: () => R(),
585
- outsidePress: () => (e) => {
586
- let t = e.target;
587
- return !C(N(), t) && !C(X.clearElement, t) && !C(X.chipsContainerElement, t) && !C(we(), t);
588
- }
589
- }), hn = et({
590
- context: X.context.floatingRoot,
591
- enabled: () => !Be() && !P(),
592
- list: Wt,
593
- activeIndex: X.activeIndex,
594
- selectedIndex: X.selectedIndex,
595
- virtual: () => !0,
596
- loopFocus: U,
597
- allowEscape: () => U() && !q(),
598
- focusItemOnHover: Qe,
599
- orientation: () => Ke() ? "both" : "vertical",
600
- cols: Gt,
601
- rtl: () => s() === "rtl",
602
- openOnArrowKeyDown: () => !1,
603
- disabledIndices: () => [],
604
- onNavigate(e, n) {
605
- if (!(!n && !X.open() || X.track().transitionStatus === "ending")) {
606
- if (!n) {
607
- Q({ activeIndex: e });
608
- return;
609
- }
610
- Q({
611
- activeIndex: e,
612
- type: X.keyboardActive ? r : t
613
- });
614
- }
615
- }
616
- }), gn = {
617
- store: X,
618
- tree: p,
619
- node: Bt,
620
- presence: Vt,
621
- id: ze,
622
- items: () => e.items,
623
- hasItems: ct,
624
- query: J,
625
- filteredItems: Tt,
626
- flatFilteredItems: kt,
627
- listEmpty: At,
628
- itemValues: Z,
629
- selectedValue: A,
630
- inputValue: j,
631
- hasSelectedValue: Kt,
632
- hasSelectionChips: qt,
633
- selectionMode: T,
634
- multiple: E,
635
- single: D,
636
- disabled: P,
637
- readOnly: Be,
638
- required: Ue,
639
- modal: I,
640
- grid: Ke,
641
- virtualized: qe,
642
- inline: R,
643
- openOnInputClick: z,
644
- autoHighlight: q,
645
- keepHighlight: Xe,
646
- highlightItemOnHover: Qe,
647
- loopFocus: U,
648
- autoComplete: tt,
649
- submitOnItemClick: $e,
650
- hasInputValueProp: () => ee,
651
- name: at,
652
- form: st,
653
- itemToStringLabel: te,
654
- itemToStringValue: ne,
655
- comparator: O,
656
- inputElement: M,
657
- setInputElement: xe,
658
- triggerElement: N,
659
- setTriggerElement: Se,
660
- inputGroupElement: we,
661
- setInputGroupElement: Te,
662
- internalBackdropElement: Me,
663
- setInternalBackdropElement: Ne,
664
- setOpen: en,
665
- setInputValue: $,
666
- setSelectedValue: nn,
667
- setIndices: Q,
668
- handleSelection: rn,
669
- forceMount: on,
670
- requestSubmit: an,
671
- focusInput: sn,
672
- clickHighlightedItem: cn,
673
- listNavigation: hn,
674
- dismiss: mn,
675
- click: pn,
676
- cols: Gt,
677
- referenceAria: fn,
678
- expanded: dn,
679
- field: n,
680
- formContext: a
681
- }, _n = {
682
- id: _,
683
- name: void 0,
684
- value: Jt,
685
- getValue: Yt,
686
- getControl: () => X.inputInsidePopup() ? N() : M()
687
- };
688
- X.context.floatingRoot.context.data.insideElements = () => [
689
- Me(),
690
- X.startDismissElement,
691
- X.endDismissElement
692
- ], B(() => ({
693
- open: X.open(),
694
- activeTriggerId: X.activeTriggerId()
695
- }), () => G(() => X.reconcileTriggers())), B(() => ({
696
- inline: R(),
697
- open: X.open()
698
- }), (e) => {
699
- e.inline && X.context.floatingRoot.update({ open: !0 });
700
- }), B(() => ({
701
- mode: T(),
702
- inline: R(),
703
- insidePopup: X.inputInsidePopup()
704
- }), (e) => X.setInputOwnsFormValue(e.mode === "none" && (e.inline || !e.insidePopup))), B(() => ({
705
- open: X.open(),
706
- selected: A(),
707
- mode: T(),
708
- values: Z(),
709
- compare: O(),
710
- isMultiple: E()
711
- }), (e) => {
712
- e.open || (X.pointerDownItem = null, e.mode !== "none" && G(() => Q({ selectedIndex: Fe(ct() ? vt() : e.values, e.selected, e.compare, e.isMultiple) })));
713
- }), B(() => ({
714
- activeIndex: X.activeIndex(),
715
- values: Z(),
716
- input: j(),
717
- open: X.open(),
718
- inline: R(),
719
- highlight: q()
720
- }), (e) => G(() => vn(e)));
721
- function vn(e) {
722
- let t = Nt;
723
- if (t) {
724
- let n = e.open || e.inline || X.track().positionerElement?.hidden === !1;
725
- if (t.hasQuery) e.highlight && n && X.setActiveIndex(0), Nt = null;
726
- else if (String(e.input).trim() === "" && (Nt = null, n)) {
727
- let n = t.selection;
728
- e.highlight === "always" && !n && T() === "none" && X.setActiveIndex(0), queueMicrotask(() => G(() => {
729
- if (!X.open() && !R() || (M()?.value.trim() ?? "") !== "") return;
730
- let e = A(), t = E(), r = t && Array.isArray(e) ? e[e.length - 1] : e, i = T() !== "none" && r != null;
731
- i || n ? X.setActiveIndex(i ? Fe(Z(), e, O(), t) : null) : q() === "always" && X.setActiveIndex(0);
732
- }));
733
- }
734
- }
735
- if (!e.open && !e.inline) return;
736
- if (e.activeIndex == null) {
737
- if (e.highlight === "always" && e.values.length > 0) {
738
- X.setActiveIndex(0);
739
- return;
740
- }
741
- Qt(void 0, -1, d);
742
- return;
743
- }
744
- if (e.activeIndex >= e.values.length) {
745
- Qt(void 0, -1, d), X.setActiveIndex(null);
746
- return;
747
- }
748
- let n = e.values[e.activeIndex], r = Mt.value, i = r !== Ct && Ae(n, r, O());
749
- (Mt.index !== e.activeIndex || !i) && Qt(n, e.activeIndex, d);
750
- }
751
- B(() => ({
752
- index: X.activeIndex(),
753
- elements: Wt()
754
- }), (e) => {
755
- e.index == null || !X.keyboardActive || e.elements[e.index]?.scrollIntoView?.({
756
- block: "nearest",
757
- inline: "nearest"
758
- });
759
- }), B(() => ({
760
- open: X.open(),
761
- mounted: Vt.mounted(),
762
- count: Z().length
763
- }), (e) => {
764
- if (!e.open) {
765
- Ft = !1, Pt = null;
766
- return;
767
- }
768
- !e.mounted || e.count === 0 || Ft || (Ft = !0, G(() => {
769
- let t = Pt;
770
- if (Pt = null, X.activeIndex() != null || _e()) return;
771
- let n = T() === "none" ? null : X.selectedIndex();
772
- if (n != null) {
773
- Q({ activeIndex: n });
774
- return;
775
- }
776
- if (t && (T() !== "none" || q() !== !1)) {
777
- Q({ activeIndex: t === "first" ? 0 : e.count - 1 });
778
- return;
779
- }
780
- q() === "always" && Q({ activeIndex: 0 });
781
- }));
782
- }), B(() => ({
783
- mode: T(),
784
- input: j(),
785
- selected: A(),
786
- isMultiple: E()
787
- }), (e) => {
788
- if (e.mode === "none") {
789
- n.setFilled(String(e.input) !== "");
790
- return;
791
- }
792
- n.setFilled(e.isMultiple ? Array.isArray(e.selected) && e.selected.length > 0 : e.selected != null);
793
- }), B(() => ({
794
- hasItems: ct(),
795
- highlight: q(),
796
- count: kt().length
797
- }), (e) => {
798
- e.hasItems && e.highlight && e.count === 0 && G(() => Q({ activeIndex: null }));
799
- }), B(() => ({
800
- query: J(),
801
- open: X.open()
802
- }), (e) => {
803
- let t = zt;
804
- zt = e.query, !(t === e.query || !e.open) && e.query !== "" && e.query !== String(me) && ve(!0);
805
- });
806
- function yn() {
807
- let t = K(A(), e.itemToStringLabel);
808
- j() !== t && $(t, h(d));
809
- }
810
- B(() => ({
811
- selected: A(),
812
- mode: T(),
813
- compare: O()
814
- }), (e) => {
815
- let t = It;
816
- Dt(e.selected, t, e.compare) || (It = Et(e.selected), e.mode !== "none" && G(() => {
817
- a.clearError(at()), n.setDirty(!Ot(e.selected, n.validityData().initialValue, e.compare)), n.validation.change(e.selected), D() && !ee && !X.inputInsidePopup() && yn();
818
- }));
819
- }), B(() => ({
820
- input: j(),
821
- mode: T()
822
- }), (e) => {
823
- let t = Lt;
824
- Lt = e.input, t !== e.input && e.mode === "none" && G(() => {
825
- a.clearError(at()), n.setDirty(e.input !== n.validityData().initialValue), n.validation.change(e.input);
826
- });
827
- }), B(() => e.items, (e) => {
828
- let t = Rt;
829
- Rt = e, t !== e && G(() => {
830
- !D() || ee || X.inputInsidePopup() || _e() || yn();
831
- });
832
- }), B(() => ({
833
- disabled: P(),
834
- id: ze(),
835
- name: e.name,
836
- control: X.inputInsidePopup() ? N() : M()
837
- }), (e) => {
838
- _n.id = e.id, _n.name = e.name, n.registerFieldControl(m, e.disabled || !e.control ? void 0 : _n);
839
- }), B(Pe, (e) => {
840
- if (e) return n.validation.registerInput(m, e, () => X.inputInsidePopup() ? N() : M());
841
- }), B(() => e.actionsRef, (e) => {
842
- e?.(un);
843
- });
844
- function bn(e, t) {
845
- Pt = e, X.setOpenMethod("keyboard"), en(!0, h("list-navigation", t, N() ?? void 0)) || (Pt = null);
846
- }
847
- function xn(e) {
848
- if (!(Be() || P())) {
849
- if (!X.open() && !R()) {
850
- if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
851
- e.preventDefault(), e.stopPropagation(), bn(e.key === "ArrowDown" ? "first" : "last", e);
852
- return;
853
- }
854
- hn.onKeyDown(e);
855
- }
856
- }
857
- gn.listNavigation = {
858
- ...hn,
859
- onKeyDown: xn
860
- };
861
- function Sn(t) {
862
- if (t.defaultPrevented || P() || Be()) return;
863
- let n = t.currentTarget.value, r = n.toLowerCase(), i = h(d, t), a = () => G(Z).findIndex((t) => ot(t, e.itemToStringValue).toLowerCase() === r || K(t, e.itemToStringLabel).toLowerCase() === r);
864
- D() && (on(), e.items && a() === -1 && X.setForceMounted(!0)), queueMicrotask(() => G(() => {
865
- if (E()) return;
866
- if (T() === "none") {
867
- $(n, i);
868
- return;
869
- }
870
- let e = a();
871
- e === -1 && (e = Ut().findIndex((e) => e != null && e.toLowerCase() === r));
872
- let t = e === -1 ? void 0 : Z()[e];
873
- t != null && nn(t, i);
874
- }));
875
- }
876
- return W(() => {
877
- n.registerFieldControl(m, void 0), X.clearInteractionProps(), delete X.context.floatingRoot.context.data.insideElements;
878
- }), F(ht, {
879
- value: gn,
880
- get children() {
881
- return F(oe, {
882
- value: p,
883
- get children() {
884
- return F(le, {
885
- get value() {
886
- return Bt.id ?? null;
887
- },
888
- get children() {
889
- return [
890
- We(() => e.children),
891
- (() => {
892
- var t = He(yt);
893
- return t.addEventListener("change", Sn), t.addEventListener("focus", () => {
894
- if (X.inputInsidePopup()) {
895
- N()?.focus();
896
- return;
897
- }
898
- (M() ?? N())?.focus();
899
- }), Ge(() => [((e) => Ie(e)), e.inputRef], t), Ve(() => ({
900
- e: Zt() == null ? `${ze()}-hidden-input` : void 0,
901
- t: st(),
902
- a: Zt(),
903
- o: e.formAutoComplete,
904
- i: Xt(),
905
- n: P(),
906
- s: Ue() && !(E() && qt()),
907
- h: Be(),
908
- r: Zt() ? St : xt,
909
- d: o.getAriaDescribedBy(void 0),
910
- l: n.state().valid === !1 && !P() ? "true" : void 0
911
- }), ({ e, t: n, a: r, o: i, i: a, n: o, s, h: c, r: l, d: u, l: d }, f) => {
912
- e !== f?.e && L(t, "id", e), n !== f?.t && L(t, "form", n), r !== f?.a && L(t, "name", r), i !== f?.o && L(t, "autocomplete", i), t.value = a ?? "", o !== f?.n && L(t, "disabled", o), s !== f?.s && L(t, "required", s), c !== f?.h && L(t, "readonly", c), Je(t, l, f?.r), u !== f?.d && L(t, "aria-describedby", u), d !== f?.l && L(t, "aria-invalid", d);
913
- }), t;
914
- })(),
915
- F(Ye, {
916
- get each() {
917
- return We(() => !!(E() && at()))() ? A() ?? [] : [];
918
- },
919
- children: (t) => (() => {
920
- var n = He(bt);
921
- return Ve(() => ({
922
- e: st(),
923
- t: at(),
924
- a: ot(t, e.itemToStringValue),
925
- o: P()
926
- }), ({ e, t, a: r, o: i }, a) => {
927
- e !== a?.e && L(n, "form", e), t !== a?.t && L(n, "name", t), n.value = r ?? "", i !== a?.o && L(n, "disabled", i);
928
- }), n;
929
- })()
930
- })
931
- ];
932
- }
933
- });
934
- }
935
- });
936
- }
937
- });
938
- }
939
- function Et(e) {
940
- return Array.isArray(e) ? e.slice() : e;
941
- }
942
- function Dt(e, t, n) {
943
- return Array.isArray(e) && Array.isArray(t) ? Pe(e, t, n) : Object.is(e, t);
944
- }
945
- function Ot(e, t, n) {
946
- return Array.isArray(e) && Array.isArray(t) ? Pe(e, t, n) : e === t;
947
- }
948
- //#endregion
949
- //#region src/combobox/utils/comboboxPopupId.ts
950
- function kt(e) {
951
- return e == null ? void 0 : `${e}-popup`;
952
- }
953
- //#endregion
954
- //#region src/combobox/utils/stateAttributesMapping.ts
955
- var At = {
956
- ...he,
957
- ...Te,
958
- popupSide: (e) => e ? { "data-popup-side": e } : null,
959
- listEmpty: (e) => e ? { "data-list-empty": "" } : null
960
- }, jt = { ...ge }, Mt = {
961
- ..._e,
962
- instant: (e) => e ? { "data-instant": e } : null
963
- }, Nt = { "data-open": "" }, Pt = { "data-closed": "" }, Ft = {
964
- open: (e) => e ? Nt : Pt,
965
- ..._
966
- }, It = {
967
- ...me,
968
- ..._
969
- };
970
- //#endregion
971
- //#region src/combobox/trigger/ComboboxTrigger.tsx
972
- function Lt(t) {
973
- let r = Y(), i = Le(), a = t, o = t, s = Symbol("ComboboxTrigger"), [c, u] = H(null, { ownedWrite: !0 }), f = V(() => a.nativeButton ?? !0), g = V(() => r.disabled() || (a.disabled ?? !1)), _ = V(() => r.store.inputInsidePopup()), y = V(() => _() ? a.id ?? r.id() : a.id), b = V(() => {
974
- if (r.store.open()) return _() ? r.store.popupId() ?? kt(r.id()) : r.store.listElement()?.id;
975
- }), x = V(() => a["aria-labelledby"] ?? i.labelId() ?? r.store.labelId()), S = V(() => ({
976
- ...r.field.state(),
977
- open: r.store.open(),
978
- disabled: g(),
979
- popupSide: r.store.resolvedPopupSide(),
980
- listEmpty: r.listEmpty(),
981
- placeholder: r.selectionMode() !== "none" && !r.hasSelectedValue()
982
- })), w = V(() => p(t.class, S())), T = V(() => m(t.style, S())), E = V(() => e(S(), At)), D = U(o, "aria-labelledby", "as", "class", "disabled", "id", "nativeButton", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "onPointerEnter", "ref", "style"), O = re({
983
- context: r.store.context.floatingRoot,
984
- enabled: () => !r.readOnly() && !r.disabled(),
985
- event: () => "mousedown"
986
- }), te = tt({
987
- context: r.store.context.floatingRoot,
988
- enabled: () => !r.store.open() && !r.readOnly() && !r.disabled() && r.selectionMode() === "single",
989
- list: () => r.store.collection.labels(),
990
- elements: () => r.store.collection.elements(),
991
- activeIndex: r.store.activeIndex,
992
- selectedIndex: r.store.selectedIndex,
993
- onMatch(e) {
994
- let t = r.itemValues()[e];
995
- t !== void 0 && r.setSelectedValue(t, h(d));
996
- }
997
- }), ne = "", k, ie;
998
- de(() => r.store, y, c);
999
- function ae(e) {
1000
- ne = e.pointerType || "", O.onPointerDown(e);
1001
- }
1002
- function oe() {
1003
- r.field.setFocused(!0), !(g() || r.readOnly()) && (clearTimeout(k), k = setTimeout(() => r.forceMount(), 0));
1004
- }
1005
- function se(e) {
1006
- G(() => {
1007
- C(r.store.track().positionerElement, e.relatedTarget) || (r.field.setTouched(!0), r.field.setFocused(!1), r.field.validationMode() === "onBlur" && r.field.validation.commit(r.selectionMode() === "none" ? r.inputValue() : r.selectedValue()), te.onBlur(e));
1008
- });
1009
- }
1010
- function ce(e) {
1011
- ie?.();
1012
- let t = ee(e), n = (t) => {
1013
- ie = void 0;
1014
- let n = t.target;
1015
- if (C(e, n) || C(r.store.track().positionerElement, n) || C(r.store.listElement(), n)) return;
1016
- let i = e.getBoundingClientRect();
1017
- t.clientX >= i.left && t.clientX <= i.right && t.clientY >= i.top && t.clientY <= i.bottom || r.setOpen(!1, h(l, t));
1018
- };
1019
- t.addEventListener("mouseup", n, { once: !0 }), ie = () => t.removeEventListener("mouseup", n);
1020
- }
1021
- function le(e) {
1022
- if (g() || r.readOnly()) return;
1023
- let t = e.currentTarget;
1024
- _() || r.store.context.floatingRoot.update({ domReferenceElement: t }), r.forceMount(), ne !== "touch" && (r.focusInput(), _() || e.preventDefault()), r.store.open() || (r.store.setOpenMethod(ne || "mouse"), _() && ce(t)), O.onMouseDown(e);
1025
- }
1026
- function ue(e) {
1027
- e.detail === 0 && r.store.setOpenMethod("keyboard"), O.onClick(e);
1028
- }
1029
- function fe(e) {
1030
- r.readOnly() || (te.onKeyDown(e), (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), e.stopPropagation(), r.store.setOpenMethod("keyboard"), r.setOpen(!0, h(n, e)), r.focusInput()));
1031
- }
1032
- let pe = v(() => a.onBlur, () => se), A = v(() => G(() => g() ? xe : void 0), () => a.onClick, () => ue), me = v(() => a.onFocus, () => oe), he = v(() => G(() => g() ? be : void 0), () => a.onKeyDown, () => fe, () => G(() => f() ? void 0 : N)), ge = v(() => G(() => g() ? ye : void 0), () => a.onKeyUp, () => G(() => f() ? void 0 : M)), j = v(() => G(() => g() ? ye : void 0), () => a.onMouseDown, () => le), _e = v(() => G(() => g() ? xe : void 0), () => a.onPointerDown, () => ae), ve = v(() => a.onPointerEnter, () => (e) => {
1033
- ne = e.pointerType || "";
1034
- });
1035
- return B(() => ({
1036
- id: y(),
1037
- element: c(),
1038
- insidePopup: _()
1039
- }), (e) => (r.setTriggerElement(e.element), i.registerControlId(s, e.insidePopup ? e.id : void 0), () => {
1040
- G(r.triggerElement) === e.element && r.setTriggerElement(null);
1041
- })), W(() => {
1042
- clearTimeout(k), ie?.(), i.registerControlId(s, void 0);
1043
- }), F(P, I({
1044
- get component() {
1045
- return t.as ?? "button";
1046
- },
1047
- ref: [((e) => u(e)), a.ref],
1048
- get id() {
1049
- return y();
1050
- },
1051
- get type() {
1052
- return f() ? "button" : void 0;
1053
- },
1054
- get tabindex() {
1055
- return _() ? 0 : -1;
1056
- },
1057
- get role() {
1058
- return _() ? "combobox" : void 0;
1059
- },
1060
- get disabled() {
1061
- return f() && g() ? !0 : void 0;
1062
- },
1063
- get "aria-disabled"() {
1064
- return !f() && g() ? "true" : void 0;
1065
- },
1066
- get "aria-expanded"() {
1067
- return r.store.open() ? "true" : "false";
1068
- },
1069
- get "aria-haspopup"() {
1070
- return _() ? "dialog" : "listbox";
1071
- },
1072
- get "aria-controls"() {
1073
- return b();
1074
- },
1075
- get "aria-required"() {
1076
- return _() && r.required() ? "true" : void 0;
1077
- },
1078
- get "aria-labelledby"() {
1079
- return x();
1080
- },
1081
- get "aria-invalid"() {
1082
- return S().valid === !1 && !g() ? "true" : void 0;
1083
- },
1084
- "data-base-ui-click-trigger": "",
1085
- get class() {
1086
- return w();
1087
- },
1088
- get style() {
1089
- return T();
1090
- },
1091
- onBlur: pe,
1092
- onClick: A,
1093
- onFocus: me,
1094
- onKeyDown: he,
1095
- onKeyUp: ge,
1096
- onMouseDown: j,
1097
- onPointerDown: _e,
1098
- onPointerEnter: ve
1099
- }, E, D));
1100
- }
1101
- //#endregion
1102
- //#region src/combobox/chips/ComboboxChipsContext.ts
1103
- var Rt = class {
1104
- registrations = /* @__PURE__ */ new Map();
1105
- revision;
1106
- setRevision;
1107
- order = 0;
1108
- orders = /* @__PURE__ */ new Map();
1109
- constructor() {
1110
- let [e, t] = H(0, { ownedWrite: !0 });
1111
- this.revision = e, this.setRevision = t;
1112
- }
1113
- register(e, t) {
1114
- return this.registrations.set(e, t), this.orders.set(e, this.order), this.order += 1, this.touch(), () => {
1115
- this.registrations.delete(e) && (this.orders.delete(e), this.touch());
1116
- };
1117
- }
1118
- touch() {
1119
- this.setRevision((e) => e + 1);
1120
- }
1121
- tokens() {
1122
- return this.revision(), Array.from(this.registrations.keys()).sort((e, t) => {
1123
- let n = this.registrations.get(e)?.() ?? null, r = this.registrations.get(t)?.() ?? null;
1124
- if (n && r && n !== r) {
1125
- let e = n.compareDocumentPosition(r);
1126
- if (e & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
1127
- if (e & Node.DOCUMENT_POSITION_PRECEDING) return 1;
1128
- }
1129
- return (this.orders.get(e) ?? 0) - (this.orders.get(t) ?? 0);
1130
- });
1131
- }
1132
- elements() {
1133
- return this.tokens().map((e) => this.registrations.get(e)?.() ?? null);
1134
- }
1135
- indexOf(e) {
1136
- return this.tokens().indexOf(e);
1137
- }
1138
- size() {
1139
- return this.tokens().length;
1140
- }
1141
- }, zt = Symbol("ComboboxChipsContext"), X = Xe(zt);
1142
- function Bt() {
1143
- let e = $e(X);
1144
- return e === zt ? void 0 : e;
1145
- }
1146
- function Vt() {
1147
- let e = Bt();
1148
- if (!e) throw Error("Base UI: ComboboxChipsContext is missing. Chip parts must be placed within <Combobox.Chips>.");
1149
- return e;
1150
- }
1151
- //#endregion
1152
- //#region src/combobox/positioner/ComboboxPositionerContext.ts
1153
- var Ht = Symbol("ComboboxPositionerContext"), Z = Xe(Ht);
1154
- function Ut(e = !1) {
1155
- let t = $e(Z);
1156
- if (t === Ht) {
1157
- if (e) return;
1158
- throw Error("Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component.");
1159
- }
1160
- return t;
1161
- }
1162
- //#endregion
1163
- //#region src/combobox/utils/ComboboxInternalDismissButton.tsx
1164
- var Wt = /* @__PURE__ */ R("<span role=button aria-label=Dismiss>"), Gt = {
1165
- "clip-path": "inset(50%)",
1166
- overflow: "hidden",
1167
- "white-space": "nowrap",
1168
- border: "0",
1169
- padding: "0",
1170
- width: "1px",
1171
- height: "1px",
1172
- margin: "-1px",
1173
- position: "absolute",
1174
- top: "0",
1175
- left: "0"
1176
- };
1177
- function Kt(e) {
1178
- let t = Y();
1179
- function n(e) {
1180
- t.setOpen(!1, h(o, e, e.currentTarget));
1181
- }
1182
- var r = He(Wt);
1183
- return r.$$keydown = (e) => {
1184
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
1185
- }, r.$$click = n, Ge(() => (t) => e.ref?.(t), r), Ve(() => Gt, (e, t) => {
1186
- Je(r, e, t);
1187
- }), Ke(), r;
1188
- }
1189
- Be(["click", "keydown"]);
1190
- //#endregion
1191
- //#region src/combobox/utils/parts.ts
1192
- function qt(e) {
1193
- return e === "rtl" ? ["ArrowRight", "ArrowLeft"] : ["ArrowLeft", "ArrowRight"];
1194
- }
1195
- function Jt(e, t) {
1196
- let n = e >= t - 1 ? t - 2 : e;
1197
- return n >= 0 ? n : void 0;
1198
- }
1199
- //#endregion
1200
- //#region src/combobox/input/ComboboxInput.tsx
1201
- function Yt(n) {
1202
- let o = Y(), c = Bt(), l = Ut(!0), u = Le(), f = Ce(), g = n, _ = n, y = `base-ui-${Ze()}`, b = l !== void 0, x = V(() => b || o.inline()), S = V(() => !x() || o.modal()), C = V(() => g.id ?? (x() ? y : o.id())), w = V(() => o.field.disabled() || o.disabled() || (g.disabled ?? !1)), ee = V(() => o.selectionMode() === "none" && !b), [T, E] = H(null), D = !1, O = null, te = !1, ne = V(() => b ? {
1203
- ...o.field.state(),
1204
- ...we
1205
- } : o.field.state()), k = V(() => ({
1206
- ...ne(),
1207
- open: o.store.open(),
1208
- disabled: w(),
1209
- readOnly: o.readOnly(),
1210
- popupSide: o.store.resolvedPopupSide(),
1211
- listEmpty: o.listEmpty()
1212
- })), re = V(() => p(n.class, k())), ie = V(() => m(n.style, k())), ae = V(() => e(k(), At)), oe = V(() => {
1213
- let e = o.store.activeIndex();
1214
- return e == null ? void 0 : `${o.id()}-${e}`;
1215
- }), se = U(_, "as", "class", "disabled", "id", "onBlur", "onCompositionEnd", "onCompositionStart", "onFocus", "onInput", "onKeyDown", "onMouseDown", "onPointerDown", "onPointerMove", "ref", "style");
1216
- function ce() {
1217
- o.setIndices({
1218
- activeIndex: null,
1219
- selectedIndex: null,
1220
- type: o.store.keyboardActive ? r : t
1221
- });
1222
- }
1223
- function le() {
1224
- if (o.field.setFocused(!0), !o.inline() || !te) return;
1225
- te = !1;
1226
- let e = O;
1227
- e != null && o.itemValues()[e] !== void 0 && o.setIndices({ activeIndex: e });
1228
- }
1229
- function ue() {
1230
- o.field.setTouched(!0), o.field.setFocused(!1);
1231
- let e = o.store.activeIndex();
1232
- o.inline() && e !== null && o.autoHighlight() !== "always" && (O = e, te = !0, o.setIndices({ activeIndex: null })), o.field.validationMode() === "onBlur" && o.field.validation.commit(o.selectionMode() === "none" ? o.inputValue() : o.selectedValue());
1233
- }
1234
- function de(e) {
1235
- ze() || (D = !0, E(e.currentTarget.value));
1236
- }
1237
- function fe(e) {
1238
- D = !1;
1239
- let t = e.currentTarget.value;
1240
- E(null), o.setInputValue(t, h(a, e));
1241
- }
1242
- function pe(e, t, n) {
1243
- o.readOnly() || w() || !e || !n || (o.setOpen(!0, h(a, t)), o.autoHighlight() || ce());
1244
- }
1245
- function A(e) {
1246
- let t = e.currentTarget, n = !e.inputType || e.inputType === "insertReplacementText", r = D || !n;
1247
- if (D) {
1248
- let n = t.value;
1249
- E(n), n === "" && !o.openOnInputClick() && !o.store.inputInsidePopup() && o.setOpen(!1, h(i, e));
1250
- let a = n.trim(), s = !!o.autoHighlight() && a !== "";
1251
- pe(a, e, r), o.store.open() && o.store.activeIndex() !== null && !s && ce();
1252
- return;
1253
- }
1254
- let s = h(a, e);
1255
- if (o.setInputValue(t.value, s), s.isCanceled) return;
1256
- let c = t.value === "", l = h(i, e);
1257
- c && !o.store.inputInsidePopup() && (o.selectionMode() === "single" && o.setSelectedValue(null, l), o.openOnInputClick() || o.setOpen(!1, l)), pe(t.value.trim(), e, r), o.store.open() && o.store.activeIndex() !== null && !o.autoHighlight() && ce();
1258
- }
1259
- function me(e) {
1260
- if (!c) return;
1261
- let t = e.currentTarget, n = c.highlightedChipIndex(), r = c.chips.size(), [i, a] = qt(f()), s = o.selectedValue(), l = Array.isArray(s) ? s : [];
1262
- if (n !== void 0) {
1263
- if (e.key === i) return e.preventDefault(), n > 0 ? n - 1 : void 0;
1264
- if (e.key === a) return e.preventDefault(), n < r - 1 ? n + 1 : void 0;
1265
- if (e.key === "Backspace" || e.key === "Delete") {
1266
- e.preventDefault();
1267
- let t = Jt(n, l.length);
1268
- return ce(), t;
1269
- }
1270
- return;
1271
- }
1272
- if (e.key === i && (t.selectionStart ?? 0) === 0 && l.length > 0) return e.preventDefault(), r > 0 ? r - 1 : void 0;
1273
- }
1274
- function he(e) {
1275
- let t = o.selectedValue(), n = o.selectionMode() === "multiple" && Array.isArray(t) ? t.length === 0 : t === null, r = h(s, e);
1276
- o.setInputValue("", r), o.setSelectedValue(o.selectionMode() === "multiple" ? [] : null, r), !n && !o.inline() && !r.isPropagationAllowed && e.stopPropagation();
1277
- }
1278
- function ge(e) {
1279
- let t = !w() && !o.readOnly(), n = e.ctrlKey || e.shiftKey || e.altKey || e.metaKey;
1280
- if (t && !n && (o.store.keyboardActive = !0), o.grid() && o.store.activeIndex() == null && (e.key === "ArrowLeft" || e.key === "ArrowRight") || o.listNavigation.onKeyDown(e), o.dismiss.onKeyDown(e), !t || n) return;
1281
- let r = e.currentTarget, i = f() === "rtl";
1282
- if (e.key === "Home" || e.key === "End") {
1283
- e.preventDefault(), e.stopPropagation();
1284
- let t = r.scrollWidth - r.clientWidth, n = e.key === "Home", a = Xt() && i === n ? r.value.length : n ? 0 : r.value.length;
1285
- r.setSelectionRange(a, a), r.scrollLeft = n ? 0 : i ? -t : t;
1286
- return;
1287
- }
1288
- if (!o.presence.mounted() && e.key === "Escape") {
1289
- he(e);
1290
- return;
1291
- }
1292
- if (c && e.key === "Backspace" && r.value === "" && c.highlightedChipIndex() === void 0 && Array.isArray(o.selectedValue()) && o.selectedValue().length > 0) {
1293
- let t = o.selectedValue(), n = c.chips.size(), r = n > 0 ? n - 1 : t.length - 1;
1294
- ce(), o.setSelectedValue(t.filter((e, t) => t !== r), h(d, e));
1295
- return;
1296
- }
1297
- if (c) {
1298
- let t = c.highlightedChipIndex() !== void 0, n = me(e);
1299
- c.setHighlightedChipIndex(n), n === void 0 ? t && o.focusInput() : c.chips.elements()[n]?.focus();
1300
- }
1301
- if (e.keyCode !== 229 && e.key === "Enter" && o.store.open()) {
1302
- let t = o.store.activeIndex();
1303
- if (t === null) {
1304
- if (o.inline()) return;
1305
- o.setOpen(!1, h(d, e));
1306
- return;
1307
- }
1308
- e.preventDefault(), e.stopPropagation(), o.clickHighlightedItem(t, e);
1309
- }
1310
- }
1311
- function j() {
1312
- o.store.keyboardActive = !1;
1313
- }
1314
- let _e = v(() => g.onBlur, () => ue), ve = v(() => g.onCompositionEnd, () => fe), ye = v(() => g.onCompositionStart, () => de), be = v(() => g.onFocus, () => le), M = v(() => g.onInput, () => A), xe = v(() => g.onKeyDown, () => ge), N = v(() => g.onMouseDown, () => (e) => o.click.onMouseDown(e)), Se = v(() => g.onPointerDown, () => (e) => {
1315
- j(), o.click.onPointerDown(e);
1316
- }), Te = v(() => g.onPointerMove, () => j);
1317
- B(() => ({
1318
- insidePopup: x(),
1319
- owns: ee()
1320
- }), (e) => {
1321
- o.store.setInputInsidePopup(e.insidePopup), o.store.setInputOwnsFormValue(e.owns), e.insidePopup && !o.hasInputValueProp() && G(() => o.setInputValue("", h(d)));
1322
- }), W(() => {
1323
- G(o.inputElement) === Ee && o.setInputElement(null);
1324
- });
1325
- let Ee = null;
1326
- return [F(z, {
1327
- get when() {
1328
- return We(() => !!o.store.open())() ? S() : o.store.open();
1329
- },
1330
- get children() {
1331
- return F(Kt, { ref: (e) => {
1332
- o.store.startDismissElement = e;
1333
- } });
1334
- }
1335
- }), F(P, I({
1336
- get component() {
1337
- return n.as ?? "input";
1338
- },
1339
- ref: [((e) => {
1340
- Ee = e, o.setInputElement(e);
1341
- }), g.ref],
1342
- get id() {
1343
- return C();
1344
- },
1345
- get value() {
1346
- return T() ?? o.inputValue();
1347
- },
1348
- get disabled() {
1349
- return w();
1350
- },
1351
- get readonly() {
1352
- return o.readOnly();
1353
- },
1354
- get required() {
1355
- return We(() => o.selectionMode() === "none")() ? o.required() : void 0;
1356
- },
1357
- get form() {
1358
- return o.form();
1359
- },
1360
- get name() {
1361
- return We(() => !!ee())() ? o.name() : void 0;
1362
- },
1363
- get "aria-readonly"() {
1364
- return o.readOnly() ? "true" : void 0;
1365
- },
1366
- get "aria-required"() {
1367
- return o.required() ? "true" : void 0;
1368
- },
1369
- get "aria-labelledby"() {
1370
- return u.labelId();
1371
- },
1372
- get "aria-describedby"() {
1373
- return u.getAriaDescribedBy(void 0);
1374
- },
1375
- get "aria-activedescendant"() {
1376
- return oe();
1377
- },
1378
- get "aria-invalid"() {
1379
- return k().valid === !1 && !w() ? "true" : void 0;
1380
- },
1381
- "data-base-ui-click-trigger": "",
1382
- get class() {
1383
- return re();
1384
- },
1385
- get style() {
1386
- return ie();
1387
- },
1388
- onBlur: _e,
1389
- onCompositionEnd: ve,
1390
- onCompositionStart: ye,
1391
- onFocus: be,
1392
- onInput: M,
1393
- onKeyDown: xe,
1394
- onMouseDown: N,
1395
- onPointerDown: Se,
1396
- onPointerMove: Te
1397
- }, () => o.referenceAria(), ae, se))];
1398
- }
1399
- function Xt() {
1400
- return typeof navigator < "u" && navigator.userAgent.includes("Firefox");
1401
- }
1402
- //#endregion
1403
- //#region src/combobox/utils/handleInputPress.ts
1404
- function Zt(e, t, n, r, i) {
1405
- if (e.baseUIHandlerPrevented || r) return;
1406
- let a = e.target, o = b(a) ? a : null;
1407
- o !== e.currentTarget && (i?.(o) || S(o)) || (e.preventDefault(), !n && (t.focusInput(), t.openOnInputClick() && t.setOpen(!0, h(u, e))));
1408
- }
1409
- //#endregion
1410
- //#region src/combobox/input-group/ComboboxInputGroup.tsx
1411
- function Qt(t) {
1412
- let n = Y(), r = t, i = t, a = V(() => ({
1413
- ...n.field.state(),
1414
- open: n.store.open(),
1415
- disabled: n.disabled(),
1416
- readOnly: n.readOnly(),
1417
- popupSide: n.store.resolvedPopupSide(),
1418
- listEmpty: n.listEmpty(),
1419
- placeholder: n.selectionMode() !== "none" && !n.hasSelectedValue()
1420
- })), o = V(() => p(t.class, a())), s = V(() => m(t.style, a())), c = V(() => e(a(), At)), l = U(i, "as", "class", "onMouseDown", "ref", "style"), u = v(() => r.onMouseDown, () => (e) => Zt(e, n, n.disabled(), n.readOnly(), (e) => C(n.store.chipsContainerElement, e)));
1421
- W(() => {
1422
- G(n.inputGroupElement) === d && n.setInputGroupElement(null);
1423
- });
1424
- let d = null;
1425
- return F(P, I({
1426
- get component() {
1427
- return t.as ?? "div";
1428
- },
1429
- ref: [((e) => {
1430
- d = e, n.setInputGroupElement(e);
1431
- }), r.ref],
1432
- role: "group",
1433
- get class() {
1434
- return o();
1435
- },
1436
- get style() {
1437
- return s();
1438
- },
1439
- onMouseDown: u
1440
- }, c, l));
1441
- }
1442
- //#endregion
1443
- //#region src/combobox/icon/ComboboxIcon.tsx
1444
- var Q = /* @__PURE__ */ R("<span>");
1445
- function $t(t) {
1446
- let n = Y(), r = t, i = t, a = V(() => ({ open: n.store.open() })), o = V(() => p(t.class, a())), s = V(() => m(t.style, a())), c = V(() => e(a(), me)), l = U(i, "as", "class", "ref", "style");
1447
- return F(z, {
1448
- get when() {
1449
- return t.as;
1450
- },
1451
- get fallback() {
1452
- var e = He(Q);
1453
- return Ge(() => [r.ref], e), qe(e, I({
1454
- "aria-hidden": "true",
1455
- get class() {
1456
- return o();
1457
- },
1458
- get style() {
1459
- return s();
1460
- }
1461
- }, c, l), !0), Ue(e, () => t.children ?? "▼"), Ke(), e;
1462
- },
1463
- children: (e) => F(P, I({
1464
- get component() {
1465
- return e();
1466
- },
1467
- ref: [r.ref],
1468
- "aria-hidden": "true",
1469
- get class() {
1470
- return o();
1471
- },
1472
- get style() {
1473
- return s();
1474
- }
1475
- }, c, l, { get children() {
1476
- return t.children ?? "▼";
1477
- } }))
1478
- });
1479
- }
1480
- //#endregion
1481
- //#region src/combobox/clear/ComboboxClear.tsx
1482
- function $(n) {
1483
- let i = Y(), a = n, o = n, s = V(() => a.nativeButton ?? !0), l = V(() => i.field.disabled() || i.disabled() || (a.disabled ?? !1)), u = V(() => {
1484
- let e = i.selectionMode();
1485
- return e === "none" ? i.inputValue() !== "" : e === "single" ? i.selectedValue() != null : i.hasSelectionChips();
1486
- }), d = A(() => u()), f = V(() => (a.keepMounted ?? !1) || d.mounted()), g = V(() => ({
1487
- open: i.store.open(),
1488
- disabled: l(),
1489
- visible: u(),
1490
- transitionStatus: d.transitionStatus()
1491
- })), _ = V(() => p(n.class, g())), b = V(() => m(n.style, g())), x = V(() => e(g(), It)), S = U(o, "as", "class", "disabled", "keepMounted", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "ref", "style"), C = null;
1492
- B(() => ({
1493
- visible: u(),
1494
- status: d.transitionStatus(),
1495
- element: C
1496
- }), (e) => {
1497
- if (e.visible || e.status !== "ending" || !e.element) return;
1498
- let t = new AbortController();
1499
- return y(e.element, () => {
1500
- G(u) || d.setMounted(!1);
1501
- }, t.signal), () => t.abort();
1502
- });
1503
- function w(e) {
1504
- if (l() || i.readOnly()) return;
1505
- let n = i.store.keyboardActive ? r : t;
1506
- i.setInputValue("", h(c, e)), i.selectionMode() === "none" ? i.setIndices({
1507
- activeIndex: null,
1508
- type: n
1509
- }) : (i.setSelectedValue(Array.isArray(i.selectedValue()) ? [] : null, h(c, e)), i.setIndices({
1510
- activeIndex: null,
1511
- selectedIndex: null,
1512
- type: n
1513
- })), i.focusInput();
1514
- }
1515
- let ee = v(() => G(() => l() ? xe : void 0), () => a.onClick, () => w), T = v(() => a.onKeyDown, () => G(() => s() ? void 0 : N)), E = v(() => G(() => l() ? ye : void 0), () => a.onKeyUp, () => G(() => s() ? void 0 : M)), D = v(() => a.onMouseDown, () => (e) => e.preventDefault());
1516
- return F(z, {
1517
- get when() {
1518
- return f();
1519
- },
1520
- get children() {
1521
- return F(P, I({
1522
- get component() {
1523
- return n.as ?? "button";
1524
- },
1525
- ref: [((e) => {
1526
- C = e, i.store.clearElement = e;
1527
- }), a.ref],
1528
- get type() {
1529
- return s() ? "button" : void 0;
1530
- },
1531
- tabindex: -1,
1532
- get disabled() {
1533
- return s() && l() ? !0 : void 0;
1534
- },
1535
- get "aria-disabled"() {
1536
- return !s() && l() ? "true" : void 0;
1537
- },
1538
- get class() {
1539
- return _();
1540
- },
1541
- get style() {
1542
- return b();
1543
- },
1544
- onClick: ee,
1545
- onKeyDown: T,
1546
- onKeyUp: E,
1547
- onMouseDown: D
1548
- }, x, S, { get children() {
1549
- return n.children ?? "x";
1550
- } }));
1551
- }
1552
- });
1553
- }
1554
- //#endregion
1555
- //#region src/combobox/collection/ComboboxCollection.tsx
1556
- function en(e) {
1557
- let t = Y(), n = vt(), r = V(() => n?.items() ?? t.filteredItems());
1558
- return F(Ye, {
1559
- get each() {
1560
- return r();
1561
- },
1562
- get children() {
1563
- return e.children;
1564
- }
1565
- });
1566
- }
1567
- //#endregion
1568
- //#region src/combobox/list/ComboboxList.tsx
1569
- function tn(e) {
1570
- let t = Y(), n = Ut(!0), r = e, i = e, a = V(() => ({ empty: t.listEmpty() })), o = V(() => p(e.class, a())), s = V(() => m(e.style, a())), c = U(i, "as", "children", "class", "id", "onKeyDown", "ref", "style");
1571
- function l(e) {
1572
- if (t.disabled() || t.readOnly() || (t.store.keyboardActive = !0, e.key !== "Enter")) return;
1573
- let n = t.store.activeIndex();
1574
- n != null && (e.preventDefault(), e.stopPropagation(), t.clickHighlightedItem(n, e));
1575
- }
1576
- let u = v(() => r.onKeyDown, () => l), [d, f] = H(null, { ownedWrite: !0 });
1577
- B(d, (e) => {
1578
- if (!e) return;
1579
- let n = () => {
1580
- t.store.keyboardActive = !1;
1581
- }, r = () => {
1582
- t.store.keyboardActive = !0;
1583
- };
1584
- return e.addEventListener("pointermove", n, !0), e.addEventListener("keydown", r, !0), () => {
1585
- e.removeEventListener("pointermove", n, !0), e.removeEventListener("keydown", r, !0);
1586
- };
1587
- }), W(() => {
1588
- let e = G(d);
1589
- t.store.listElement() === e && t.store.setListElement(null), !n && t.store.state.positionerElement === e && t.store.setPositionerElement(null);
1590
- });
1591
- let h = V(() => {
1592
- let t = e.children;
1593
- return typeof t == "function" && !Me(t) ? F(en, { children: t }) : t;
1594
- });
1595
- return F(P, I({
1596
- get component() {
1597
- return e.as ?? "div";
1598
- },
1599
- ref: [((e) => {
1600
- f(e), t.store.setListElement(e), n || t.store.setPositionerElement(e);
1601
- }), r.ref],
1602
- get id() {
1603
- return r.id ?? t.store.context.floatingId;
1604
- },
1605
- get role() {
1606
- return t.grid() ? "grid" : "listbox";
1607
- },
1608
- tabindex: -1,
1609
- get "aria-multiselectable"() {
1610
- return t.multiple() ? "true" : void 0;
1611
- },
1612
- get class() {
1613
- return o();
1614
- },
1615
- get style() {
1616
- return s();
1617
- },
1618
- onKeyDown: u
1619
- }, c, { get children() {
1620
- return h();
1621
- } }));
1622
- }
1623
- //#endregion
1624
- //#region src/combobox/utils/createInitialLiveRegionTextMutation.ts
1625
- var nn = "⁠";
1626
- function rn(e) {
1627
- let t = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT), n = null;
1628
- for (; t.nextNode();) {
1629
- let e = t.currentNode;
1630
- e.nodeValue !== "" && (n = e);
1631
- }
1632
- return n;
1633
- }
1634
- function an() {
1635
- if (typeof navigator > "u") return !1;
1636
- let e = navigator.platform.toLowerCase();
1637
- return /^i(os$|p)/.test(e) || e === "macintel" && navigator.maxTouchPoints > 1;
1638
- }
1639
- function on(e) {
1640
- B(e, (e) => {
1641
- if (!e || an()) return;
1642
- let t = rn(e);
1643
- if (!t) return;
1644
- let n = t.data, r = `${n}${nn}`;
1645
- t.nodeValue = r;
1646
- let i = () => {
1647
- t.nodeValue === r && (t.nodeValue = n);
1648
- }, a = setTimeout(i, 200);
1649
- return () => {
1650
- clearTimeout(a), i();
1651
- };
1652
- });
1653
- }
1654
- //#endregion
1655
- //#region src/combobox/status/ComboboxStatus.tsx
1656
- function sn(e) {
1657
- let t = e, n = e, r = {}, i = V(() => p(e.class, r)), a = V(() => m(e.style, r)), o = U(n, "as", "class", "ref", "style"), [s, c] = H(null, { ownedWrite: !0 });
1658
- return on(s), F(P, I({
1659
- get component() {
1660
- return e.as ?? "div";
1661
- },
1662
- ref: [((e) => c(e)), t.ref],
1663
- role: "status",
1664
- "aria-live": "polite",
1665
- "aria-atomic": "true",
1666
- get class() {
1667
- return i();
1668
- },
1669
- get style() {
1670
- return a();
1671
- }
1672
- }, o));
1673
- }
1674
- //#endregion
1675
- //#region src/combobox/portal/ComboboxPortalContext.ts
1676
- var cn = Symbol("ComboboxPortalContext"), ln = Xe(cn);
1677
- function un() {
1678
- let e = $e(ln);
1679
- if (e === cn) throw Error("Base UI: <Combobox.Portal> is missing.");
1680
- return e;
1681
- }
1682
- //#endregion
1683
- //#region src/combobox/portal/ComboboxPortal.tsx
1684
- function dn(e) {
1685
- let t = Y(), n = e, r = e, i = V(() => n.keepMounted ?? !1), a = V(() => t.presence.mounted() || i() || t.store.forceMounted()), o = {}, s = V(() => p(e.class, o)), c = V(() => m(e.style, o)), l = U(r, "as", "class", "container", "keepMounted", "ref", "style");
1686
- return F(z, {
1687
- get when() {
1688
- return a();
1689
- },
1690
- get children() {
1691
- return F(ln, {
1692
- get value() {
1693
- return i();
1694
- },
1695
- get children() {
1696
- return F(j, I({
1697
- get as() {
1698
- return e.as;
1699
- },
1700
- get container() {
1701
- return n.container;
1702
- },
1703
- ref: (e) => Se(n.ref, e),
1704
- get class() {
1705
- return s();
1706
- },
1707
- get style() {
1708
- return c();
1709
- }
1710
- }, l, { get children() {
1711
- return e.children;
1712
- } }));
1713
- }
1714
- });
1715
- }
1716
- });
1717
- }
1718
- //#endregion
1719
- //#region src/combobox/backdrop/ComboboxBackdrop.tsx
1720
- function fn(t) {
1721
- let n = Y(), r = t, i = t, a = V(() => ({
1722
- open: n.store.open(),
1723
- transitionStatus: n.store.track().transitionStatus
1724
- })), o = V(() => p(t.class, a())), s = V(() => Ie({
1725
- "user-select": "none",
1726
- "-webkit-user-select": "none"
1727
- }, m(t.style, a()))), c = V(() => e(a(), Ft)), l = U(i, "as", "class", "ref", "style");
1728
- return F(P, I({
1729
- get component() {
1730
- return t.as ?? "div";
1731
- },
1732
- ref: [r.ref],
1733
- role: "presentation",
1734
- get hidden() {
1735
- return !n.presence.mounted();
1736
- },
1737
- get class() {
1738
- return o();
1739
- },
1740
- get style() {
1741
- return s();
1742
- }
1743
- }, c, l));
1744
- }
1745
- //#endregion
1746
- //#region src/combobox/positioner/ComboboxPositioner.tsx
1747
- var pn = {
1748
- side: "flip",
1749
- align: "flip",
1750
- fallbackAxisSide: "none"
1751
- };
1752
- function mn(t) {
1753
- let n = un(), r = Y(), i = Ce(), a = t, o = t, [s, c] = H(null, { ownedWrite: !0 }), l = V(() => hn(a.anchor) ?? (r.store.inputInsidePopup() ? r.triggerElement() : r.inputGroupElement() ?? r.inputElement()) ?? null), u = te({
1754
- reference: l,
1755
- floating: s,
1756
- mounted: () => r.presence.mounted() || n,
1757
- direction: i,
1758
- positionMethod: () => a.positionMethod ?? "absolute",
1759
- side: () => a.side ?? "bottom",
1760
- sideOffset: () => a.sideOffset ?? 0,
1761
- align: () => a.align ?? "center",
1762
- alignOffset: () => a.alignOffset ?? 0,
1763
- collisionBoundary: () => a.collisionBoundary ?? "clipping-ancestors",
1764
- collisionPadding: () => a.collisionPadding ?? 5,
1765
- arrowPadding: () => a.arrowPadding ?? 5,
1766
- sticky: () => a.sticky ?? !1,
1767
- disableAnchorTracking: () => a.disableAnchorTracking ?? !1,
1768
- collisionAvoidance: () => a.collisionAvoidance ?? pn
1769
- }), d = V(() => ({
1770
- open: r.store.open(),
1771
- side: u.renderedSide(),
1772
- align: u.renderedAlign(),
1773
- anchorHidden: u.anchorHidden(),
1774
- empty: r.listEmpty()
1775
- })), f = V(() => p(t.class, d())), h = V(() => Ie({
1776
- ...u.styles(),
1777
- "pointer-events": r.store.open() ? void 0 : "none",
1778
- transition: r.store.track().transitionStatus === "starting" ? "none" : void 0
1779
- }, m(t.style, d()))), g = V(() => e(d(), jt)), _ = U(o, "align", "alignOffset", "anchor", "arrowPadding", "as", "class", "collisionAvoidance", "collisionBoundary", "collisionPadding", "disableAnchorTracking", "positionMethod", "ref", "side", "sideOffset", "sticky", "style");
1780
- k({
1781
- enabled: () => r.store.open() && r.modal(),
1782
- touchOpen: () => r.store.openMethod() === "touch",
1783
- positioner: s,
1784
- reference: () => r.triggerElement() ?? r.inputElement()
1785
- }), B(u.renderedSide, (e) => r.store.setPopupSide(e)), W(() => {
1786
- r.store.state.positionerElement === G(s) && r.store.setPositionerElement(null);
1787
- });
1788
- let v = {
1789
- ...u,
1790
- side: u.renderedSide,
1791
- align: u.renderedAlign
1792
- };
1793
- function y() {
1794
- let e = null;
1795
- return W(() => {
1796
- r.internalBackdropElement() === e && r.setInternalBackdropElement(null);
1797
- }), F(ne, {
1798
- ref: (t) => {
1799
- e = t, r.setInternalBackdropElement(t);
1800
- },
1801
- get cutout() {
1802
- return r.inputGroupElement() ?? r.inputElement() ?? r.triggerElement();
1803
- },
1804
- get open() {
1805
- return r.store.open();
1806
- }
1807
- });
1808
- }
1809
- return F(Z, {
1810
- value: v,
1811
- get children() {
1812
- return [F(z, {
1813
- get when() {
1814
- return We(() => !!r.presence.mounted())() ? r.modal() : r.presence.mounted();
1815
- },
1816
- get children() {
1817
- return F(y, {});
1818
- }
1819
- }), F(P, I({
1820
- get component() {
1821
- return t.as ?? "div";
1822
- },
1823
- ref: [((e) => {
1824
- c(e), r.store.setPositionerElement(e);
1825
- }), a.ref],
1826
- role: "presentation",
1827
- get hidden() {
1828
- return !r.presence.mounted();
1829
- },
1830
- get inert() {
1831
- return !r.store.open() || void 0;
1832
- },
1833
- get class() {
1834
- return f();
1835
- },
1836
- get style() {
1837
- return h();
1838
- }
1839
- }, g, _))];
1840
- }
1841
- });
1842
- }
1843
- function hn(e) {
1844
- return typeof e == "function" ? e() : e && "current" in e ? e.current : e;
1845
- }
1846
- //#endregion
1847
- //#region src/combobox/popup/ComboboxPopup.tsx
1848
- function gn(t) {
1849
- let n = Y(), r = Ut(), i = t, a = t, o = V(() => i.id ?? (n.store.inputInsidePopup() ? kt(n.id()) : void 0)), s = V(() => ({
1850
- open: n.store.open(),
1851
- side: r.side(),
1852
- align: r.align(),
1853
- anchorHidden: r.anchorHidden(),
1854
- transitionStatus: n.store.track().transitionStatus,
1855
- empty: n.listEmpty(),
1856
- instant: n.store.track().instantType
1857
- })), c = V(() => p(t.class, s())), l = V(() => Ie({ transition: s().transitionStatus === "starting" ? "none" : void 0 }, m(t.style, s()))), u = V(() => e(s(), Mt)), d = U(a, "as", "class", "finalFocus", "id", "initialFocus", "onFocus", "ref", "style"), f = V(() => !n.store.inputInsidePopup() || n.modal()), h = V(() => i.initialFocus === void 0 ? n.store.inputInsidePopup() ? (e) => e === "touch" ? n.store.track().popupElement : n.inputElement() : !1 : i.initialFocus), g = V(() => i.finalFocus == null ? !!n.store.inputInsidePopup() : i.finalFocus);
1858
- function _(e) {
1859
- let t = e.target;
1860
- n.store.openMethod() !== "touch" && (C(n.store.listElement(), t) || t === e.currentTarget) && n.focusInput();
1861
- }
1862
- let v = null;
1863
- return B(o, (e) => (n.store.setPopupId(v?.id || e), () => n.store.setPopupId(void 0))), W(() => {
1864
- n.store.state.popupElement === v && n.store.setPopupElement(null);
1865
- }), F(ve, {
1866
- get context() {
1867
- return n.store.context.floatingRoot;
1868
- },
1869
- get tree() {
1870
- return n.tree;
1871
- },
1872
- get disabled() {
1873
- return !n.presence.mounted();
1874
- },
1875
- get modal() {
1876
- return f();
1877
- },
1878
- get openInteractionType() {
1879
- return n.store.openMethod();
1880
- },
1881
- get initialFocus() {
1882
- return h();
1883
- },
1884
- get returnFocus() {
1885
- return g();
1886
- },
1887
- get previousFocusableElement() {
1888
- return n.triggerElement;
1889
- },
1890
- referenceElement: () => n.store.inputInsidePopup() ? n.triggerElement() : n.inputElement(),
1891
- getInsideElements: () => [n.store.startDismissElement, n.store.endDismissElement],
1892
- get children() {
1893
- return [F(P, I({
1894
- get component() {
1895
- return t.as ?? "div";
1896
- },
1897
- ref: [((e) => {
1898
- v = e, n.store.setPopupElement(e);
1899
- }), i.ref],
1900
- get id() {
1901
- return o();
1902
- },
1903
- get role() {
1904
- return n.store.inputInsidePopup() ? "dialog" : "presentation";
1905
- },
1906
- "data-base-ui-focusable": "",
1907
- get "data-rootownerid"() {
1908
- return n.node.id;
1909
- },
1910
- get class() {
1911
- return c();
1912
- },
1913
- get style() {
1914
- return l();
1915
- },
1916
- get onFocus() {
1917
- return i.onFocus;
1918
- },
1919
- onFocusIn: _
1920
- }, u, d)), F(z, {
1921
- get when() {
1922
- return f();
1923
- },
1924
- get children() {
1925
- return F(Kt, { ref: (e) => {
1926
- G(() => {
1927
- n.store.endDismissElement = e;
1928
- });
1929
- } });
1930
- }
1931
- })];
1932
- }
1933
- });
1934
- }
1935
- //#endregion
1936
- //#region src/combobox/arrow/ComboboxArrow.tsx
1937
- function _n(t) {
1938
- let n = Y(), r = Ut(), i = t, a = t, o = V(() => ({
1939
- open: n.store.open(),
1940
- side: r.side(),
1941
- align: r.align(),
1942
- uncentered: r.arrowUncentered()
1943
- })), s = V(() => p(t.class, o())), c = V(() => Ie(r.arrowStyles(), m(t.style, o()))), l = V(() => e(o(), ge)), u = U(a, "as", "class", "ref", "style"), d = null;
1944
- return W(() => {
1945
- d && r.setArrowElement(null);
1946
- }), F(P, I({
1947
- get component() {
1948
- return t.as ?? "div";
1949
- },
1950
- ref: [((e) => {
1951
- d = e, r.setArrowElement(e);
1952
- }), i.ref],
1953
- "aria-hidden": "true",
1954
- get class() {
1955
- return s();
1956
- },
1957
- get style() {
1958
- return c();
1959
- }
1960
- }, l, u));
1961
- }
1962
- //#endregion
1963
- //#region src/combobox/group/ComboboxGroupContext.ts
1964
- var vn = Symbol("ComboboxGroupContext"), yn = Xe(vn);
1965
- function bn() {
1966
- let e = $e(yn);
1967
- if (e === vn) throw Error("Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.");
1968
- return e;
1969
- }
1970
- //#endregion
1971
- //#region src/combobox/group/ComboboxGroup.tsx
1972
- function xn(e) {
1973
- let t = e, n = e, [r, i] = H(void 0, { ownedWrite: !0 }), a = {}, o = V(() => p(e.class, a)), s = V(() => m(e.style, a)), c = U(n, "as", "class", "items", "ref", "style");
1974
- return F(_t, {
1975
- value: { items: () => t.items },
1976
- get children() {
1977
- return F(yn, {
1978
- value: {
1979
- labelId: r,
1980
- setLabelId: i
1981
- },
1982
- get children() {
1983
- return F(P, I({
1984
- get component() {
1985
- return e.as ?? "div";
1986
- },
1987
- ref: [t.ref],
1988
- role: "group",
1989
- get "aria-labelledby"() {
1990
- return r();
1991
- },
1992
- get class() {
1993
- return o();
1994
- },
1995
- get style() {
1996
- return s();
1997
- }
1998
- }, c));
1999
- }
2000
- });
2001
- }
2002
- });
2003
- }
2004
- //#endregion
2005
- //#region src/combobox/group-label/ComboboxGroupLabel.tsx
2006
- function Sn(e) {
2007
- let t = bn(), n = e, r = e, i = `base-ui-${Ze()}`, a = V(() => n.id ?? i), o = {}, s = V(() => p(e.class, o)), c = V(() => m(e.style, o)), l = U(r, "as", "class", "id", "ref", "style");
2008
- return B(a, (e) => (t.setLabelId(e), () => {
2009
- t.labelId() === e && t.setLabelId(void 0);
2010
- })), F(P, I({
2011
- get component() {
2012
- return e.as ?? "div";
2013
- },
2014
- ref: [n.ref],
2015
- get id() {
2016
- return a();
2017
- },
2018
- get class() {
2019
- return s();
2020
- },
2021
- get style() {
2022
- return c();
2023
- }
2024
- }, l));
2025
- }
2026
- //#endregion
2027
- //#region src/combobox/row/ComboboxRowContext.ts
2028
- var Cn = Xe(!1);
2029
- function wn() {
2030
- return $e(Cn);
2031
- }
2032
- //#endregion
2033
- //#region src/combobox/item/ComboboxItemContext.ts
2034
- var Tn = Symbol("ComboboxItemContext"), En = Xe(Tn);
2035
- function Dn() {
2036
- let e = $e(En);
2037
- if (e === Tn) throw Error("Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.");
2038
- return e;
2039
- }
2040
- //#endregion
2041
- //#region src/combobox/item/ComboboxItem.tsx
2042
- function On(t) {
2043
- let n = Y(), r = wn(), i = t, a = t, o = Symbol("ComboboxItem"), [s, c] = H(null, { ownedWrite: !0 }), l = V(() => i.value ?? null), u = V(() => n.disabled() || (i.disabled ?? !1)), d = V(() => i.nativeButton ?? !1), f = V(() => n.selectionMode() !== "none"), h = V(() => {
2044
- if (i.index != null) return i.index;
2045
- if (!n.virtualized()) return;
2046
- let e = Ne(n.flatFilteredItems(), l(), n.comparator());
2047
- return e === -1 ? void 0 : e;
2048
- }), g = n.store.collection.register({
2049
- token: o,
2050
- element: s,
2051
- value: l,
2052
- index: h,
2053
- disabled: u
2054
- }), _ = V(() => h() ?? n.store.collection.indexOf(o)), y = V(() => _() !== -1), b = V(() => y() ? `${n.id()}-${_()}` : void 0), x = V(() => {
2055
- if (!f()) return !1;
2056
- let e = n.selectedValue();
2057
- return Array.isArray(e) ? je(e, l(), n.comparator()) : Ae(l(), e, n.comparator());
2058
- }), S = V(() => n.store.activeIndex() === _()), C = V(() => ({
2059
- disabled: u(),
2060
- selected: x(),
2061
- highlighted: S()
2062
- })), w = V(() => p(t.class, C())), ee = V(() => m(t.style, C())), T = V(() => e(C())), E = U(a, "as", "class", "disabled", "id", "index", "nativeButton", "onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerLeave", "onPointerMove", "ref", "style", "value");
2063
- function D(e) {
2064
- if (n.submitOnItemClick()) {
2065
- n.handleSelection(e, l()), Qe(), n.requestSubmit();
2066
- return;
2067
- }
2068
- n.handleSelection(e, l());
2069
- }
2070
- function O(e) {
2071
- e.isPrimary && (n.store.pointerDownItem = e.currentTarget), e.preventDefault();
2072
- }
2073
- function te(e) {
2074
- e.preventDefault();
2075
- }
2076
- function ne(e) {
2077
- u() || n.readOnly() || D(e);
2078
- }
2079
- function k(e) {
2080
- let t = n.store.pointerDownItem === e.currentTarget;
2081
- n.store.pointerDownItem = null, !(u() || n.readOnly() || e.button !== 0 || t || !S()) && D(e);
2082
- }
2083
- function re(e) {
2084
- e.pointerType !== "touch" && (n.store.keyboardActive = !1, !u() && n.listNavigation.onItemPointerMove(e, _()));
2085
- }
2086
- function ie(e) {
2087
- n.keepHighlight() || n.listNavigation.onItemPointerLeave(e);
2088
- }
2089
- let ae = v(() => G(() => u() ? xe : void 0), () => i.onClick, () => ne), oe = v(() => i.onMouseDown, () => te), se = v(() => i.onMouseUp, () => k), ce = v(() => i.onPointerDown, () => O), le = v(() => i.onPointerMove, () => re), ue = v(() => i.onPointerLeave, () => ie);
2090
- return B(() => ({
2091
- registered: y(),
2092
- hasItems: n.hasItems(),
2093
- index: _(),
2094
- value: l(),
2095
- selected: n.selectedValue(),
2096
- compare: n.comparator()
2097
- }), (e) => {
2098
- if (!e.registered || e.hasItems) return;
2099
- let t = Array.isArray(e.selected) ? e.selected[e.selected.length - 1] : e.selected;
2100
- Ae(e.value, t, e.compare) && G(() => n.store.setSelectedIndex(e.index));
2101
- }), B(s, () => n.store.collection.touch()), W(g), F(En, {
2102
- value: {
2103
- selected: x,
2104
- index: _
2105
- },
2106
- get children() {
2107
- return F(P, I({
2108
- get component() {
2109
- return t.as ?? "div";
2110
- },
2111
- ref: [((e) => {
2112
- c(e), n.store.collection.touch();
2113
- }), i.ref],
2114
- get id() {
2115
- return b();
2116
- },
2117
- get type() {
2118
- return d() ? "button" : void 0;
2119
- },
2120
- role: r ? "gridcell" : "option",
2121
- get "aria-selected"() {
2122
- return We(() => !!f())() ? x() ? "true" : "false" : void 0;
2123
- },
2124
- get "aria-disabled"() {
2125
- return u() ? "true" : void 0;
2126
- },
2127
- get class() {
2128
- return w();
2129
- },
2130
- get style() {
2131
- return ee();
2132
- },
2133
- onClick: ae,
2134
- onMouseDown: oe,
2135
- onMouseUp: se,
2136
- onPointerDown: ce,
2137
- onPointerLeave: ue,
2138
- onPointerMove: le
2139
- }, T, E));
2140
- }
2141
- });
2142
- }
2143
- //#endregion
2144
- //#region src/combobox/row/ComboboxRow.tsx
2145
- function kn(e) {
2146
- let t = e, n = e, r = {}, i = V(() => p(e.class, r)), a = V(() => m(e.style, r)), o = U(n, "as", "class", "ref", "style");
2147
- return F(Cn, {
2148
- value: !0,
2149
- get children() {
2150
- return F(P, I({
2151
- get component() {
2152
- return e.as ?? "div";
2153
- },
2154
- ref: [t.ref],
2155
- role: "row",
2156
- get class() {
2157
- return i();
2158
- },
2159
- get style() {
2160
- return a();
2161
- }
2162
- }, o));
2163
- }
2164
- });
2165
- }
2166
- //#endregion
2167
- //#region src/combobox/empty/ComboboxEmpty.tsx
2168
- function An(e) {
2169
- let t = Y(), n = e, r = e, i = {}, a = V(() => p(e.class, i)), o = V(() => m(e.style, i)), s = U(r, "as", "children", "class", "ref", "style"), [c, l] = H(null, { ownedWrite: !0 });
2170
- return on(c), W(() => {
2171
- t.store.emptyElement === c() && (t.store.emptyElement = null);
2172
- }), F(P, I({
2173
- get component() {
2174
- return e.as ?? "div";
2175
- },
2176
- ref: [((e) => {
2177
- l(e), t.store.emptyElement = e;
2178
- }), n.ref],
2179
- role: "status",
2180
- "aria-live": "polite",
2181
- "aria-atomic": "true",
2182
- get class() {
2183
- return a();
2184
- },
2185
- get style() {
2186
- return o();
2187
- }
2188
- }, s, { get children() {
2189
- return F(z, {
2190
- get when() {
2191
- return t.listEmpty();
2192
- },
2193
- get children() {
2194
- return e.children;
2195
- }
2196
- });
2197
- } }));
2198
- }
2199
- //#endregion
2200
- //#region src/combobox/separator/ComboboxSeparator.tsx
2201
- function jn(t) {
2202
- let n = t, r = t, i = V(() => n.orientation ?? "horizontal"), a = V(() => ({ orientation: i() })), o = V(() => p(t.class, a())), s = V(() => m(t.style, a())), c = V(() => e(a())), l = U(r, "as", "class", "orientation", "ref", "style");
2203
- return F(P, I({
2204
- get component() {
2205
- return t.as ?? "div";
2206
- },
2207
- ref: [n.ref],
2208
- role: "presentation",
2209
- get class() {
2210
- return o();
2211
- },
2212
- get style() {
2213
- return s();
2214
- }
2215
- }, c, l));
2216
- }
2217
- //#endregion
2218
- //#region src/combobox/root/utils/useFilteredItems.ts
2219
- function Mn() {
2220
- return Y().filteredItems;
2221
- }
2222
- //#endregion
2223
- export { ut as A, Jt as C, Lt as D, Vt as E, ct as M, st as N, Tt as O, K as P, qt as S, X as T, $ as _, On as a, Zt as b, xn as c, mn as d, fn as f, en as g, tn as h, kn as i, at as j, Y as k, _n as l, sn as m, jn as n, Dn as o, dn as p, An as r, Sn as s, Mn as t, gn as u, $t as v, Rt as w, Yt as x, Qt as y };