@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,129 @@
1
+ import E, { useRef as w } from "react";
2
+ import { useDisposables as C } from "../../hooks/use-disposables.js";
3
+ import { useEvent as A } from "../../hooks/use-event.js";
4
+ import { useEventListener as K } from "../../hooks/use-event-listener.js";
5
+ import { useIsMounted as I } from "../../hooks/use-is-mounted.js";
6
+ import { useIsTopLayer as M } from "../../hooks/use-is-top-layer.js";
7
+ import { useOnUnmount as U } from "../../hooks/use-on-unmount.js";
8
+ import { useOwnerDocument as _ } from "../../hooks/use-owner.js";
9
+ import { useServerHandoffComplete as j } from "../../hooks/use-server-handoff-complete.js";
10
+ import { useSyncRefs as q } from "../../hooks/use-sync-refs.js";
11
+ import { useTabDirection as G, Direction as T } from "../../hooks/use-tab-direction.js";
12
+ import { useWatch as g } from "../../hooks/use-watch.js";
13
+ import { Hidden as h, HiddenFeatures as $ } from "../../internal/hidden.js";
14
+ import { history as k } from "../../utils/active-element-history.js";
15
+ import { focusIn as v, Focus as f, focusElement as l, FocusResult as H } from "../../utils/focus-management.js";
16
+ import { match as R } from "../../utils/match.js";
17
+ import { microTask as P } from "../../utils/micro-task.js";
18
+ import { forwardRefWithAs as V, useRender as Z } from "../../utils/render.js";
19
+ function S(e) {
20
+ if (!e) return /* @__PURE__ */ new Set();
21
+ if (typeof e == "function") return new Set(e());
22
+ let r = /* @__PURE__ */ new Set();
23
+ for (let t of e.current) t.current instanceof HTMLElement && r.add(t.current);
24
+ return r;
25
+ }
26
+ let z = "div";
27
+ var x = ((e) => (e[e.None = 0] = "None", e[e.InitialFocus = 1] = "InitialFocus", e[e.TabLock = 2] = "TabLock", e[e.FocusLock = 4] = "FocusLock", e[e.RestoreFocus = 8] = "RestoreFocus", e[e.AutoFocus = 16] = "AutoFocus", e))(x || {});
28
+ function J(e, r) {
29
+ let t = w(null), n = q(t, r), { initialFocus: u, initialFocusFallback: s, containers: m, features: o = 15, ...i } = e;
30
+ j() || (o = 0);
31
+ let a = _(t);
32
+ Y(o, { ownerDocument: a });
33
+ let d = ee(o, { ownerDocument: a, container: t, initialFocus: u, initialFocusFallback: s });
34
+ te(o, { ownerDocument: a, container: t, containers: m, previousActiveElement: d });
35
+ let L = G(), D = A((c) => {
36
+ let p = t.current;
37
+ p && ((F) => F())(() => {
38
+ R(L.current, { [T.Forwards]: () => {
39
+ v(p, f.First, { skipElements: [c.relatedTarget, s] });
40
+ }, [T.Backwards]: () => {
41
+ v(p, f.Last, { skipElements: [c.relatedTarget, s] });
42
+ } });
43
+ });
44
+ }), y = M(!!(o & 2), "focus-trap#tab-lock"), N = C(), b = w(!1), O = { ref: n, onKeyDown(c) {
45
+ c.key == "Tab" && (b.current = !0, N.requestAnimationFrame(() => {
46
+ b.current = !1;
47
+ }));
48
+ }, onBlur(c) {
49
+ if (!(o & 4)) return;
50
+ let p = S(m);
51
+ t.current instanceof HTMLElement && p.add(t.current);
52
+ let F = c.relatedTarget;
53
+ F instanceof HTMLElement && F.dataset.headlessuiFocusGuard !== "true" && (B(p, F) || (b.current ? v(t.current, R(L.current, { [T.Forwards]: () => f.Next, [T.Backwards]: () => f.Previous }) | f.WrapAround, { relativeTo: c.target }) : c.target instanceof HTMLElement && l(c.target)));
54
+ } }, W = Z();
55
+ return E.createElement(E.Fragment, null, y && E.createElement(h, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: D, features: $.Focusable }), W({ ourProps: O, theirProps: i, defaultTag: z, name: "FocusTrap" }), y && E.createElement(h, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: D, features: $.Focusable }));
56
+ }
57
+ let Q = V(J), be = Object.assign(Q, { features: x });
58
+ function X(e = !0) {
59
+ let r = w(k.slice());
60
+ return g(([t], [n]) => {
61
+ n === !0 && t === !1 && P(() => {
62
+ r.current.splice(0);
63
+ }), n === !1 && t === !0 && (r.current = k.slice());
64
+ }, [e, k, r]), A(() => {
65
+ var t;
66
+ return (t = r.current.find((n) => n != null && n.isConnected)) != null ? t : null;
67
+ });
68
+ }
69
+ function Y(e, { ownerDocument: r }) {
70
+ let t = !!(e & 8), n = X(t);
71
+ g(() => {
72
+ t || (r == null ? void 0 : r.activeElement) === (r == null ? void 0 : r.body) && l(n());
73
+ }, [t]), U(() => {
74
+ t && l(n());
75
+ });
76
+ }
77
+ function ee(e, { ownerDocument: r, container: t, initialFocus: n, initialFocusFallback: u }) {
78
+ let s = w(null), m = M(!!(e & 1), "focus-trap#initial-focus"), o = I();
79
+ return g(() => {
80
+ if (e === 0) return;
81
+ if (!m) {
82
+ u != null && u.current && l(u.current);
83
+ return;
84
+ }
85
+ let i = t.current;
86
+ i && P(() => {
87
+ if (!o.current) return;
88
+ let a = r == null ? void 0 : r.activeElement;
89
+ if (n != null && n.current) {
90
+ if ((n == null ? void 0 : n.current) === a) {
91
+ s.current = a;
92
+ return;
93
+ }
94
+ } else if (i.contains(a)) {
95
+ s.current = a;
96
+ return;
97
+ }
98
+ if (n != null && n.current) l(n.current);
99
+ else {
100
+ if (e & 16) {
101
+ if (v(i, f.First | f.AutoFocus) !== H.Error) return;
102
+ } else if (v(i, f.First) !== H.Error) return;
103
+ if (u != null && u.current && (l(u.current), (r == null ? void 0 : r.activeElement) === u.current)) return;
104
+ console.warn("There are no focusable elements inside the <FocusTrap />");
105
+ }
106
+ s.current = r == null ? void 0 : r.activeElement;
107
+ });
108
+ }, [u, m, e]), s;
109
+ }
110
+ function te(e, { ownerDocument: r, container: t, containers: n, previousActiveElement: u }) {
111
+ let s = I(), m = !!(e & 4);
112
+ K(r == null ? void 0 : r.defaultView, "focus", (o) => {
113
+ if (!m || !s.current) return;
114
+ let i = S(n);
115
+ t.current instanceof HTMLElement && i.add(t.current);
116
+ let a = u.current;
117
+ if (!a) return;
118
+ let d = o.target;
119
+ d && d instanceof HTMLElement ? B(i, d) ? (u.current = d, l(d)) : (o.preventDefault(), o.stopPropagation(), l(a)) : l(u.current);
120
+ }, !0);
121
+ }
122
+ function B(e, r) {
123
+ for (let t of e) if (t.contains(r)) return !0;
124
+ return !1;
125
+ }
126
+ export {
127
+ be as FocusTrap,
128
+ x as FocusTrapFeatures
129
+ };
@@ -0,0 +1,4 @@
1
+ var o = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(o || {});
2
+ export {
3
+ o as Keys
4
+ };
@@ -0,0 +1,59 @@
1
+ import $, { useContext as E, createContext as I, useState as F, useMemo as h, useId as M } from "react";
2
+ import { useEvent as L } from "../../hooks/use-event.js";
3
+ import { useIsoMorphicEffect as P } from "../../hooks/use-iso-morphic-effect.js";
4
+ import { useSyncRefs as S } from "../../hooks/use-sync-refs.js";
5
+ import { useDisabled as w } from "../../internal/disabled.js";
6
+ import { useProvidedId as B } from "../../internal/id.js";
7
+ import { forwardRefWithAs as R, useRender as j } from "../../utils/render.js";
8
+ let m = I(null);
9
+ m.displayName = "LabelContext";
10
+ function x() {
11
+ let r = E(m);
12
+ if (r === null) {
13
+ let o = new Error("You used a <Label /> component, but it is not inside a relevant parent.");
14
+ throw Error.captureStackTrace && Error.captureStackTrace(o, x), o;
15
+ }
16
+ return r;
17
+ }
18
+ function A(r) {
19
+ var o, n, a;
20
+ let e = (n = (o = E(m)) == null ? void 0 : o.value) != null ? n : void 0;
21
+ return ((a = r == null ? void 0 : r.length) != null ? a : 0) > 0 ? [e, ...r].filter(Boolean).join(" ") : e;
22
+ }
23
+ function Y({ inherit: r = !1 } = {}) {
24
+ let o = A(), [n, a] = F([]), e = r ? [o, ...n].filter(Boolean) : n;
25
+ return [e.length > 0 ? e.join(" ") : void 0, h(() => function(t) {
26
+ let p = L((u) => (a((c) => [...c, u]), () => a((c) => {
27
+ let i = c.slice(), d = i.indexOf(u);
28
+ return d !== -1 && i.splice(d, 1), i;
29
+ }))), s = h(() => ({ register: p, slot: t.slot, name: t.name, props: t.props, value: t.value }), [p, t.slot, t.name, t.props, t.value]);
30
+ return $.createElement(m.Provider, { value: s }, t.children);
31
+ }, [a])];
32
+ }
33
+ let H = "label";
34
+ function D(r, o) {
35
+ var n;
36
+ let a = M(), e = x(), t = B(), p = w(), { id: s = `headlessui-label-${a}`, htmlFor: u = t ?? ((n = e.props) == null ? void 0 : n.htmlFor), passive: c = !1, ...i } = r, d = S(o);
37
+ P(() => e.register(s), [s, e.register]);
38
+ let y = L((b) => {
39
+ let v = b.currentTarget;
40
+ if (v instanceof HTMLLabelElement && b.preventDefault(), e.props && "onClick" in e.props && typeof e.props.onClick == "function" && e.props.onClick(b), v instanceof HTMLLabelElement) {
41
+ let l = document.getElementById(v.htmlFor);
42
+ if (l) {
43
+ let C = l.getAttribute("disabled");
44
+ if (C === "true" || C === "") return;
45
+ let g = l.getAttribute("aria-disabled");
46
+ if (g === "true" || g === "") return;
47
+ (l instanceof HTMLInputElement && (l.type === "radio" || l.type === "checkbox") || l.role === "radio" || l.role === "checkbox" || l.role === "switch") && l.click(), l.focus({ preventScroll: !0 });
48
+ }
49
+ }
50
+ }), k = p || !1, T = h(() => ({ ...e.slot, disabled: k }), [e.slot, k]), f = { ref: d, ...e.props, id: s, htmlFor: u, onClick: y };
51
+ return c && ("onClick" in f && (delete f.htmlFor, delete f.onClick), "onClick" in i && delete i.onClick), j()({ ourProps: f, theirProps: i, slot: T, defaultTag: u ? H : "div", name: e.name || "Label" });
52
+ }
53
+ let K = R(D), q = Object.assign(K, {});
54
+ export {
55
+ q as Label,
56
+ x as useLabelContext,
57
+ A as useLabelledBy,
58
+ Y as useLabels
59
+ };
@@ -0,0 +1,4 @@
1
+ var e = ((t) => (t[t.Left = 0] = "Left", t[t.Right = 2] = "Right", t))(e || {});
2
+ export {
3
+ e as MouseButton
4
+ };
@@ -0,0 +1,71 @@
1
+ import p, { Fragment as b, createContext as C, useContext as m, useRef as y, useMemo as h, useState as R, useEffect as P } from "react";
2
+ import { createPortal as A } from "react-dom";
3
+ import { useEvent as g } from "../../hooks/use-event.js";
4
+ import { useIsoMorphicEffect as E } from "../../hooks/use-iso-morphic-effect.js";
5
+ import { useOnUnmount as G } from "../../hooks/use-on-unmount.js";
6
+ import { useOwnerDocument as S } from "../../hooks/use-owner.js";
7
+ import { useServerHandoffComplete as I } from "../../hooks/use-server-handoff-complete.js";
8
+ import { useSyncRefs as d, optionalRef as M } from "../../hooks/use-sync-refs.js";
9
+ import { usePortalRoot as j } from "../../internal/portal-force-root.js";
10
+ import { env as $ } from "../../utils/env.js";
11
+ import { forwardRefWithAs as c, useRender as v } from "../../utils/render.js";
12
+ function w(a) {
13
+ let l = j(), o = m(N), e = S(a), [u, r] = R(() => {
14
+ var t;
15
+ if (!l && o !== null) return (t = o.current) != null ? t : null;
16
+ if ($.isServer) return null;
17
+ let n = e == null ? void 0 : e.getElementById("headlessui-portal-root");
18
+ if (n) return n;
19
+ if (e === null) return null;
20
+ let i = e.createElement("div");
21
+ return i.setAttribute("id", "headlessui-portal-root"), e.body.appendChild(i);
22
+ });
23
+ return P(() => {
24
+ u !== null && (e != null && e.body.contains(u) || e == null || e.body.appendChild(u));
25
+ }, [u, e]), P(() => {
26
+ l || o !== null && r(o.current);
27
+ }, [o, r, l]), u;
28
+ }
29
+ let x = b, H = c(function(a, l) {
30
+ let o = a, e = y(null), u = d(M((s) => {
31
+ e.current = s;
32
+ }), l), r = S(e), t = w(e), [n] = R(() => {
33
+ var s;
34
+ return $.isServer ? null : (s = r == null ? void 0 : r.createElement("div")) != null ? s : null;
35
+ }), i = m(f), O = I();
36
+ E(() => {
37
+ !t || !n || t.contains(n) || (n.setAttribute("data-headlessui-portal", ""), t.appendChild(n));
38
+ }, [t, n]), E(() => {
39
+ if (n && i) return i.register(n);
40
+ }, [i, n]), G(() => {
41
+ var s;
42
+ !t || !n || (n instanceof Node && t.contains(n) && t.removeChild(n), t.childNodes.length <= 0 && ((s = t.parentElement) == null || s.removeChild(t)));
43
+ });
44
+ let T = v();
45
+ return O ? !t || !n ? null : A(T({ ourProps: { ref: u }, theirProps: o, slot: {}, defaultTag: x, name: "Portal" }), n) : null;
46
+ });
47
+ function W(a, l) {
48
+ let o = d(l), { enabled: e = !0, ...u } = a, r = v();
49
+ return e ? p.createElement(H, { ...u, ref: o }) : r({ ourProps: { ref: o }, theirProps: u, slot: {}, defaultTag: x, name: "Portal" });
50
+ }
51
+ let _ = b, N = C(null);
52
+ function B(a, l) {
53
+ let { target: o, ...e } = a, u = { ref: d(l) }, r = v();
54
+ return p.createElement(N.Provider, { value: o }, r({ ourProps: u, theirProps: e, defaultTag: _, name: "Popover.Group" }));
55
+ }
56
+ let f = C(null);
57
+ function Z() {
58
+ let a = m(f), l = y([]), o = g((r) => (l.current.push(r), a && a.register(r), () => e(r))), e = g((r) => {
59
+ let t = l.current.indexOf(r);
60
+ t !== -1 && l.current.splice(t, 1), a && a.unregister(r);
61
+ }), u = h(() => ({ register: o, unregister: e, portals: l }), [o, e, l]);
62
+ return [l, h(() => function({ children: r }) {
63
+ return p.createElement(f.Provider, { value: u }, r);
64
+ }, [u])];
65
+ }
66
+ let D = c(W), F = c(B), ee = Object.assign(D, { Group: F });
67
+ export {
68
+ ee as Portal,
69
+ F as PortalGroup,
70
+ Z as useNestedPortals
71
+ };
@@ -0,0 +1,135 @@
1
+ import d, { useContext as Q, createContext as te, useRef as C, useState as M, useMemo as ne, Fragment as U, useEffect as ge } from "react";
2
+ import { useDisposables as Te } from "../../hooks/use-disposables.js";
3
+ import { useEvent as E } from "../../hooks/use-event.js";
4
+ import { useIsMounted as Ce } from "../../hooks/use-is-mounted.js";
5
+ import { useIsoMorphicEffect as L } from "../../hooks/use-iso-morphic-effect.js";
6
+ import { useLatestValue as Ee } from "../../hooks/use-latest-value.js";
7
+ import { useServerHandoffComplete as le } from "../../hooks/use-server-handoff-complete.js";
8
+ import { useSyncRefs as ie } from "../../hooks/use-sync-refs.js";
9
+ import { useTransition as we, transitionDataAttributes as Re } from "../../hooks/use-transition.js";
10
+ import { useOpenClosed as se, State as F, OpenClosedProvider as $e } from "../../internal/open-closed.js";
11
+ import { classNames as Pe } from "../../utils/class-names.js";
12
+ import { match as ae } from "../../utils/match.js";
13
+ import { forwardRefWithAs as X, useRender as oe, RenderFeatures as Se, RenderStrategy as S, compact as ye } from "../../utils/render.js";
14
+ function ue(e) {
15
+ var r;
16
+ return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((r = e.as) != null ? r : de) !== U || d.Children.count(e.children) === 1;
17
+ }
18
+ let j = te(null);
19
+ j.displayName = "TransitionContext";
20
+ var Fe = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Fe || {});
21
+ function He() {
22
+ let e = Q(j);
23
+ if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
24
+ return e;
25
+ }
26
+ function Oe() {
27
+ let e = Q(z);
28
+ if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
29
+ return e;
30
+ }
31
+ let z = te(null);
32
+ z.displayName = "NestingContext";
33
+ function K(e) {
34
+ return "children" in e ? K(e.children) : e.current.filter(({ el: r }) => r.current !== null).filter(({ state: r }) => r === "visible").length > 0;
35
+ }
36
+ function ce(e, r) {
37
+ let n = Ee(e), a = C([]), w = Ce(), y = Te(), f = E((i, t = S.Hidden) => {
38
+ let s = a.current.findIndex(({ el: l }) => l === i);
39
+ s !== -1 && (ae(t, { [S.Unmount]() {
40
+ a.current.splice(s, 1);
41
+ }, [S.Hidden]() {
42
+ a.current[s].state = "hidden";
43
+ } }), y.microTask(() => {
44
+ var l;
45
+ !K(a) && w.current && ((l = n.current) == null || l.call(n));
46
+ }));
47
+ }), R = E((i) => {
48
+ let t = a.current.find(({ el: s }) => s === i);
49
+ return t ? t.state !== "visible" && (t.state = "visible") : a.current.push({ el: i, state: "visible" }), () => f(i, S.Unmount);
50
+ }), h = C([]), c = C(Promise.resolve()), m = C({ enter: [], leave: [] }), p = E((i, t, s) => {
51
+ h.current.splice(0), r && (r.chains.current[t] = r.chains.current[t].filter(([l]) => l !== i)), r == null || r.chains.current[t].push([i, new Promise((l) => {
52
+ h.current.push(l);
53
+ })]), r == null || r.chains.current[t].push([i, new Promise((l) => {
54
+ Promise.all(m.current[t].map(([$, H]) => H)).then(() => l());
55
+ })]), t === "enter" ? c.current = c.current.then(() => r == null ? void 0 : r.wait.current).then(() => s(t)) : s(t);
56
+ }), b = E((i, t, s) => {
57
+ Promise.all(m.current[t].splice(0).map(([l, $]) => $)).then(() => {
58
+ var l;
59
+ (l = h.current.shift()) == null || l();
60
+ }).then(() => s(t));
61
+ });
62
+ return ne(() => ({ children: a, register: R, unregister: f, onStart: p, onStop: b, wait: c, chains: m }), [R, f, a, p, b, m, c]);
63
+ }
64
+ let de = U, fe = Se.RenderStrategy;
65
+ function Ae(e, r) {
66
+ var n, a;
67
+ let { transition: w = !0, beforeEnter: y, afterEnter: f, beforeLeave: R, afterLeave: h, enter: c, enterFrom: m, enterTo: p, entered: b, leave: i, leaveFrom: t, leaveTo: s, ...l } = e, [$, H] = M(null), o = C(null), g = ue(e), P = ie(...g ? [o, r, H] : r === null ? [] : [r]), Y = (n = l.unmount) == null || n ? S.Unmount : S.Hidden, { show: v, appear: Z, initial: _ } = He(), [T, V] = M(v ? "visible" : "hidden"), q = Oe(), { register: x, unregister: N } = q;
68
+ L(() => x(o), [x, o]), L(() => {
69
+ if (Y === S.Hidden && o.current) {
70
+ if (v && T !== "visible") {
71
+ V("visible");
72
+ return;
73
+ }
74
+ return ae(T, { hidden: () => N(o), visible: () => x(o) });
75
+ }
76
+ }, [T, o, x, N, v, Y]);
77
+ let W = le();
78
+ L(() => {
79
+ if (g && W && T === "visible" && o.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
80
+ }, [o, T, W, g]);
81
+ let ve = _ && !Z, J = Z && v && _, k = C(!1), D = ce(() => {
82
+ k.current || (V("hidden"), N(o));
83
+ }, q), ee = E((B) => {
84
+ k.current = !0;
85
+ let I = B ? "enter" : "leave";
86
+ D.onStart(o, I, (A) => {
87
+ A === "enter" ? y == null || y() : A === "leave" && (R == null || R());
88
+ });
89
+ }), re = E((B) => {
90
+ let I = B ? "enter" : "leave";
91
+ k.current = !1, D.onStop(o, I, (A) => {
92
+ A === "enter" ? f == null || f() : A === "leave" && (h == null || h());
93
+ }), I === "leave" && !K(D) && (V("hidden"), N(o));
94
+ });
95
+ ge(() => {
96
+ g && w || (ee(v), re(v));
97
+ }, [v, g, w]);
98
+ let he = !(!w || !g || !W || ve), [, u] = we(he, $, v, { start: ee, end: re }), pe = ye({ ref: P, className: ((a = Pe(l.className, J && c, J && m, u.enter && c, u.enter && u.closed && m, u.enter && !u.closed && p, u.leave && i, u.leave && !u.closed && t, u.leave && u.closed && s, !u.transition && v && b)) == null ? void 0 : a.trim()) || void 0, ...Re(u) }), O = 0;
99
+ T === "visible" && (O |= F.Open), T === "hidden" && (O |= F.Closed), u.enter && (O |= F.Opening), u.leave && (O |= F.Closing);
100
+ let be = oe();
101
+ return d.createElement(z.Provider, { value: D }, d.createElement($e, { value: O }, be({ ourProps: pe, theirProps: l, defaultTag: de, features: fe, visible: T === "visible", name: "Transition.Child" })));
102
+ }
103
+ function Le(e, r) {
104
+ let { show: n, appear: a = !1, unmount: w = !0, ...y } = e, f = C(null), R = ue(e), h = ie(...R ? [f, r] : r === null ? [] : [r]);
105
+ le();
106
+ let c = se();
107
+ if (n === void 0 && c !== null && (n = (c & F.Open) === F.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
108
+ let [m, p] = M(n ? "visible" : "hidden"), b = ce(() => {
109
+ n || p("hidden");
110
+ }), [i, t] = M(!0), s = C([n]);
111
+ L(() => {
112
+ i !== !1 && s.current[s.current.length - 1] !== n && (s.current.push(n), t(!1));
113
+ }, [s, n]);
114
+ let l = ne(() => ({ show: n, appear: a, initial: i }), [n, a, i]);
115
+ L(() => {
116
+ n ? p("visible") : !K(b) && f.current !== null && p("hidden");
117
+ }, [n, b]);
118
+ let $ = { unmount: w }, H = E(() => {
119
+ var P;
120
+ i && t(!1), (P = e.beforeEnter) == null || P.call(e);
121
+ }), o = E(() => {
122
+ var P;
123
+ i && t(!1), (P = e.beforeLeave) == null || P.call(e);
124
+ }), g = oe();
125
+ return d.createElement(z.Provider, { value: b }, d.createElement(j.Provider, { value: l }, g({ ourProps: { ...$, as: U, children: d.createElement(me, { ref: h, ...$, ...y, beforeEnter: H, beforeLeave: o }) }, theirProps: {}, defaultTag: U, features: fe, visible: m === "visible", name: "Transition" })));
126
+ }
127
+ function xe(e, r) {
128
+ let n = Q(j) !== null, a = se() !== null;
129
+ return d.createElement(d.Fragment, null, !n && a ? d.createElement(G, { ref: r, ...e }) : d.createElement(me, { ref: r, ...e }));
130
+ }
131
+ let G = X(Le), me = X(Ae), Ne = X(xe), Xe = Object.assign(G, { Child: Ne, Root: G });
132
+ export {
133
+ Xe as Transition,
134
+ Ne as TransitionChild
135
+ };
@@ -0,0 +1,14 @@
1
+ function i() {
2
+ let l;
3
+ return { before({ doc: e }) {
4
+ var d;
5
+ let t = e.documentElement, n = (d = e.defaultView) != null ? d : window;
6
+ l = Math.max(0, n.innerWidth - t.clientWidth);
7
+ }, after({ doc: e, d }) {
8
+ let t = e.documentElement, n = Math.max(0, t.clientWidth - t.offsetWidth), a = Math.max(0, l - n);
9
+ d.style(t, "paddingRight", `${a}px`);
10
+ } };
11
+ }
12
+ export {
13
+ i as adjustScrollbarPadding
14
+ };
@@ -0,0 +1,48 @@
1
+ import { disposables as f } from "../../utils/disposables.js";
2
+ import { isIOS as u } from "../../utils/platform.js";
3
+ function h() {
4
+ return u() ? { before({ doc: a, d: l, meta: c }) {
5
+ function r(s) {
6
+ return c.containers.flatMap((o) => o()).some((o) => o.contains(s));
7
+ }
8
+ l.microTask(() => {
9
+ var s;
10
+ if (window.getComputedStyle(a.documentElement).scrollBehavior !== "auto") {
11
+ let e = f();
12
+ e.style(a.documentElement, "scrollBehavior", "auto"), l.add(() => l.microTask(() => e.dispose()));
13
+ }
14
+ let o = (s = window.scrollY) != null ? s : window.pageYOffset, n = null;
15
+ l.addEventListener(a, "click", (e) => {
16
+ if (e.target instanceof HTMLElement) try {
17
+ let t = e.target.closest("a");
18
+ if (!t) return;
19
+ let { hash: d } = new URL(t.href), i = a.querySelector(d);
20
+ i && !r(i) && (n = i);
21
+ } catch {
22
+ }
23
+ }, !0), l.addEventListener(a, "touchstart", (e) => {
24
+ if (e.target instanceof HTMLElement) if (r(e.target)) {
25
+ let t = e.target;
26
+ for (; t.parentElement && r(t.parentElement); ) t = t.parentElement;
27
+ l.style(t, "overscrollBehavior", "contain");
28
+ } else l.style(e.target, "touchAction", "none");
29
+ }), l.addEventListener(a, "touchmove", (e) => {
30
+ if (e.target instanceof HTMLElement) {
31
+ if (e.target.tagName === "INPUT") return;
32
+ if (r(e.target)) {
33
+ let t = e.target;
34
+ for (; t.parentElement && t.dataset.headlessuiPortal !== "" && !(t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth); ) t = t.parentElement;
35
+ t.dataset.headlessuiPortal === "" && e.preventDefault();
36
+ } else e.preventDefault();
37
+ }
38
+ }, { passive: !1 }), l.add(() => {
39
+ var e;
40
+ let t = (e = window.scrollY) != null ? e : window.pageYOffset;
41
+ o !== t && window.scrollTo(0, o), n && n.isConnected && (n.scrollIntoView({ block: "nearest" }), n = null);
42
+ });
43
+ });
44
+ } } : {};
45
+ }
46
+ export {
47
+ h as handleIOSLocking
48
+ };
@@ -0,0 +1,36 @@
1
+ import { disposables as d } from "../../utils/disposables.js";
2
+ import { createStore as n } from "../../utils/store.js";
3
+ import { adjustScrollbarPadding as c } from "./adjust-scrollbar-padding.js";
4
+ import { handleIOSLocking as i } from "./handle-ios-locking.js";
5
+ import { preventScroll as f } from "./prevent-scroll.js";
6
+ function m(e) {
7
+ let o = {};
8
+ for (let t of e) Object.assign(o, t(o));
9
+ return o;
10
+ }
11
+ let l = n(() => /* @__PURE__ */ new Map(), { PUSH(e, o) {
12
+ var t;
13
+ let r = (t = this.get(e)) != null ? t : { doc: e, count: 0, d: d(), meta: /* @__PURE__ */ new Set() };
14
+ return r.count++, r.meta.add(o), this.set(e, r), this;
15
+ }, POP(e, o) {
16
+ let t = this.get(e);
17
+ return t && (t.count--, t.meta.delete(o)), this;
18
+ }, SCROLL_PREVENT({ doc: e, d: o, meta: t }) {
19
+ let r = { doc: e, d: o, meta: m(t) }, a = [i(), c(), f()];
20
+ a.forEach(({ before: s }) => s == null ? void 0 : s(r)), a.forEach(({ after: s }) => s == null ? void 0 : s(r));
21
+ }, SCROLL_ALLOW({ d: e }) {
22
+ e.dispose();
23
+ }, TEARDOWN({ doc: e }) {
24
+ this.delete(e);
25
+ } });
26
+ l.subscribe(() => {
27
+ let e = l.getSnapshot(), o = /* @__PURE__ */ new Map();
28
+ for (let [t] of e) o.set(t, t.documentElement.style.overflow);
29
+ for (let t of e.values()) {
30
+ let r = o.get(t.doc) === "hidden", a = t.count !== 0;
31
+ (a && !r || !a && r) && l.dispatch(t.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", t), t.count === 0 && l.dispatch("TEARDOWN", t);
32
+ }
33
+ });
34
+ export {
35
+ l as overflows
36
+ };
@@ -0,0 +1,8 @@
1
+ function r() {
2
+ return { before({ doc: e, d: o }) {
3
+ o.style(e.documentElement, "overflow", "hidden");
4
+ } };
5
+ }
6
+ export {
7
+ r as preventScroll
8
+ };
@@ -0,0 +1,12 @@
1
+ import { useStore as a } from "../use-store.js";
2
+ import { useIsoMorphicEffect as c } from "../use-iso-morphic-effect.js";
3
+ import { overflows as t } from "./overflow-store.js";
4
+ function p(r, o, f = () => ({ containers: [] })) {
5
+ let e = a(t), s = o ? e.get(o) : void 0, i = s ? s.count > 0 : !1;
6
+ return c(() => {
7
+ if (!(!o || !r)) return t.dispatch("PUSH", o, f), () => t.dispatch("POP", o, f);
8
+ }, [r, o]), i;
9
+ }
10
+ export {
11
+ p as useDocumentOverflowLockedEffect
12
+ };
@@ -0,0 +1,33 @@
1
+ import { useRef as a, useState as d } from "react";
2
+ import { getOwnerDocument as m } from "../utils/owner.js";
3
+ import { useDisposables as g } from "./use-disposables.js";
4
+ import { useEvent as u } from "./use-event.js";
5
+ function h(t) {
6
+ let e = t.width / 2, n = t.height / 2;
7
+ return { top: t.clientY - n, right: t.clientX + e, bottom: t.clientY + n, left: t.clientX - e };
8
+ }
9
+ function v(t, e) {
10
+ return !(!t || !e || t.right < e.left || t.left > e.right || t.bottom < e.top || t.top > e.bottom);
11
+ }
12
+ function D({ disabled: t = !1 } = {}) {
13
+ let e = a(null), [n, i] = d(!1), r = g(), o = u(() => {
14
+ e.current = null, i(!1), r.dispose();
15
+ }), p = u((l) => {
16
+ if (r.dispose(), e.current === null) {
17
+ e.current = l.currentTarget, i(!0);
18
+ {
19
+ let s = m(l.currentTarget);
20
+ r.addEventListener(s, "pointerup", o, !1), r.addEventListener(s, "pointermove", (c) => {
21
+ if (e.current) {
22
+ let f = h(c);
23
+ i(v(f, e.current.getBoundingClientRect()));
24
+ }
25
+ }, !1), r.addEventListener(s, "pointercancel", o, !1);
26
+ }
27
+ }
28
+ });
29
+ return { pressed: n, pressProps: t ? {} : { onPointerDown: p, onPointerUp: o, onClick: o } };
30
+ }
31
+ export {
32
+ D as useActivePress
33
+ };
@@ -0,0 +1,16 @@
1
+ import { useCallback as u } from "react";
2
+ function l(n, o) {
3
+ return n !== null && o !== null && typeof n == "object" && typeof o == "object" && "id" in n && "id" in o ? n.id === o.id : n === o;
4
+ }
5
+ function f(n = l) {
6
+ return u((o, t) => {
7
+ if (typeof n == "string") {
8
+ let i = n;
9
+ return (o == null ? void 0 : o[i]) === (t == null ? void 0 : t[i]);
10
+ }
11
+ return n(o, t);
12
+ }, [n]);
13
+ }
14
+ export {
15
+ f as useByComparator
16
+ };
@@ -0,0 +1,9 @@
1
+ import { useState as s, useRef as o } from "react";
2
+ import { useEvent as h } from "./use-event.js";
3
+ function p(r, t, a) {
4
+ let [i, d] = s(a), e = r !== void 0, n = o(e), u = o(!1), c = o(!1);
5
+ return e && !n.current && !u.current ? (u.current = !0, n.current = e, console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")) : !e && n.current && !c.current && (c.current = !0, n.current = e, console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")), [e ? r : i, h((l) => (e || d(l), t == null ? void 0 : t(l)))];
6
+ }
7
+ export {
8
+ p as useControllable
9
+ };
@@ -0,0 +1,8 @@
1
+ import { useState as u } from "react";
2
+ function a(t) {
3
+ let [e] = u(t);
4
+ return e;
5
+ }
6
+ export {
7
+ a as useDefaultValue
8
+ };
@@ -0,0 +1,9 @@
1
+ import { useState as e, useEffect as o } from "react";
2
+ import { disposables as t } from "../utils/disposables.js";
3
+ function i() {
4
+ let [s] = e(t);
5
+ return o(() => () => s.dispose(), [s]), s;
6
+ }
7
+ export {
8
+ i as useDisposables
9
+ };
@@ -0,0 +1,15 @@
1
+ import { useEffect as i } from "react";
2
+ import { useLatestValue as m } from "./use-latest-value.js";
3
+ function a(r, e, u, t) {
4
+ let o = m(u);
5
+ i(() => {
6
+ if (!r) return;
7
+ function n(s) {
8
+ o.current(s);
9
+ }
10
+ return document.addEventListener(e, n, t), () => document.removeEventListener(e, n, t);
11
+ }, [r, e, t]);
12
+ }
13
+ export {
14
+ a as useDocumentEvent
15
+ };
@@ -0,0 +1,20 @@
1
+ import { useReducer as u, useMemo as o } from "react";
2
+ import { useIsoMorphicEffect as s } from "./use-iso-morphic-effect.js";
3
+ function f(e) {
4
+ if (e === null) return { width: 0, height: 0 };
5
+ let { width: t, height: i } = e.getBoundingClientRect();
6
+ return { width: t, height: i };
7
+ }
8
+ function l(e, t = !1) {
9
+ let [i, h] = u(() => ({}), {}), r = o(() => f(e), [e, i]);
10
+ return s(() => {
11
+ if (!e) return;
12
+ let n = new ResizeObserver(h);
13
+ return n.observe(e), () => {
14
+ n.disconnect();
15
+ };
16
+ }, [e]), t ? { width: `${r.width}px`, height: `${r.height}px` } : r;
17
+ }
18
+ export {
19
+ l as useElementSize
20
+ };