@mintlify/components 1.0.3 → 1.0.5

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 (118) hide show
  1. package/dist/components/callout/callout.js +4 -4
  2. package/dist/components/icon/icon.d.ts.map +1 -1
  3. package/dist/components/icon/icon.js +14 -14
  4. package/dist/components/index.d.ts +1 -0
  5. package/dist/components/index.d.ts.map +1 -1
  6. package/dist/components/search/button.d.ts +12 -0
  7. package/dist/components/search/button.d.ts.map +1 -0
  8. package/dist/components/search/button.js +55 -0
  9. package/dist/components/search/index.d.ts +7 -0
  10. package/dist/components/search/index.d.ts.map +1 -0
  11. package/dist/components/search/provider.d.ts +19 -0
  12. package/dist/components/search/provider.d.ts.map +1 -0
  13. package/dist/components/search/provider.js +32 -0
  14. package/dist/components/search/search.d.ts +39 -0
  15. package/dist/components/search/search.d.ts.map +1 -0
  16. package/dist/components/search/search.js +263 -0
  17. package/dist/index.js +55 -48
  18. package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -1
  19. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +165 -164
  20. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +21 -20
  21. package/dist/node_modules/.pnpm/@floating-ui_react@0.26.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@floating-ui/react/dist/floating-ui.react.js +367 -0
  22. package/dist/node_modules/.pnpm/@floating-ui_react@0.26.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +13 -0
  23. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/combobox/combobox.js +397 -0
  24. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/description/description.js +43 -0
  25. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/dialog/dialog.js +100 -0
  26. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/focus-trap/focus-trap.js +129 -0
  27. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
  28. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/label/label.js +59 -0
  29. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/mouse.js +4 -0
  30. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/portal/portal.js +71 -0
  31. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/transition/transition.js +135 -0
  32. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js +14 -0
  33. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js +48 -0
  34. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js +36 -0
  35. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js +8 -0
  36. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js +12 -0
  37. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
  38. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-by-comparator.js +16 -0
  39. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-controllable.js +9 -0
  40. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
  41. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
  42. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-document-event.js +15 -0
  43. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-element-size.js +20 -0
  44. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-escape.js +12 -0
  45. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-event-listener.js +15 -0
  46. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
  47. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-flags.js +8 -0
  48. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-inert-others.js +41 -0
  49. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-is-mounted.js +11 -0
  50. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-is-top-layer.js +24 -0
  51. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-is-touch-device.js +16 -0
  52. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
  53. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
  54. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-on-disappear.js +27 -0
  55. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-on-unmount.js +14 -0
  56. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-outside-click.js +39 -0
  57. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-owner.js +8 -0
  58. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-refocusable-input.js +22 -0
  59. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
  60. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-root-containers.js +38 -0
  61. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js +12 -0
  62. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js +16 -0
  63. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-store.js +7 -0
  64. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +20 -0
  65. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-tab-direction.js +13 -0
  66. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-tracked-pointer.js +16 -0
  67. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-transition.js +69 -0
  68. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js +18 -0
  69. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-watch.js +15 -0
  70. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/hooks/use-window-event.js +15 -0
  71. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/close-provider.js +9 -0
  72. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
  73. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/floating.js +149 -0
  74. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
  75. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/frozen.js +13 -0
  76. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
  77. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/id.js +8 -0
  78. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/open-closed.js +19 -0
  79. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/internal/portal-force-root.js +12 -0
  80. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/active-element-history.js +14 -0
  81. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/bugs.js +18 -0
  82. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/calculate-active-index.js +40 -0
  83. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
  84. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/default-map.js +12 -0
  85. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
  86. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/document-ready.js +9 -0
  87. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/env.js +34 -0
  88. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/focus-management.js +84 -0
  89. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/form.js +14 -0
  90. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/match.js +11 -0
  91. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
  92. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/owner.js +7 -0
  93. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/platform.js +14 -0
  94. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/render.js +118 -0
  95. package/dist/node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/utils/store.js +14 -0
  96. package/dist/node_modules/.pnpm/@react-aria_focus@3.21.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
  97. package/dist/node_modules/.pnpm/@react-aria_interactions@3.27.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/interactions/dist/useFocus.js +30 -0
  98. package/dist/node_modules/.pnpm/@react-aria_interactions@3.27.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/interactions/dist/useFocusVisible.js +97 -0
  99. package/dist/node_modules/.pnpm/@react-aria_interactions@3.27.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/interactions/dist/useFocusWithin.js +57 -0
  100. package/dist/node_modules/.pnpm/@react-aria_interactions@3.27.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
  101. package/dist/node_modules/.pnpm/@react-aria_interactions@3.27.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/interactions/dist/utils.js +66 -0
  102. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/DOMFunctions.js +27 -0
  103. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
  104. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
  105. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
  106. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/openLink.js +28 -0
  107. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/platform.js +47 -0
  108. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
  109. package/dist/node_modules/.pnpm/@react-aria_utils@3.33.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
  110. package/dist/node_modules/.pnpm/@react-stately_flags@3.1.2/node_modules/@react-stately/flags/dist/import.js +7 -0
  111. package/dist/node_modules/.pnpm/@tanstack_react-virtual@3.13.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
  112. package/dist/node_modules/.pnpm/@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/index.js +533 -0
  113. package/dist/node_modules/.pnpm/@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  114. package/dist/node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/loader-circle.js +13 -0
  115. package/dist/node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search-x.js +16 -0
  116. package/dist/node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js +14 -0
  117. package/dist/styles.css +1 -1
  118. package/package.json +2 -1
@@ -0,0 +1,397 @@
1
+ import { useFocusRing as $e } from "../../../../../../../@react-aria_focus@3.21.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/focus/dist/useFocusRing.js";
2
+ import { useHover as Pe } from "../../../../../../../@react-aria_interactions@3.27.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@react-aria/interactions/dist/useHover.js";
3
+ import { useVirtualizer as Ne } from "../../../../../../../@tanstack_react-virtual@3.13.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-virtual/dist/esm/index.js";
4
+ import A, { useId as pe, useState as De, useCallback as be, useMemo as j, createContext as fe, useRef as te, useContext as ve, useReducer as Ke, createRef as Ue, Fragment as we } from "react";
5
+ import { flushSync as Z } from "react-dom";
6
+ import { useActivePress as ze } from "../../hooks/use-active-press.js";
7
+ import { useByComparator as He } from "../../hooks/use-by-comparator.js";
8
+ import { useControllable as Ge } from "../../hooks/use-controllable.js";
9
+ import { useDefaultValue as je } from "../../hooks/use-default-value.js";
10
+ import { useDisposables as qe } from "../../hooks/use-disposables.js";
11
+ import { useElementSize as Ie } from "../../hooks/use-element-size.js";
12
+ import { useEvent as v } from "../../hooks/use-event.js";
13
+ import { useInertOthers as Je } from "../../hooks/use-inert-others.js";
14
+ import { useIsoMorphicEffect as Q } from "../../hooks/use-iso-morphic-effect.js";
15
+ import { useLatestValue as Qe } from "../../hooks/use-latest-value.js";
16
+ import { useOnDisappear as We } from "../../hooks/use-on-disappear.js";
17
+ import { useOutsideClick as Xe } from "../../hooks/use-outside-click.js";
18
+ import { useOwnerDocument as Fe } from "../../hooks/use-owner.js";
19
+ import { useRefocusableInput as _e } from "../../hooks/use-refocusable-input.js";
20
+ import { useResolveButtonType as Ye } from "../../hooks/use-resolve-button-type.js";
21
+ import { useScrollLock as Ze } from "../../hooks/use-scroll-lock.js";
22
+ import { useSyncRefs as ce } from "../../hooks/use-sync-refs.js";
23
+ import { useTrackedPointer as et } from "../../hooks/use-tracked-pointer.js";
24
+ import { useTransition as tt, transitionDataAttributes as ot } from "../../hooks/use-transition.js";
25
+ import { useTreeWalker as nt } from "../../hooks/use-tree-walker.js";
26
+ import { useWatch as Se } from "../../hooks/use-watch.js";
27
+ import { useDisabled as it } from "../../internal/disabled.js";
28
+ import { useResolvedAnchor as rt, useFloatingPanel as at, useFloatingPanelProps as lt, FloatingProvider as st, useFloatingReference as ut } from "../../internal/floating.js";
29
+ import { FormFields as dt } from "../../internal/form-fields.js";
30
+ import { useFrozenData as ye, Frozen as pt } from "../../internal/frozen.js";
31
+ import { useProvidedId as ct } from "../../internal/id.js";
32
+ import { useOpenClosed as mt, State as de, OpenClosedProvider as bt } from "../../internal/open-closed.js";
33
+ import { history as Ce } from "../../utils/active-element-history.js";
34
+ import { isDisabledReactIssue7711 as ft } from "../../utils/bugs.js";
35
+ import { Focus as R, calculateActiveIndex as Te } from "../../utils/calculate-active-index.js";
36
+ import { disposables as he } from "../../utils/disposables.js";
37
+ import { sortByDomNode as vt } from "../../utils/focus-management.js";
38
+ import { match as ee } from "../../utils/match.js";
39
+ import { isMobile as xt } from "../../utils/platform.js";
40
+ import { forwardRefWithAs as ae, mergeProps as xe, useRender as le, RenderFeatures as Re } from "../../utils/render.js";
41
+ import { useDescribedBy as gt } from "../description/description.js";
42
+ import { Keys as M } from "../keyboard.js";
43
+ import { Label as Ot, useLabelledBy as ge, useLabels as Et } from "../label/label.js";
44
+ import { MouseButton as Ae } from "../mouse.js";
45
+ import { Portal as It } from "../portal/portal.js";
46
+ var St = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(St || {}), yt = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(yt || {}), Ct = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(Ct || {}), Tt = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e[e.SetInputElement = 8] = "SetInputElement", e[e.SetButtonElement = 9] = "SetButtonElement", e[e.SetOptionsElement = 10] = "SetOptionsElement", e))(Tt || {});
47
+ function me(e, o = (a) => a) {
48
+ let a = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, r = o(e.options.slice()), u = r.length > 0 && r[0].dataRef.current.order !== null ? r.sort((i, t) => i.dataRef.current.order - t.dataRef.current.order) : vt(r, (i) => i.dataRef.current.domRef.current), b = a ? u.indexOf(a) : null;
49
+ return b === -1 && (b = null), { options: u, activeOptionIndex: b };
50
+ }
51
+ let ht = { 1(e) {
52
+ var o;
53
+ return (o = e.dataRef.current) != null && o.disabled || e.comboboxState === 1 ? e : { ...e, activeOptionIndex: null, comboboxState: 1, isTyping: !1, activationTrigger: 2, __demoMode: !1 };
54
+ }, 0(e) {
55
+ var o, a;
56
+ if ((o = e.dataRef.current) != null && o.disabled || e.comboboxState === 0) return e;
57
+ if ((a = e.dataRef.current) != null && a.value) {
58
+ let r = e.dataRef.current.calculateIndex(e.dataRef.current.value);
59
+ if (r !== -1) return { ...e, activeOptionIndex: r, comboboxState: 0, __demoMode: !1 };
60
+ }
61
+ return { ...e, comboboxState: 0, __demoMode: !1 };
62
+ }, 3(e, o) {
63
+ return e.isTyping === o.isTyping ? e : { ...e, isTyping: o.isTyping };
64
+ }, 2(e, o) {
65
+ var a, r, u, b;
66
+ if ((a = e.dataRef.current) != null && a.disabled || e.optionsElement && !((r = e.dataRef.current) != null && r.optionsPropsRef.current.static) && e.comboboxState === 1) return e;
67
+ if (e.virtual) {
68
+ let { options: d, disabled: x } = e.virtual, g = o.focus === R.Specific ? o.idx : Te(o, { resolveItems: () => d, resolveActiveIndex: () => {
69
+ var n, y;
70
+ return (y = (n = e.activeOptionIndex) != null ? n : d.findIndex((O) => !x(O))) != null ? y : null;
71
+ }, resolveDisabled: x, resolveId() {
72
+ throw new Error("Function not implemented.");
73
+ } }), I = (u = o.trigger) != null ? u : 2;
74
+ return e.activeOptionIndex === g && e.activationTrigger === I ? e : { ...e, activeOptionIndex: g, activationTrigger: I, isTyping: !1, __demoMode: !1 };
75
+ }
76
+ let i = me(e);
77
+ if (i.activeOptionIndex === null) {
78
+ let d = i.options.findIndex((x) => !x.dataRef.current.disabled);
79
+ d !== -1 && (i.activeOptionIndex = d);
80
+ }
81
+ let t = o.focus === R.Specific ? o.idx : Te(o, { resolveItems: () => i.options, resolveActiveIndex: () => i.activeOptionIndex, resolveId: (d) => d.id, resolveDisabled: (d) => d.dataRef.current.disabled }), l = (b = o.trigger) != null ? b : 2;
82
+ return e.activeOptionIndex === t && e.activationTrigger === l ? e : { ...e, ...i, isTyping: !1, activeOptionIndex: t, activationTrigger: l, __demoMode: !1 };
83
+ }, 4: (e, o) => {
84
+ var a, r, u;
85
+ if ((a = e.dataRef.current) != null && a.virtual) return { ...e, options: [...e.options, o.payload] };
86
+ let b = o.payload, i = me(e, (l) => (l.push(b), l));
87
+ e.activeOptionIndex === null && (r = e.dataRef.current) != null && r.isSelected(o.payload.dataRef.current.value) && (i.activeOptionIndex = i.options.indexOf(b));
88
+ let t = { ...e, ...i, activationTrigger: 2 };
89
+ return (u = e.dataRef.current) != null && u.__demoMode && e.dataRef.current.value === void 0 && (t.activeOptionIndex = 0), t;
90
+ }, 5: (e, o) => {
91
+ var a;
92
+ if ((a = e.dataRef.current) != null && a.virtual) return { ...e, options: e.options.filter((u) => u.id !== o.id) };
93
+ let r = me(e, (u) => {
94
+ let b = u.findIndex((i) => i.id === o.id);
95
+ return b !== -1 && u.splice(b, 1), u;
96
+ });
97
+ return { ...e, ...r, activationTrigger: 2 };
98
+ }, 6: (e, o) => e.activationTrigger === o.trigger ? e : { ...e, activationTrigger: o.trigger }, 7: (e, o) => {
99
+ var a, r;
100
+ if (e.virtual === null) return { ...e, virtual: { options: o.options, disabled: (a = o.disabled) != null ? a : () => !1 } };
101
+ if (e.virtual.options === o.options && e.virtual.disabled === o.disabled) return e;
102
+ let u = e.activeOptionIndex;
103
+ if (e.activeOptionIndex !== null) {
104
+ let b = o.options.indexOf(e.virtual.options[e.activeOptionIndex]);
105
+ b !== -1 ? u = b : u = null;
106
+ }
107
+ return { ...e, activeOptionIndex: u, virtual: { options: o.options, disabled: (r = o.disabled) != null ? r : () => !1 } };
108
+ }, 8: (e, o) => e.inputElement === o.element ? e : { ...e, inputElement: o.element }, 9: (e, o) => e.buttonElement === o.element ? e : { ...e, buttonElement: o.element }, 10: (e, o) => e.optionsElement === o.element ? e : { ...e, optionsElement: o.element } }, Oe = fe(null);
109
+ Oe.displayName = "ComboboxActionsContext";
110
+ function se(e) {
111
+ let o = ve(Oe);
112
+ if (o === null) {
113
+ let a = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
114
+ throw Error.captureStackTrace && Error.captureStackTrace(a, se), a;
115
+ }
116
+ return o;
117
+ }
118
+ let Me = fe(null);
119
+ function Rt(e) {
120
+ let o = oe("VirtualProvider"), { options: a } = o.virtual, [r, u] = j(() => {
121
+ let d = o.optionsElement;
122
+ if (!d) return [0, 0];
123
+ let x = window.getComputedStyle(d);
124
+ return [parseFloat(x.paddingBlockStart || x.paddingTop), parseFloat(x.paddingBlockEnd || x.paddingBottom)];
125
+ }, [o.optionsElement]), b = Ne({ enabled: a.length !== 0, scrollPaddingStart: r, scrollPaddingEnd: u, count: a.length, estimateSize() {
126
+ return 40;
127
+ }, getScrollElement() {
128
+ return o.optionsElement;
129
+ }, overscan: 12 }), [i, t] = De(0);
130
+ Q(() => {
131
+ t((d) => d + 1);
132
+ }, [a]);
133
+ let l = b.getVirtualItems();
134
+ return l.length === 0 ? null : A.createElement(Me.Provider, { value: b }, A.createElement("div", { style: { position: "relative", width: "100%", height: `${b.getTotalSize()}px` }, ref: (d) => {
135
+ d && o.activationTrigger !== 0 && o.activeOptionIndex !== null && a.length > o.activeOptionIndex && b.scrollToIndex(o.activeOptionIndex);
136
+ } }, l.map((d) => {
137
+ var x;
138
+ return A.createElement(we, { key: d.key }, A.cloneElement((x = e.children) == null ? void 0 : x.call(e, { ...e.slot, option: a[d.index] }), { key: `${i}-${d.key}`, "data-index": d.index, "aria-setsize": a.length, "aria-posinset": d.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${d.start}px)`, overflowAnchor: "none" } }));
139
+ })));
140
+ }
141
+ let re = fe(null);
142
+ re.displayName = "ComboboxDataContext";
143
+ function oe(e) {
144
+ let o = ve(re);
145
+ if (o === null) {
146
+ let a = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
147
+ throw Error.captureStackTrace && Error.captureStackTrace(a, oe), a;
148
+ }
149
+ return o;
150
+ }
151
+ function $t(e, o) {
152
+ return ee(o.type, ht, e, o);
153
+ }
154
+ let Pt = we;
155
+ function Dt(e, o) {
156
+ var a, r;
157
+ let u = it(), { value: b, defaultValue: i, onChange: t, form: l, name: d, by: x, disabled: g = u || !1, onClose: I, __demoMode: n = !1, multiple: y = !1, immediate: O = !1, virtual: f = null, nullable: B, ...L } = e, P = je(i), [T = y ? [] : void 0, D] = Ge(b, t, P), [S, m] = Ke($t, { dataRef: Ue(), comboboxState: n ? 0 : 1, isTyping: !1, options: [], virtual: f ? { options: f.options, disabled: (a = f.disabled) != null ? a : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: n }), w = te(!1), z = te({ static: !1, hold: !1 }), k = He(x), H = v((p) => f ? x === null ? f.options.indexOf(p) : f.options.findIndex((E) => k(E, p)) : S.options.findIndex((E) => k(E.dataRef.current.value, p))), q = be((p) => ee(c.mode, { 1: () => T.some((E) => k(E, p)), 0: () => k(T, p) }), [T]), G = v((p) => S.activeOptionIndex === H(p)), c = j(() => ({ ...S, immediate: O, optionsPropsRef: z, value: T, defaultValue: P, disabled: g, mode: y ? 1 : 0, virtual: f ? S.virtual : null, get activeOptionIndex() {
158
+ if (w.current && S.activeOptionIndex === null && (f ? f.options.length > 0 : S.options.length > 0)) {
159
+ if (f) {
160
+ let E = f.options.findIndex((U) => {
161
+ var ue, Ee;
162
+ return !((Ee = (ue = f.disabled) == null ? void 0 : ue.call(f, U)) != null && Ee);
163
+ });
164
+ if (E !== -1) return E;
165
+ }
166
+ let p = S.options.findIndex((E) => !E.dataRef.current.disabled);
167
+ if (p !== -1) return p;
168
+ }
169
+ return S.activeOptionIndex;
170
+ }, calculateIndex: H, compare: k, isSelected: q, isActive: G }), [T, P, g, y, n, S, f]);
171
+ Q(() => {
172
+ var p;
173
+ f && m({ type: 7, options: f.options, disabled: (p = f.disabled) != null ? p : null });
174
+ }, [f, f == null ? void 0 : f.options, f == null ? void 0 : f.disabled]), Q(() => {
175
+ S.dataRef.current = c;
176
+ }, [c]);
177
+ let C = c.comboboxState === 0;
178
+ Xe(C, [c.buttonElement, c.inputElement, c.optionsElement], () => _.closeCombobox());
179
+ let K = j(() => {
180
+ var p, E, U;
181
+ return { open: c.comboboxState === 0, disabled: g, activeIndex: c.activeOptionIndex, activeOption: c.activeOptionIndex === null ? null : c.virtual ? c.virtual.options[(p = c.activeOptionIndex) != null ? p : 0] : (U = (E = c.options[c.activeOptionIndex]) == null ? void 0 : E.dataRef.current.value) != null ? U : null, value: T };
182
+ }, [c, g, T]), J = v(() => {
183
+ if (c.activeOptionIndex !== null) {
184
+ if (_.setIsTyping(!1), c.virtual) s(c.virtual.options[c.activeOptionIndex]);
185
+ else {
186
+ let { dataRef: p } = c.options[c.activeOptionIndex];
187
+ s(p.current.value);
188
+ }
189
+ _.goToOption(R.Specific, c.activeOptionIndex);
190
+ }
191
+ }), W = v(() => {
192
+ m({ type: 0 }), w.current = !0;
193
+ }), Y = v(() => {
194
+ m({ type: 1 }), w.current = !1, I == null || I();
195
+ }), ne = v((p) => {
196
+ m({ type: 3, isTyping: p });
197
+ }), ie = v((p, E, U) => (w.current = !1, p === R.Specific ? m({ type: 2, focus: R.Specific, idx: E, trigger: U }) : m({ type: 2, focus: p, trigger: U }))), F = v((p, E) => (m({ type: 4, payload: { id: p, dataRef: E } }), () => {
198
+ c.isActive(E.current.value) && (w.current = !0), m({ type: 5, id: p });
199
+ })), s = v((p) => ee(c.mode, { 0() {
200
+ return D == null ? void 0 : D(p);
201
+ }, 1() {
202
+ let E = c.value.slice(), U = E.findIndex((ue) => k(ue, p));
203
+ return U === -1 ? E.push(p) : E.splice(U, 1), D == null ? void 0 : D(E);
204
+ } })), V = v((p) => {
205
+ m({ type: 6, trigger: p });
206
+ }), $ = v((p) => {
207
+ m({ type: 8, element: p });
208
+ }), N = v((p) => {
209
+ m({ type: 9, element: p });
210
+ }), h = v((p) => {
211
+ m({ type: 10, element: p });
212
+ }), _ = j(() => ({ onChange: s, registerOption: F, goToOption: ie, setIsTyping: ne, closeCombobox: Y, openCombobox: W, setActivationTrigger: V, selectActiveOption: J, setInputElement: $, setButtonElement: N, setOptionsElement: h }), []), [X, ke] = Et(), Be = o === null ? {} : { ref: o }, Le = be(() => {
213
+ if (P !== void 0) return D == null ? void 0 : D(P);
214
+ }, [D, P]), Ve = le();
215
+ return A.createElement(ke, { value: X, props: { htmlFor: (r = c.inputElement) == null ? void 0 : r.id }, slot: { open: c.comboboxState === 0, disabled: g } }, A.createElement(st, null, A.createElement(Oe.Provider, { value: _ }, A.createElement(re.Provider, { value: c }, A.createElement(bt, { value: ee(c.comboboxState, { 0: de.Open, 1: de.Closed }) }, d != null && A.createElement(dt, { disabled: g, data: T != null ? { [d]: T } : {}, form: l, onReset: Le }), Ve({ ourProps: Be, theirProps: L, slot: K, defaultTag: Pt, name: "Combobox" }))))));
216
+ }
217
+ let wt = "input";
218
+ function Ft(e, o) {
219
+ var a, r, u, b, i;
220
+ let t = oe("Combobox.Input"), l = se("Combobox.Input"), d = pe(), x = ct(), { id: g = x || `headlessui-combobox-input-${d}`, onChange: I, displayValue: n, disabled: y = t.disabled || !1, autoFocus: O = !1, type: f = "text", ...B } = e, L = te(null), P = ce(L, o, ut(), l.setInputElement), T = Fe(t.inputElement), D = qe(), S = v(() => {
221
+ l.onChange(null), t.optionsElement && (t.optionsElement.scrollTop = 0), l.goToOption(R.Nothing);
222
+ }), m = j(() => {
223
+ var s;
224
+ return typeof n == "function" && t.value !== void 0 ? (s = n(t.value)) != null ? s : "" : typeof t.value == "string" ? t.value : "";
225
+ }, [t.value, n]);
226
+ Se(([s, V], [$, N]) => {
227
+ if (t.isTyping) return;
228
+ let h = L.current;
229
+ h && ((N === 0 && V === 1 || s !== $) && (h.value = s), requestAnimationFrame(() => {
230
+ if (t.isTyping || !h || (T == null ? void 0 : T.activeElement) !== h) return;
231
+ let { selectionStart: _, selectionEnd: X } = h;
232
+ Math.abs((X ?? 0) - (_ ?? 0)) === 0 && _ === 0 && h.setSelectionRange(h.value.length, h.value.length);
233
+ }));
234
+ }, [m, t.comboboxState, T, t.isTyping]), Se(([s], [V]) => {
235
+ if (s === 0 && V === 1) {
236
+ if (t.isTyping) return;
237
+ let $ = L.current;
238
+ if (!$) return;
239
+ let N = $.value, { selectionStart: h, selectionEnd: _, selectionDirection: X } = $;
240
+ $.value = "", $.value = N, X !== null ? $.setSelectionRange(h, _, X) : $.setSelectionRange(h, _);
241
+ }
242
+ }, [t.comboboxState]);
243
+ let w = te(!1), z = v(() => {
244
+ w.current = !0;
245
+ }), k = v(() => {
246
+ D.nextFrame(() => {
247
+ w.current = !1;
248
+ });
249
+ }), H = v((s) => {
250
+ switch (l.setIsTyping(!0), s.key) {
251
+ case M.Enter:
252
+ if (t.comboboxState !== 0 || w.current) return;
253
+ if (s.preventDefault(), s.stopPropagation(), t.activeOptionIndex === null) {
254
+ l.closeCombobox();
255
+ return;
256
+ }
257
+ l.selectActiveOption(), t.mode === 0 && l.closeCombobox();
258
+ break;
259
+ case M.ArrowDown:
260
+ return s.preventDefault(), s.stopPropagation(), ee(t.comboboxState, { 0: () => l.goToOption(R.Next), 1: () => l.openCombobox() });
261
+ case M.ArrowUp:
262
+ return s.preventDefault(), s.stopPropagation(), ee(t.comboboxState, { 0: () => l.goToOption(R.Previous), 1: () => {
263
+ Z(() => l.openCombobox()), t.value || l.goToOption(R.Last);
264
+ } });
265
+ case M.Home:
266
+ if (s.shiftKey) break;
267
+ return s.preventDefault(), s.stopPropagation(), l.goToOption(R.First);
268
+ case M.PageUp:
269
+ return s.preventDefault(), s.stopPropagation(), l.goToOption(R.First);
270
+ case M.End:
271
+ if (s.shiftKey) break;
272
+ return s.preventDefault(), s.stopPropagation(), l.goToOption(R.Last);
273
+ case M.PageDown:
274
+ return s.preventDefault(), s.stopPropagation(), l.goToOption(R.Last);
275
+ case M.Escape:
276
+ return t.comboboxState !== 0 ? void 0 : (s.preventDefault(), t.optionsElement && !t.optionsPropsRef.current.static && s.stopPropagation(), t.mode === 0 && t.value === null && S(), l.closeCombobox());
277
+ case M.Tab:
278
+ if (t.comboboxState !== 0) return;
279
+ t.mode === 0 && t.activationTrigger !== 1 && l.selectActiveOption(), l.closeCombobox();
280
+ break;
281
+ }
282
+ }), q = v((s) => {
283
+ I == null || I(s), t.mode === 0 && s.target.value === "" && S(), l.openCombobox();
284
+ }), G = v((s) => {
285
+ var V, $, N;
286
+ let h = (V = s.relatedTarget) != null ? V : Ce.find((_) => _ !== s.currentTarget);
287
+ if (!(($ = t.optionsElement) != null && $.contains(h)) && !((N = t.buttonElement) != null && N.contains(h)) && t.comboboxState === 0) return s.preventDefault(), t.mode === 0 && t.value === null && S(), l.closeCombobox();
288
+ }), c = v((s) => {
289
+ var V, $, N;
290
+ let h = (V = s.relatedTarget) != null ? V : Ce.find((_) => _ !== s.currentTarget);
291
+ ($ = t.buttonElement) != null && $.contains(h) || (N = t.optionsElement) != null && N.contains(h) || t.disabled || t.immediate && t.comboboxState !== 0 && D.microTask(() => {
292
+ Z(() => l.openCombobox()), l.setActivationTrigger(1);
293
+ });
294
+ }), C = ge(), K = gt(), { isFocused: J, focusProps: W } = $e({ autoFocus: O }), { isHovered: Y, hoverProps: ne } = Pe({ isDisabled: y }), ie = j(() => ({ open: t.comboboxState === 0, disabled: y, hover: Y, focus: J, autofocus: O }), [t, Y, J, O, y]), F = xe({ ref: P, id: g, role: "combobox", type: f, "aria-controls": (a = t.optionsElement) == null ? void 0 : a.id, "aria-expanded": t.comboboxState === 0, "aria-activedescendant": t.activeOptionIndex === null ? void 0 : t.virtual ? (r = t.options.find((s) => !s.dataRef.current.disabled && t.compare(s.dataRef.current.value, t.virtual.options[t.activeOptionIndex]))) == null ? void 0 : r.id : (u = t.options[t.activeOptionIndex]) == null ? void 0 : u.id, "aria-labelledby": C, "aria-describedby": K, "aria-autocomplete": "list", defaultValue: (i = (b = e.defaultValue) != null ? b : t.defaultValue !== void 0 ? n == null ? void 0 : n(t.defaultValue) : null) != null ? i : t.defaultValue, disabled: y || void 0, autoFocus: O, onCompositionStart: z, onCompositionEnd: k, onKeyDown: H, onChange: q, onFocus: c, onBlur: G }, W, ne);
295
+ return le()({ ourProps: F, theirProps: B, slot: ie, defaultTag: wt, name: "Combobox.Input" });
296
+ }
297
+ let _t = "button";
298
+ function At(e, o) {
299
+ var a;
300
+ let r = oe("Combobox.Button"), u = se("Combobox.Button"), b = ce(o, u.setButtonElement), i = pe(), { id: t = `headlessui-combobox-button-${i}`, disabled: l = r.disabled || !1, autoFocus: d = !1, ...x } = e, g = _e(r.inputElement), I = v((m) => {
301
+ switch (m.key) {
302
+ case M.Space:
303
+ case M.Enter:
304
+ m.preventDefault(), m.stopPropagation(), r.comboboxState === 1 && Z(() => u.openCombobox()), g();
305
+ return;
306
+ case M.ArrowDown:
307
+ m.preventDefault(), m.stopPropagation(), r.comboboxState === 1 && (Z(() => u.openCombobox()), r.value || u.goToOption(R.First)), g();
308
+ return;
309
+ case M.ArrowUp:
310
+ m.preventDefault(), m.stopPropagation(), r.comboboxState === 1 && (Z(() => u.openCombobox()), r.value || u.goToOption(R.Last)), g();
311
+ return;
312
+ case M.Escape:
313
+ if (r.comboboxState !== 0) return;
314
+ m.preventDefault(), r.optionsElement && !r.optionsPropsRef.current.static && m.stopPropagation(), Z(() => u.closeCombobox()), g();
315
+ return;
316
+ default:
317
+ return;
318
+ }
319
+ }), n = v((m) => {
320
+ m.preventDefault(), !ft(m.currentTarget) && (m.button === Ae.Left && (r.comboboxState === 0 ? u.closeCombobox() : u.openCombobox()), g());
321
+ }), y = ge([t]), { isFocusVisible: O, focusProps: f } = $e({ autoFocus: d }), { isHovered: B, hoverProps: L } = Pe({ isDisabled: l }), { pressed: P, pressProps: T } = ze({ disabled: l }), D = j(() => ({ open: r.comboboxState === 0, active: P || r.comboboxState === 0, disabled: l, value: r.value, hover: B, focus: O }), [r, B, O, P, l]), S = xe({ ref: b, id: t, type: Ye(e, r.buttonElement), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (a = r.optionsElement) == null ? void 0 : a.id, "aria-expanded": r.comboboxState === 0, "aria-labelledby": y, disabled: l || void 0, autoFocus: d, onMouseDown: n, onKeyDown: I }, f, L, T);
322
+ return le()({ ourProps: S, theirProps: x, slot: D, defaultTag: _t, name: "Combobox.Button" });
323
+ }
324
+ let Mt = "div", kt = Re.RenderStrategy | Re.Static;
325
+ function Bt(e, o) {
326
+ var a, r, u;
327
+ let b = pe(), { id: i = `headlessui-combobox-options-${b}`, hold: t = !1, anchor: l, portal: d = !1, modal: x = !0, transition: g = !1, ...I } = e, n = oe("Combobox.Options"), y = se("Combobox.Options"), O = rt(l);
328
+ O && (d = !0);
329
+ let [f, B] = at(O), [L, P] = De(null), T = lt(), D = ce(o, O ? f : null, y.setOptionsElement, P), S = Fe(n.optionsElement), m = mt(), [w, z] = tt(g, L, m !== null ? (m & de.Open) === de.Open : n.comboboxState === 0);
330
+ We(w, n.inputElement, y.closeCombobox);
331
+ let k = n.__demoMode ? !1 : x && n.comboboxState === 0;
332
+ Ze(k, S);
333
+ let H = n.__demoMode ? !1 : x && n.comboboxState === 0;
334
+ Je(H, { allowed: be(() => [n.inputElement, n.buttonElement, n.optionsElement], [n.inputElement, n.buttonElement, n.optionsElement]) }), Q(() => {
335
+ var F;
336
+ n.optionsPropsRef.current.static = (F = e.static) != null ? F : !1;
337
+ }, [n.optionsPropsRef, e.static]), Q(() => {
338
+ n.optionsPropsRef.current.hold = t;
339
+ }, [n.optionsPropsRef, t]), nt(n.comboboxState === 0, { container: n.optionsElement, accept(F) {
340
+ return F.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : F.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
341
+ }, walk(F) {
342
+ F.setAttribute("role", "none");
343
+ } });
344
+ let q = ge([(a = n.buttonElement) == null ? void 0 : a.id]), G = j(() => ({ open: n.comboboxState === 0, option: void 0 }), [n.comboboxState]), c = v(() => {
345
+ y.setActivationTrigger(0);
346
+ }), C = v((F) => {
347
+ F.preventDefault(), y.setActivationTrigger(0);
348
+ }), K = xe(O ? T() : {}, { "aria-labelledby": q, role: "listbox", "aria-multiselectable": n.mode === 1 ? !0 : void 0, id: i, ref: D, style: { ...I.style, ...B, "--input-width": Ie(n.inputElement, !0).width, "--button-width": Ie(n.buttonElement, !0).width }, onWheel: n.activationTrigger === 0 ? void 0 : c, onMouseDown: C, ...ot(z) }), J = w && n.comboboxState === 1, W = ye(J, (r = n.virtual) == null ? void 0 : r.options), Y = ye(J, n.value), ne = v((F) => n.compare(Y, F));
349
+ if (n.virtual) {
350
+ if (W === void 0) throw new Error("Missing `options` in virtual mode");
351
+ Object.assign(I, { children: A.createElement(re.Provider, { value: W !== n.virtual.options ? { ...n, virtual: { ...n.virtual, options: W } } : n }, A.createElement(Rt, { slot: G }, I.children)) });
352
+ }
353
+ let ie = le();
354
+ return A.createElement(It, { enabled: d ? e.static || w : !1 }, A.createElement(re.Provider, { value: n.mode === 1 ? n : { ...n, isSelected: ne } }, ie({ ourProps: K, theirProps: { ...I, children: A.createElement(pt, { freeze: J }, typeof I.children == "function" ? (u = I.children) == null ? void 0 : u.call(I, G) : I.children) }, slot: G, defaultTag: Mt, features: kt, visible: w, name: "Combobox.Options" })));
355
+ }
356
+ let Lt = "div";
357
+ function Vt(e, o) {
358
+ var a, r, u, b;
359
+ let i = oe("Combobox.Option"), t = se("Combobox.Option"), l = pe(), { id: d = `headlessui-combobox-option-${l}`, value: x, disabled: g = (u = (r = (a = i.virtual) == null ? void 0 : a.disabled) == null ? void 0 : r.call(a, x)) != null ? u : !1, order: I = null, ...n } = e, y = _e(i.inputElement), O = i.virtual ? i.activeOptionIndex === i.calculateIndex(x) : i.activeOptionIndex === null ? !1 : ((b = i.options[i.activeOptionIndex]) == null ? void 0 : b.id) === d, f = i.isSelected(x), B = te(null), L = Qe({ disabled: g, value: x, domRef: B, order: I }), P = ve(Me), T = ce(o, B, P ? P.measureElement : null), D = v(() => {
360
+ t.setIsTyping(!1), t.onChange(x);
361
+ });
362
+ Q(() => t.registerOption(d, L), [L, d]);
363
+ let S = te(!(i.virtual || i.__demoMode));
364
+ Q(() => {
365
+ if (!i.virtual && !i.__demoMode) return he().requestAnimationFrame(() => {
366
+ S.current = !0;
367
+ });
368
+ }, [i.virtual, i.__demoMode]), Q(() => {
369
+ if (S.current && i.comboboxState === 0 && O && i.activationTrigger !== 0) return he().requestAnimationFrame(() => {
370
+ var C, K;
371
+ (K = (C = B.current) == null ? void 0 : C.scrollIntoView) == null || K.call(C, { block: "nearest" });
372
+ });
373
+ }, [B, O, i.comboboxState, i.activationTrigger, i.activeOptionIndex]);
374
+ let m = v((C) => {
375
+ C.preventDefault(), C.button === Ae.Left && (g || (D(), xt() || requestAnimationFrame(() => y()), i.mode === 0 && t.closeCombobox()));
376
+ }), w = v(() => {
377
+ if (g) return t.goToOption(R.Nothing);
378
+ let C = i.calculateIndex(x);
379
+ t.goToOption(R.Specific, C);
380
+ }), z = et(), k = v((C) => z.update(C)), H = v((C) => {
381
+ if (!z.wasMoved(C) || g || O) return;
382
+ let K = i.calculateIndex(x);
383
+ t.goToOption(R.Specific, K, 0);
384
+ }), q = v((C) => {
385
+ z.wasMoved(C) && (g || O && (i.optionsPropsRef.current.hold || t.goToOption(R.Nothing)));
386
+ }), G = j(() => ({ active: O, focus: O, selected: f, disabled: g }), [O, f, g]), c = { id: d, ref: T, role: "option", tabIndex: g === !0 ? void 0 : -1, "aria-disabled": g === !0 ? !0 : void 0, "aria-selected": f, disabled: void 0, onMouseDown: m, onFocus: w, onPointerEnter: k, onMouseEnter: k, onPointerMove: H, onMouseMove: H, onPointerLeave: q, onMouseLeave: q };
387
+ return le()({ ourProps: c, theirProps: n, slot: G, defaultTag: Lt, name: "Combobox.Option" });
388
+ }
389
+ let Nt = ae(Dt), Kt = ae(At), Ut = ae(Ft), zt = Ot, Ht = ae(Bt), Gt = ae(Vt), Lo = Object.assign(Nt, { Input: Ut, Button: Kt, Label: zt, Options: Ht, Option: Gt });
390
+ export {
391
+ Lo as Combobox,
392
+ Kt as ComboboxButton,
393
+ Ut as ComboboxInput,
394
+ zt as ComboboxLabel,
395
+ Gt as ComboboxOption,
396
+ Ht as ComboboxOptions
397
+ };
@@ -0,0 +1,43 @@
1
+ import v, { useId as D, useMemo as p, useState as h, createContext as g, useContext as c } from "react";
2
+ import { useEvent as E } from "../../hooks/use-event.js";
3
+ import { useIsoMorphicEffect as b } from "../../hooks/use-iso-morphic-effect.js";
4
+ import { useSyncRefs as x } from "../../hooks/use-sync-refs.js";
5
+ import { useDisabled as S } from "../../internal/disabled.js";
6
+ import { forwardRefWithAs as w, useRender as y } from "../../utils/render.js";
7
+ let u = g(null);
8
+ u.displayName = "DescriptionContext";
9
+ function d() {
10
+ let t = c(u);
11
+ if (t === null) {
12
+ let e = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
13
+ throw Error.captureStackTrace && Error.captureStackTrace(e, d), e;
14
+ }
15
+ return t;
16
+ }
17
+ function M() {
18
+ var t, e;
19
+ return (e = (t = c(u)) == null ? void 0 : t.value) != null ? e : void 0;
20
+ }
21
+ function O() {
22
+ let [t, e] = h([]);
23
+ return [t.length > 0 ? t.join(" ") : void 0, p(() => function(r) {
24
+ let a = E((l) => (e((o) => [...o, l]), () => e((o) => {
25
+ let i = o.slice(), n = i.indexOf(l);
26
+ return n !== -1 && i.splice(n, 1), i;
27
+ }))), s = p(() => ({ register: a, slot: r.slot, name: r.name, props: r.props, value: r.value }), [a, r.slot, r.name, r.props, r.value]);
28
+ return v.createElement(u.Provider, { value: s }, r.children);
29
+ }, [e])];
30
+ }
31
+ let C = "p";
32
+ function R(t, e) {
33
+ let r = D(), a = S(), { id: s = `headlessui-description-${r}`, ...l } = t, o = d(), i = x(e);
34
+ b(() => o.register(s), [s, o.register]);
35
+ let n = a || !1, f = p(() => ({ ...o.slot, disabled: n }), [o.slot, n]), m = { ref: i, ...o.props, id: s };
36
+ return y()({ ourProps: m, theirProps: l, slot: f, defaultTag: C, name: o.name || "Description" });
37
+ }
38
+ let P = w(R), A = Object.assign(P, {});
39
+ export {
40
+ A as Description,
41
+ M as useDescribedBy,
42
+ O as useDescriptions
43
+ };
@@ -0,0 +1,100 @@
1
+ import t, { useId as x, useMemo as P, Fragment as G, useEffect as ae, useContext as le, createContext as ne, useRef as L, useReducer as ie, createRef as se } from "react";
2
+ import { useEscape as ue } from "../../hooks/use-escape.js";
3
+ import { useEvent as C } from "../../hooks/use-event.js";
4
+ import { useInertOthers as de } from "../../hooks/use-inert-others.js";
5
+ import { useIsTouchDevice as pe } from "../../hooks/use-is-touch-device.js";
6
+ import { useOnDisappear as ce } from "../../hooks/use-on-disappear.js";
7
+ import { useOutsideClick as me } from "../../hooks/use-outside-click.js";
8
+ import { useOwnerDocument as fe } from "../../hooks/use-owner.js";
9
+ import { MainTreeProvider as U, useMainTreeNode as ge, useRootContainers as ve } from "../../hooks/use-root-containers.js";
10
+ import { useScrollLock as he } from "../../hooks/use-scroll-lock.js";
11
+ import { useServerHandoffComplete as Ee } from "../../hooks/use-server-handoff-complete.js";
12
+ import { useSyncRefs as N } from "../../hooks/use-sync-refs.js";
13
+ import { CloseProvider as $e } from "../../internal/close-provider.js";
14
+ import { useOpenClosed as V, State as b, ResetOpenClosedProvider as De } from "../../internal/open-closed.js";
15
+ import { ForcePortalRoot as j } from "../../internal/portal-force-root.js";
16
+ import { match as Ce } from "../../utils/match.js";
17
+ import { forwardRefWithAs as T, useRender as y, RenderFeatures as z } from "../../utils/render.js";
18
+ import { Description as Pe, useDescriptions as Te } from "../description/description.js";
19
+ import { FocusTrapFeatures as D, FocusTrap as we } from "../focus-trap/focus-trap.js";
20
+ import { useNestedPortals as Re, Portal as be, PortalGroup as ye } from "../portal/portal.js";
21
+ import { TransitionChild as W, Transition as Oe } from "../transition/transition.js";
22
+ var Ie = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Ie || {}), Fe = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(Fe || {});
23
+ let Se = { 0(e, o) {
24
+ return e.titleId === o.id ? e : { ...e, titleId: o.id };
25
+ } }, Y = ne(null);
26
+ Y.displayName = "DialogContext";
27
+ function O(e) {
28
+ let o = le(Y);
29
+ if (o === null) {
30
+ let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
31
+ throw Error.captureStackTrace && Error.captureStackTrace(n, O), n;
32
+ }
33
+ return o;
34
+ }
35
+ function ke(e, o) {
36
+ return Ce(o.type, Se, e, o);
37
+ }
38
+ let A = T(function(e, o) {
39
+ let n = x(), { id: i = `headlessui-dialog-${n}`, open: r, onClose: u, initialFocus: s, role: a = "dialog", autoFocus: c = !0, __demoMode: d = !1, unmount: m = !1, ...I } = e, w = L(!1);
40
+ a = (function() {
41
+ return a === "dialog" || a === "alertdialog" ? a : (w.current || (w.current = !0, console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
42
+ })();
43
+ let g = V();
44
+ r === void 0 && g !== null && (r = (g & b.Open) === b.Open);
45
+ let p = L(null), F = N(p, o), E = fe(p), f = r ? 0 : 1, [R, q] = ie(ke, { titleId: null, descriptionId: null, panelRef: se() }), v = C(() => u(!1)), M = C((l) => q({ type: 0, id: l })), h = Ee() ? f === 0 : !1, [K, Q] = Re(), X = { get current() {
46
+ var l;
47
+ return (l = R.panelRef.current) != null ? l : p.current;
48
+ } }, S = ge(), { resolveContainers: k } = ve({ mainTreeNode: S, portals: K, defaultContainers: [X] }), B = g !== null ? (g & b.Closing) === b.Closing : !1;
49
+ de(d || B ? !1 : h, { allowed: C(() => {
50
+ var l, _;
51
+ return [(_ = (l = p.current) == null ? void 0 : l.closest("[data-headlessui-portal]")) != null ? _ : null];
52
+ }), disallowed: C(() => {
53
+ var l;
54
+ return [(l = S == null ? void 0 : S.closest("body > *:not(#headlessui-portal-root)")) != null ? l : null];
55
+ }) }), me(h, k, (l) => {
56
+ l.preventDefault(), v();
57
+ }), ue(h, E == null ? void 0 : E.defaultView, (l) => {
58
+ l.preventDefault(), l.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), v();
59
+ }), he(d || B ? !1 : h, E, k), ce(h, p, v);
60
+ let [Z, J] = Te(), ee = P(() => [{ dialogState: f, close: v, setTitleId: M, unmount: m }, R], [f, R, v, M, m]), H = P(() => ({ open: f === 0 }), [f]), oe = { ref: F, id: i, role: a, tabIndex: -1, "aria-modal": d ? void 0 : f === 0 ? !0 : void 0, "aria-labelledby": R.titleId, "aria-describedby": Z, unmount: m }, te = !pe(), $ = D.None;
61
+ h && !d && ($ |= D.RestoreFocus, $ |= D.TabLock, c && ($ |= D.AutoFocus), te && ($ |= D.InitialFocus));
62
+ let re = y();
63
+ return t.createElement(De, null, t.createElement(j, { force: !0 }, t.createElement(be, null, t.createElement(Y.Provider, { value: ee }, t.createElement(ye, { target: p }, t.createElement(j, { force: !1 }, t.createElement(J, { slot: H }, t.createElement(Q, null, t.createElement(we, { initialFocus: s, initialFocusFallback: p, containers: k, features: $ }, t.createElement($e, { value: v }, re({ ourProps: oe, theirProps: I, slot: H, defaultTag: xe, features: Ne, visible: f === 0, name: "Dialog" })))))))))));
64
+ }), xe = "div", Ne = z.RenderStrategy | z.Static;
65
+ function Ye(e, o) {
66
+ let { transition: n = !1, open: i, ...r } = e, u = V(), s = e.hasOwnProperty("open") || u !== null, a = e.hasOwnProperty("onClose");
67
+ if (!s && !a) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
68
+ if (!s) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
69
+ if (!a) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
70
+ if (!u && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);
71
+ if (typeof e.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);
72
+ return (i !== void 0 || n) && !r.static ? t.createElement(U, null, t.createElement(Oe, { show: i, transition: n, unmount: r.unmount }, t.createElement(A, { ref: o, ...r }))) : t.createElement(U, null, t.createElement(A, { ref: o, open: i, ...r }));
73
+ }
74
+ let Me = "div";
75
+ function Be(e, o) {
76
+ let n = x(), { id: i = `headlessui-dialog-panel-${n}`, transition: r = !1, ...u } = e, [{ dialogState: s, unmount: a }, c] = O("Dialog.Panel"), d = N(o, c.panelRef), m = P(() => ({ open: s === 0 }), [s]), I = C((E) => {
77
+ E.stopPropagation();
78
+ }), w = { ref: d, id: i, onClick: I }, g = r ? W : G, p = r ? { unmount: a } : {}, F = y();
79
+ return t.createElement(g, { ...p }, F({ ourProps: w, theirProps: u, slot: m, defaultTag: Me, name: "Dialog.Panel" }));
80
+ }
81
+ let He = "div";
82
+ function _e(e, o) {
83
+ let { transition: n = !1, ...i } = e, [{ dialogState: r, unmount: u }] = O("Dialog.Backdrop"), s = P(() => ({ open: r === 0 }), [r]), a = { ref: o, "aria-hidden": !0 }, c = n ? W : G, d = n ? { unmount: u } : {}, m = y();
84
+ return t.createElement(c, { ...d }, m({ ourProps: a, theirProps: i, slot: s, defaultTag: He, name: "Dialog.Backdrop" }));
85
+ }
86
+ let Le = "h2";
87
+ function Ue(e, o) {
88
+ let n = x(), { id: i = `headlessui-dialog-title-${n}`, ...r } = e, [{ dialogState: u, setTitleId: s }] = O("Dialog.Title"), a = N(o);
89
+ ae(() => (s(i), () => s(null)), [i, s]);
90
+ let c = P(() => ({ open: u === 0 }), [u]), d = { ref: a, id: i };
91
+ return y()({ ourProps: d, theirProps: r, slot: c, defaultTag: Le, name: "Dialog.Title" });
92
+ }
93
+ let je = T(Ye), ze = T(Be);
94
+ T(_e);
95
+ let Ae = T(Ue), mo = Object.assign(je, { Panel: ze, Title: Ae, Description: Pe });
96
+ export {
97
+ mo as Dialog,
98
+ ze as DialogPanel,
99
+ Ae as DialogTitle
100
+ };