ropav 0.1.6 → 0.1.7

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 (208) hide show
  1. package/README.md +6 -0
  2. package/dist/accordion.css +17 -17
  3. package/dist/accordion.js +123 -155
  4. package/dist/alert.css +18 -18
  5. package/dist/alert.js +10 -11
  6. package/dist/aria.js +14 -0
  7. package/dist/aspect-ratio.js +1 -1
  8. package/dist/attributes.js +9 -0
  9. package/dist/attributes2.js +29 -0
  10. package/dist/avatar.css +19 -19
  11. package/dist/avatar.js +9 -17
  12. package/dist/badge.css +16 -16
  13. package/dist/badge.js +5 -5
  14. package/dist/button-group.js +1 -1
  15. package/dist/button-link.js +4 -3
  16. package/dist/button.js +4 -3
  17. package/dist/button.scss_vue_type_style_index_0_src_true_lang.js +1 -1
  18. package/dist/card.js +1 -1
  19. package/dist/checkbox.css +32 -32
  20. package/dist/checkbox.js +22 -28
  21. package/dist/collapse.css +6 -6
  22. package/dist/collapse.js +7 -6
  23. package/dist/collectionNavigation.js +2 -99
  24. package/dist/color-input.css +19 -19
  25. package/dist/color-input.js +14 -13
  26. package/dist/color-picker.css +40 -40
  27. package/dist/color-picker.js +221 -200
  28. package/dist/color-picker2.js +1 -9
  29. package/dist/color-swatch.css +4 -4
  30. package/dist/color-swatch.js +6 -8
  31. package/dist/color.js +5 -10
  32. package/dist/componentColors.js +125 -84
  33. package/dist/componentRef.js +26 -0
  34. package/dist/components/accordion/accordionContext.d.ts +3 -0
  35. package/dist/components/accordion/accordionModel.d.ts +14 -0
  36. package/dist/components/accordion/index.d.ts +2 -1
  37. package/dist/components/accordion/index.js +1 -1
  38. package/dist/components/accordion/types.d.ts +1 -2
  39. package/dist/components/accordion/useAccordion.d.ts +2 -2
  40. package/dist/components/accordion/useAccordionItem.d.ts +2 -0
  41. package/dist/components/checkbox/useCheckbox.d.ts +1 -2
  42. package/dist/components/color-picker/index.js +2 -2
  43. package/dist/components/color-picker/types.d.ts +2 -2
  44. package/dist/components/color-picker/useColorPickerSaturation.d.ts +22 -0
  45. package/dist/components/color-picker/useColorPickerSlider.d.ts +20 -0
  46. package/dist/components/color-picker/useColorPickerValue.d.ts +1 -1
  47. package/dist/components/dialog/{dialog-core.d.ts → dialogContext.d.ts} +1 -5
  48. package/dist/components/dialog/useDialogContentInteractions.d.ts +18 -0
  49. package/dist/components/dialog/useDialogRootState.d.ts +19 -0
  50. package/dist/components/dropdown-menu/dropdown-menu-item-row.d.ts +1 -1
  51. package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +1 -1
  52. package/dist/components/dropdown-menu/dropdown-menu-model.d.ts +8 -0
  53. package/dist/components/dropdown-menu/dropdown-menu-root.d.ts +2 -2
  54. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +1 -1
  55. package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +1 -1
  56. package/dist/components/dropdown-menu/{dropdown-menu-primitive-core.d.ts → dropdownMenuContext.d.ts} +16 -18
  57. package/dist/components/dropdown-menu/dropdownMenuDataModel.d.ts +20 -0
  58. package/dist/components/dropdown-menu/dropdownMenuInteraction.d.ts +3 -0
  59. package/dist/components/dropdown-menu/dropdownMenuInteractionNavigation.d.ts +24 -0
  60. package/dist/components/dropdown-menu/dropdownMenuInteractionRegistry.d.ts +42 -0
  61. package/dist/components/dropdown-menu/dropdownMenuInteractionTypes.d.ts +85 -0
  62. package/dist/components/dropdown-menu/useDropdownMenu.d.ts +11 -11
  63. package/dist/components/dropdown-menu/useDropdownMenuContextTrigger.d.ts +9 -0
  64. package/dist/components/dropdown-menu/useDropdownMenuDataController.d.ts +34 -0
  65. package/dist/components/dropdown-menu/useDropdownMenuDataRegistration.d.ts +22 -0
  66. package/dist/components/dropdown-menu/useDropdownMenuHoverIntent.d.ts +6 -5
  67. package/dist/components/dropdown-menu/useDropdownMenuInteractionDismissal.d.ts +17 -0
  68. package/dist/components/dropdown-menu/useDropdownMenuInteractionKeyboard.d.ts +19 -0
  69. package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +0 -1
  70. package/dist/components/dropdown-menu/useDropdownMenuPresentation.d.ts +29 -0
  71. package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +2 -2
  72. package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +1 -1
  73. package/dist/components/dropdown-menu/useDropdownMenuTargetBindings.d.ts +19 -0
  74. package/dist/components/floating/hoverDisclosureInteractionModel.d.ts +42 -0
  75. package/dist/components/floating/index.js +1 -1
  76. package/dist/components/floating/useFloatingPosition.d.ts +0 -1
  77. package/dist/components/floating/useHoverDisclosureInteractions.d.ts +32 -0
  78. package/dist/components/floating/useHoverDisclosureOpenState.d.ts +25 -0
  79. package/dist/components/floating/useHoverDisclosureTargetBinding.d.ts +27 -0
  80. package/dist/components/number-input/numberInputModel.d.ts +15 -0
  81. package/dist/components/number-input/useNumberInput.d.ts +3 -17
  82. package/dist/components/pagination/index.d.ts +1 -1
  83. package/dist/components/pagination/index.js +1 -1
  84. package/dist/components/pagination/paginationModel.d.ts +4 -0
  85. package/dist/components/pagination/types.d.ts +15 -0
  86. package/dist/components/pagination/usePagination.d.ts +3 -19
  87. package/dist/components/popover/usePopoverBindings.d.ts +16 -0
  88. package/dist/components/progress/progressModel.d.ts +8 -0
  89. package/dist/components/progress/useProgress.d.ts +0 -6
  90. package/dist/components/radio/useRadio.d.ts +1 -2
  91. package/dist/components/scroll-area/scroll-area.d.ts +1 -1
  92. package/dist/components/scroll-area/scrollAreaModel.d.ts +64 -0
  93. package/dist/components/scroll-area/useScrollArea.d.ts +70 -53
  94. package/dist/components/scroll-area/{useScrollAreaPresentation.d.ts → useScrollAreaAttributes.d.ts} +37 -17
  95. package/dist/components/scroll-area/useScrollAreaDerivedState.d.ts +8 -0
  96. package/dist/components/scroll-area/useScrollAreaMeasurement.d.ts +35 -0
  97. package/dist/components/scroll-area/useScrollAreaPointer.d.ts +10 -8
  98. package/dist/components/scroll-area/useScrollAreaVisibility.d.ts +15 -20
  99. package/dist/components/slider/rangeSliderModel.d.ts +41 -0
  100. package/dist/components/slider/{sliderCore.d.ts → sliderModel.d.ts} +0 -1
  101. package/dist/components/slider/useRangeSlider.d.ts +8 -16
  102. package/dist/components/slider/useRangeSliderValueState.d.ts +40 -0
  103. package/dist/components/slider/useSlider.d.ts +7 -13
  104. package/dist/components/slider/useSliderPointerPreview.d.ts +22 -0
  105. package/dist/components/slider/useSliderTooltipState.d.ts +40 -0
  106. package/dist/components/slider/useSliderValueState.d.ts +33 -0
  107. package/dist/components/teleport-provider/index.js +1 -1
  108. package/dist/components/teleport-provider/useTeleportTarget.d.ts +1 -2
  109. package/dist/components/toast/useToastLifecycle.d.ts +19 -0
  110. package/dist/components/tooltip/useTooltip.d.ts +1 -2
  111. package/dist/css.js +12 -0
  112. package/dist/dialog.js +226 -218
  113. package/dist/dropdown-menu.js +1458 -1097
  114. package/dist/events.js +59 -0
  115. package/dist/field.css +8 -8
  116. package/dist/field.js +13 -25
  117. package/dist/floating.js +548 -319
  118. package/dist/floatingOffset.js +11 -0
  119. package/dist/focus-trap.js +7 -5
  120. package/dist/focusNavigation.js +37 -0
  121. package/dist/icon-button.css +8 -8
  122. package/dist/icon-button.js +7 -6
  123. package/dist/index.js +6 -6
  124. package/dist/input.css +24 -24
  125. package/dist/input.js +19 -31
  126. package/dist/interactive.js +18 -0
  127. package/dist/modal.js +1 -1
  128. package/dist/number-input.css +18 -18
  129. package/dist/number-input.js +14 -12
  130. package/dist/number.js +22 -0
  131. package/dist/overlay.js +3 -2
  132. package/dist/pagination.css +28 -28
  133. package/dist/pagination.js +65 -63
  134. package/dist/pointer.js +9 -0
  135. package/dist/popover.css +34 -34
  136. package/dist/popover.js +85 -86
  137. package/dist/progress.js +10 -13
  138. package/dist/query.js +40 -0
  139. package/dist/radio.css +18 -18
  140. package/dist/radio.js +30 -36
  141. package/dist/rafScheduler.js +34 -0
  142. package/dist/scroll-area.css +28 -28
  143. package/dist/scroll-area.js +512 -516
  144. package/dist/select.css +45 -45
  145. package/dist/select.js +36 -44
  146. package/dist/slider.css +191 -191
  147. package/dist/slider.js +691 -618
  148. package/dist/styles-api.d.ts +0 -1
  149. package/dist/styles-api.js +1 -4
  150. package/dist/switch.css +17 -17
  151. package/dist/switch.js +14 -15
  152. package/dist/tabs.css +43 -43
  153. package/dist/tabs.js +29 -56
  154. package/dist/text.js +17 -0
  155. package/dist/textarea.css +26 -26
  156. package/dist/textarea.js +21 -32
  157. package/dist/toast.css +26 -26
  158. package/dist/toast.js +141 -118
  159. package/dist/tooltip.css +12 -12
  160. package/dist/tooltip.js +36 -40
  161. package/dist/useCollapse.js +8 -11
  162. package/dist/useControlState.js +3 -6
  163. package/dist/useFloatingPosition.js +140 -10
  164. package/dist/useOverlayZIndex.js +1 -5
  165. package/dist/useTeleportTarget.js +3 -14
  166. package/dist/useTypeahead.js +94 -0
  167. package/dist/utils/aria.d.ts +3 -0
  168. package/dist/utils/attributes.d.ts +2 -0
  169. package/dist/utils/bem.d.ts +3 -0
  170. package/dist/utils/collectionNavigation.d.ts +2 -0
  171. package/dist/utils/color.d.ts +7 -0
  172. package/dist/{components/color-picker/color-picker-utils.d.ts → utils/colorPicker.d.ts} +5 -4
  173. package/dist/utils/componentColors.d.ts +7 -0
  174. package/dist/utils/css.d.ts +3 -0
  175. package/dist/utils/dom/ancestry.d.ts +7 -0
  176. package/dist/utils/dom/attributes.d.ts +16 -0
  177. package/dist/utils/dom/componentRef.d.ts +4 -0
  178. package/dist/utils/dom/events.d.ts +5 -0
  179. package/dist/utils/dom/focusNavigation.d.ts +7 -0
  180. package/dist/utils/dom/interactive.d.ts +2 -0
  181. package/dist/utils/dom/pointer.d.ts +2 -0
  182. package/dist/utils/dom/query.d.ts +4 -0
  183. package/dist/utils/dom/scroll.d.ts +23 -0
  184. package/dist/utils/floatingOffset.d.ts +10 -0
  185. package/dist/utils/geometry.d.ts +14 -0
  186. package/dist/utils/indexPath.d.ts +6 -0
  187. package/dist/utils/number.d.ts +4 -0
  188. package/dist/utils/rafScheduler.d.ts +4 -0
  189. package/dist/utils/text.d.ts +2 -0
  190. package/docs/code-architecture.md +118 -0
  191. package/docs/public-floating-api.md +6 -5
  192. package/package.json +13 -12
  193. package/dist/components/dropdown-menu/dropdown-menu-outside.d.ts +0 -3
  194. package/dist/components/dropdown-menu/dropdown-menu-utils.d.ts +0 -21
  195. package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +0 -36
  196. package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +0 -29
  197. package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +0 -52
  198. package/dist/components/dropdown-menu/useDropdownMenuNavigation.d.ts +0 -17
  199. package/dist/components/dropdown-menu/useDropdownSubmenus.d.ts +0 -18
  200. package/dist/components/scroll-area/scrollAreaCore.d.ts +0 -30
  201. package/dist/components/scroll-area/useScrollAreaControls.d.ts +0 -25
  202. package/dist/components/scroll-area/useScrollAreaMetrics.d.ts +0 -38
  203. /package/dist/components/alert/{useAlertColor.d.ts → alertColor.d.ts} +0 -0
  204. /package/dist/components/avatar/{useAvatarColor.d.ts → avatarColor.d.ts} +0 -0
  205. /package/dist/components/badge/{useBadgeColor.d.ts → badgeColor.d.ts} +0 -0
  206. /package/dist/components/button/{useButtonColor.d.ts → buttonColor.d.ts} +0 -0
  207. /package/dist/components/color-swatch/{useColorSwatchColor.d.ts → colorSwatchColor.d.ts} +0 -0
  208. /package/dist/components/toast/{useToastColor.d.ts → toastColor.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { OpenFocusTarget } from './dropdown-menu-primitive-core.js';
1
+ import { OpenFocusTarget } from './dropdownMenuContext.js';
2
2
  import { DropdownMenuSubPrimitiveProps } from './types.js';
3
3
  declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
4
  props: import('vue').PublicProps & __VLS_PrettifyLocal<DropdownMenuSubPrimitiveProps & {
@@ -1,42 +1,47 @@
1
- import { ComponentPublicInstance, ComputedRef, InjectionKey, Ref, VaporComponentInstance } from 'vue';
1
+ import { ComputedRef, InjectionKey, Ref } from 'vue';
2
2
  import { OverlayLayerContext } from '../../internal/composables/useOverlayLayer.js';
3
+ import { ComponentElementRef } from '../../utils/dom/componentRef.js';
3
4
  import { FloatingReference } from '../floating/types.js';
4
- import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuInteractOutsideEvent, DropdownMenuItemPrimitiveProps, DropdownMenuItemValue, DropdownMenuOpenOptions, DropdownMenuPlacement, DropdownMenuPoint, DropdownMenuSelectEvent, DropdownMenuVirtualAnchor } from './types.js';
5
+ import { DropdownMenuInteractionFocusTarget, DropdownMenuInteractionRuntime } from './dropdownMenuInteraction.js';
6
+ import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItemPrimitiveProps, DropdownMenuItemValue, DropdownMenuOpenOptions, DropdownMenuPlacement, DropdownMenuPoint, DropdownMenuSelectEvent, DropdownMenuVirtualAnchor } from './types.js';
5
7
  export type ElementReference = FloatingReference;
6
- export type OpenFocusTarget = DropdownMenuFocusTarget | false;
7
- export type ComponentRefValue = Element | ComponentPublicInstance | VaporComponentInstance | null;
8
+ export type OpenFocusTarget = DropdownMenuInteractionFocusTarget;
8
9
  export interface MenuItemRegistration {
9
10
  id: string;
10
11
  element: () => HTMLElement | null;
11
12
  textValue: () => string;
12
13
  disabled: () => boolean;
13
- activate: (event: Event) => void;
14
+ activate: (event: Event) => DropdownMenuSelectEvent | undefined;
15
+ closeOnSelect?: () => boolean;
14
16
  submenu?: DropdownMenuSubContext;
15
17
  }
16
18
  export interface DropdownMenuContext {
17
19
  root: DropdownMenuRootContext;
20
+ id: string;
18
21
  element: Ref<HTMLElement | null>;
19
- activeId: Ref<string | null>;
22
+ activeId: ComputedRef<string | null>;
20
23
  actualPlacement: Ref<DropdownMenuPlacement>;
21
24
  parentSub?: DropdownMenuSubContext;
22
25
  registerItem: (item: MenuItemRegistration) => void;
23
26
  unregisterItem: (id: string) => void;
24
- registerSub: (sub: DropdownMenuSubContext) => void;
25
- unregisterSub: (sub: DropdownMenuSubContext) => void;
26
27
  closeSubmenus: (except?: DropdownMenuSubContext) => void;
27
28
  setActive: (id: string) => void;
28
29
  isActive: (id: string) => boolean;
29
30
  focus: (target?: DropdownMenuFocusTarget) => boolean;
30
31
  focusElement: () => void;
32
+ activate: (id: string, event?: Event) => void;
33
+ hover: (id: string, openSubmenu?: boolean) => void;
31
34
  onKeydown: (event: KeyboardEvent) => void;
32
35
  }
33
36
  export interface DropdownMenuSubContext {
37
+ menuId: string;
34
38
  isOpen: ComputedRef<boolean>;
35
39
  trigger: Ref<HTMLElement | null>;
36
40
  contentId: Ref<string | undefined>;
37
41
  actualPlacement: Ref<DropdownMenuPlacement>;
38
42
  pendingFocus: Ref<OpenFocusTarget>;
39
43
  menu: DropdownMenuContext | null;
44
+ setOpen: (open: boolean) => void;
40
45
  open: (focus?: OpenFocusTarget) => void;
41
46
  close: (focusParent?: boolean) => void;
42
47
  }
@@ -51,6 +56,7 @@ export interface DropdownMenuRootContext {
51
56
  reference: ComputedRef<ElementReference | null>;
52
57
  pendingFocus: Ref<OpenFocusTarget>;
53
58
  layer: OverlayLayerContext;
59
+ interaction: DropdownMenuInteractionRuntime;
54
60
  open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
55
61
  close: (options?: DropdownMenuCloseOptions & {
56
62
  returnFocus?: boolean;
@@ -62,7 +68,6 @@ export interface DropdownMenuRootContext {
62
68
  setReturnFocus: (element: HTMLElement | null) => void;
63
69
  registerInside: (element: HTMLElement) => void;
64
70
  unregisterInside: (element: HTMLElement) => void;
65
- isInside: (event: Event) => boolean;
66
71
  }
67
72
  export interface DropdownMenuRadioGroupContext {
68
73
  value: ComputedRef<DropdownMenuItemValue | null>;
@@ -77,21 +82,14 @@ export declare const menuKey: InjectionKey<DropdownMenuContext>;
77
82
  export declare const subKey: InjectionKey<DropdownMenuSubContext>;
78
83
  export declare const radioGroupKey: InjectionKey<DropdownMenuRadioGroupContext>;
79
84
  export declare const checkedKey: InjectionKey<DropdownMenuCheckedContext>;
80
- export declare function optionalAttr<T extends boolean | string | undefined>(value: T): T | undefined;
81
- export declare function getFocusTarget(options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget): DropdownMenuFocusTarget;
82
- export declare function toHTMLElement(value: ComponentRefValue, fallbackId?: string): HTMLElement | null;
83
- export declare function resolveHTMLElementRef(value: ComponentRefValue, fallbackId: string, resolve: (element: HTMLElement | null) => void): void;
84
85
  export declare function createVirtualAnchor(point: DropdownMenuPoint): DropdownMenuVirtualAnchor;
85
- export declare function createCustomEvent<T>(type: string, detail: T, originalEvent: Event): CustomEvent<T>;
86
86
  export declare function createSelectEvent(originalEvent: Event, value?: DropdownMenuItemValue): DropdownMenuSelectEvent;
87
- export declare function createOutsideEvent(originalEvent: Event): DropdownMenuInteractOutsideEvent;
88
- export declare function blockNextDocumentClick(): void;
89
87
  export declare function createMenuContext(options: {
90
88
  root: DropdownMenuRootContext;
91
89
  element: Ref<HTMLElement | null>;
92
90
  actualPlacement: Ref<DropdownMenuPlacement>;
93
91
  parentSub?: DropdownMenuSubContext;
94
- onEscape: (event: KeyboardEvent) => void;
92
+ onEscape: (event: KeyboardEvent) => boolean;
95
93
  }): DropdownMenuContext;
96
94
  export declare function usePrimitiveItem(componentName: string, props: Readonly<DropdownMenuItemPrimitiveProps>, emitSelect: (event: DropdownMenuSelectEvent) => void, options: {
97
95
  checked?: ComputedRef<boolean | 'mixed'>;
@@ -106,6 +104,6 @@ export declare function usePrimitiveItem(componentName: string, props: Readonly<
106
104
  checked: ComputedRef<boolean | "mixed"> | undefined;
107
105
  activate: (originalEvent: Event) => void;
108
106
  select: () => void;
109
- setElement: (value: ComponentRefValue) => void;
107
+ setElement: (value: ComponentElementRef) => void;
110
108
  onPointerenter: () => void;
111
109
  };
@@ -0,0 +1,20 @@
1
+ import { ItemPath } from './dropdown-menu-model.js';
2
+ import { DropdownMenuItem } from './types.js';
3
+ export interface DropdownMenuDataEntry {
4
+ item: DropdownMenuItem;
5
+ path: ItemPath;
6
+ itemId: string;
7
+ ownerMenuId: string;
8
+ order: number;
9
+ submenuMenuId: string | undefined;
10
+ }
11
+ export interface DropdownMenuDataIndex {
12
+ entries: readonly DropdownMenuDataEntry[];
13
+ itemIdByPath: ReadonlyMap<string, string>;
14
+ pathByItemId: ReadonlyMap<string, ItemPath>;
15
+ menuIdByPath: ReadonlyMap<string, string>;
16
+ pathByMenuId: ReadonlyMap<string, ItemPath>;
17
+ primaryItemId: WeakMap<DropdownMenuItem, string>;
18
+ }
19
+ export declare function buildDropdownMenuDataIndex(items: readonly DropdownMenuItem[], rootMenuId: string, getStableItemId: (item: DropdownMenuItem) => string): DropdownMenuDataIndex;
20
+ export declare function getDropdownMenuDataCollectionState(items: readonly DropdownMenuItem[]): unknown[];
@@ -0,0 +1,3 @@
1
+ import { DropdownMenuInteractionHost, DropdownMenuInteractionRuntime } from './dropdownMenuInteractionTypes.js';
2
+ export type { DropdownMenuInteractionDismissalRegistration, DropdownMenuInteractionFocusTarget, DropdownMenuInteractionHost, DropdownMenuInteractionItemRegistration, DropdownMenuInteractionMenuRegistration, DropdownMenuInteractionMenuStateRegistration, DropdownMenuInteractionRuntime, } from './dropdownMenuInteractionTypes.js';
3
+ export declare function useDropdownMenuInteraction(host: DropdownMenuInteractionHost): DropdownMenuInteractionRuntime;
@@ -0,0 +1,24 @@
1
+ import { DropdownMenuCloseOptions, DropdownMenuFocusTarget } from './types.js';
2
+ import { DropdownMenuInteractionRegistry } from './dropdownMenuInteractionRegistry.js';
3
+ import { DropdownMenuInteractionFocusTarget, DropdownMenuInteractionHost } from './dropdownMenuInteractionTypes.js';
4
+ interface CreateDropdownMenuInteractionNavigationOptions {
5
+ host: DropdownMenuInteractionHost;
6
+ registry: DropdownMenuInteractionRegistry;
7
+ closeRoot: (options?: DropdownMenuCloseOptions & {
8
+ returnFocus?: boolean;
9
+ }) => void;
10
+ }
11
+ export declare function createDropdownMenuInteractionNavigation({ host, registry, closeRoot, }: CreateDropdownMenuInteractionNavigationOptions): {
12
+ closeMenu: (menuId: string, focusParent?: boolean) => boolean;
13
+ closeSubmenus: (menuId: string, exceptMenuId?: string) => void;
14
+ closeAllSubmenus: () => void;
15
+ focusMenu: (menuId: string, target?: DropdownMenuFocusTarget) => boolean;
16
+ openMenu: (menuId: string, focus?: DropdownMenuInteractionFocusTarget) => boolean;
17
+ selectItem: (id: string, originalEvent?: Event) => void;
18
+ activateItem: (id: string, originalEvent?: Event) => void;
19
+ hoverItem: (id: string, openSubmenu?: boolean) => void;
20
+ reconcile: (menuId?: string) => void;
21
+ reconcileOpenSubmenus: () => void;
22
+ };
23
+ export type DropdownMenuInteractionNavigation = ReturnType<typeof createDropdownMenuInteractionNavigation>;
24
+ export {};
@@ -0,0 +1,42 @@
1
+ import { DropdownMenuFocusTarget } from './types.js';
2
+ import { DropdownMenuInteractionFocusTarget, DropdownMenuInteractionHost, DropdownMenuInteractionItemRegistration, DropdownMenuInteractionMenuRegistration, DropdownMenuInteractionMenuStateRegistration } from './dropdownMenuInteractionTypes.js';
3
+ export interface DropdownMenuInteractionRegistryNavigation {
4
+ closeMenu: (menuId: string, focusParent?: boolean) => boolean;
5
+ closeSubmenus: (menuId: string, exceptMenuId?: string) => void;
6
+ focusMenu: (menuId: string, target?: DropdownMenuFocusTarget) => boolean;
7
+ reconcile: (menuId?: string) => void;
8
+ reconcileOpenSubmenus: () => void;
9
+ }
10
+ export declare function createDropdownMenuInteractionRegistry(host: DropdownMenuInteractionHost, navigation: DropdownMenuInteractionRegistryNavigation): {
11
+ activeItemId: import('vue').Ref<string | null, string | null>;
12
+ activeMenuId: import('vue').Ref<string, string>;
13
+ pendingRootFocus: import('vue').Ref<DropdownMenuInteractionFocusTarget, DropdownMenuInteractionFocusTarget>;
14
+ registerMenu: (registration: DropdownMenuInteractionMenuRegistration) => () => void;
15
+ unregisterMenu: (id: string) => void;
16
+ registerMenuState: (registration: DropdownMenuInteractionMenuStateRegistration) => () => void;
17
+ registerItem: (registration: DropdownMenuInteractionItemRegistration) => () => void;
18
+ unregisterItem: (id: string) => void;
19
+ getActiveId: (menuId: string) => import('vue').ComputedRef<string | null>;
20
+ getItem: (id: string) => DropdownMenuInteractionItemRegistration | undefined;
21
+ getMenu: (id: string) => DropdownMenuInteractionMenuRegistration | undefined;
22
+ isActive: (id: string) => boolean;
23
+ isMenuOpen: (menuId: string) => boolean;
24
+ setActive: (id: string | null, focusElement?: boolean) => boolean;
25
+ focusMenuElement: (menuId: string) => void;
26
+ state: {
27
+ getMenuState: (id: string) => DropdownMenuInteractionMenuStateRegistration | undefined;
28
+ getItems: (menuId: string) => DropdownMenuInteractionItemRegistration[];
29
+ getEnabledItems: (menuId: string) => DropdownMenuInteractionItemRegistration[];
30
+ getActiveIdValue: (menuId: string) => string | null;
31
+ clearMenuState: (menuId: string) => void;
32
+ getParentItem: (menuId: string) => DropdownMenuInteractionItemRegistration | undefined;
33
+ setMenuOpen: (menuId: string, open: boolean) => void;
34
+ chooseNeighbor: (menuId: string, previousIndex: number) => void;
35
+ getMenuIds: () => Set<string>;
36
+ getRegisteredMenuIds: () => string[];
37
+ getPendingMenuFocus: (menuId: string) => DropdownMenuInteractionFocusTarget | undefined;
38
+ setPendingMenuFocus: (menuId: string, focus: DropdownMenuInteractionFocusTarget) => Map<string, DropdownMenuInteractionFocusTarget>;
39
+ clearPendingMenuFocus: (menuId: string) => boolean;
40
+ };
41
+ };
42
+ export type DropdownMenuInteractionRegistry = ReturnType<typeof createDropdownMenuInteractionRegistry>;
@@ -0,0 +1,85 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuInteractOutsideEvent, DropdownMenuInteractOutsideTarget, DropdownMenuOpenOptions, DropdownMenuPlacement, DropdownMenuSelectEvent } from './types.js';
3
+ export type DropdownMenuInteractionFocusTarget = DropdownMenuFocusTarget | false;
4
+ export interface DropdownMenuInteractionMenuRegistration {
5
+ id: string;
6
+ parentItemId?: () => string | undefined;
7
+ element: () => HTMLElement | null;
8
+ focusTarget?: () => HTMLElement | null;
9
+ placement: () => DropdownMenuPlacement;
10
+ isOpen: () => boolean;
11
+ setOpen?: (open: boolean) => void;
12
+ stopKeyPropagation?: boolean;
13
+ onEscape?: (event: KeyboardEvent) => boolean;
14
+ }
15
+ export interface DropdownMenuInteractionMenuStateRegistration {
16
+ id: string;
17
+ isOpen: () => boolean;
18
+ setOpen: (open: boolean) => void;
19
+ }
20
+ export interface DropdownMenuInteractionItemRegistration {
21
+ id: string;
22
+ menuId: string;
23
+ element: () => HTMLElement | null;
24
+ textValue: () => string;
25
+ disabled: () => boolean;
26
+ order?: () => number;
27
+ submenuId?: () => string | undefined;
28
+ submenuDirection?: () => 'left' | 'right';
29
+ select?: (originalEvent: Event) => DropdownMenuSelectEvent | undefined;
30
+ closeOnSelect?: () => boolean;
31
+ }
32
+ export interface DropdownMenuInteractionDismissalRegistration {
33
+ ignoredTargets: () => readonly DropdownMenuInteractOutsideTarget[];
34
+ pointerDownOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
35
+ focusOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
36
+ interactOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
37
+ }
38
+ export interface DropdownMenuInteractionHost {
39
+ rootMenuId: string;
40
+ isOpen: Readonly<Ref<boolean>>;
41
+ disabled: Readonly<Ref<boolean>>;
42
+ modal: Readonly<Ref<boolean>>;
43
+ setOpen: (open: boolean) => void;
44
+ isTopLayer: () => boolean;
45
+ focusTrigger: () => void;
46
+ beforeOpen?: () => void;
47
+ beforeClose?: () => void;
48
+ }
49
+ export interface DropdownMenuInteractionRuntime {
50
+ rootMenuId: string;
51
+ activeItemId: Readonly<Ref<string | null>>;
52
+ activeMenuId: Readonly<Ref<string>>;
53
+ pendingRootFocus: Ref<DropdownMenuInteractionFocusTarget>;
54
+ registerMenu: (registration: DropdownMenuInteractionMenuRegistration) => () => void;
55
+ unregisterMenu: (id: string) => void;
56
+ registerMenuState: (registration: DropdownMenuInteractionMenuStateRegistration) => () => void;
57
+ registerItem: (registration: DropdownMenuInteractionItemRegistration) => () => void;
58
+ unregisterItem: (id: string) => void;
59
+ registerInside: (element: Element) => void;
60
+ unregisterInside: (element: Element) => void;
61
+ registerDismissal: (registration: DropdownMenuInteractionDismissalRegistration) => () => void;
62
+ getActiveId: (menuId: string) => ComputedRef<string | null>;
63
+ getItem: (id: string) => DropdownMenuInteractionItemRegistration | undefined;
64
+ getMenu: (id: string) => DropdownMenuInteractionMenuRegistration | undefined;
65
+ isActive: (id: string) => boolean;
66
+ isMenuOpen: (menuId: string) => boolean;
67
+ setActive: (id: string | null, focusElement?: boolean) => boolean;
68
+ focusMenu: (menuId: string, target?: DropdownMenuFocusTarget) => boolean;
69
+ focusMenuElement: (menuId: string) => void;
70
+ open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
71
+ close: (options?: DropdownMenuCloseOptions & {
72
+ returnFocus?: boolean;
73
+ }) => void;
74
+ toggle: () => void;
75
+ openMenu: (menuId: string, focus?: DropdownMenuInteractionFocusTarget) => boolean;
76
+ closeMenu: (menuId: string, focusParent?: boolean) => boolean;
77
+ closeSubmenus: (menuId: string, exceptMenuId?: string) => void;
78
+ selectItem: (id: string, originalEvent?: Event) => void;
79
+ activateItem: (id: string, originalEvent?: Event) => void;
80
+ hoverItem: (id: string, openSubmenu?: boolean) => void;
81
+ reconcile: (menuId?: string) => void;
82
+ onTriggerClick: (beforeToggle?: () => void) => void;
83
+ onTriggerKeydown: (event: KeyboardEvent, beforeOpen?: () => void) => void;
84
+ onMenuKeydown: (menuId: string, event: KeyboardEvent) => void;
85
+ }
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from 'vue';
2
- import { DropdownMenuContentProps, DropdownMenuInteractOutsideEvent, DropdownMenuItem, DropdownMenuProps, DropdownMenuSelectEvent, DropdownMenuSlotProps, DropdownMenuTriggerProps } from './types.js';
2
+ import { DropdownMenuCloseOptions, DropdownMenuInteractOutsideEvent, DropdownMenuItem, DropdownMenuProps, DropdownMenuSelectEvent } from './types.js';
3
3
  export declare function useDropdownMenu(props: Readonly<DropdownMenuProps>, emit?: {
4
4
  openChange?: (open: boolean) => void;
5
5
  select?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
@@ -17,7 +17,7 @@ export declare function useDropdownMenu(props: Readonly<DropdownMenuProps>, emit
17
17
  renderedItems: import('vue').ComputedRef<import('./types.js').DropdownMenuRenderedItem[]>;
18
18
  renderContext: import('./useDropdownMenuRenderItems.js').DropdownMenuRenderContext;
19
19
  focusedIndex: import('vue').ComputedRef<number>;
20
- focusedPath: import('vue').Ref<number[], number[] | import('./types.js').DropdownMenuItemPath>;
20
+ focusedPath: import('vue').Ref<import('./types.js').DropdownMenuItemPath, import('./types.js').DropdownMenuItemPath>;
21
21
  activeDescendantId: import('vue').ComputedRef<string | undefined>;
22
22
  rootClass: import('vue').ComputedRef<string[]>;
23
23
  contentClass: import('vue').ComputedRef<string[]>;
@@ -28,18 +28,18 @@ export declare function useDropdownMenu(props: Readonly<DropdownMenuProps>, emit
28
28
  isTargetMode: import('vue').ComputedRef<boolean>;
29
29
  teleportTo: import('vue').ComputedRef<import('../floating/index.js').TeleportTargetValue>;
30
30
  shouldTeleport: import('vue').ComputedRef<boolean>;
31
- triggerProps: import('vue').ComputedRef<DropdownMenuTriggerProps>;
32
- contentProps: import('vue').ComputedRef<DropdownMenuContentProps>;
33
- slotProps: import('vue').ComputedRef<DropdownMenuSlotProps>;
31
+ triggerProps: import('vue').ComputedRef<import('./types.js').DropdownMenuTriggerProps>;
32
+ contentProps: import('vue').ComputedRef<import('./types.js').DropdownMenuContentProps>;
33
+ slotProps: import('vue').ComputedRef<import('./types.js').DropdownMenuSlotProps>;
34
34
  open: (options?: import('./types.js').DropdownMenuOpenOptions | import('./types.js').DropdownMenuFocusTarget) => void;
35
- close: (options?: import('./types.js').DropdownMenuCloseOptions) => void;
35
+ close: (options?: DropdownMenuCloseOptions) => void;
36
36
  toggle: () => void;
37
37
  selectItem: (item: DropdownMenuItem, originalEvent?: Event) => void;
38
- openSubmenu: (path: import('./dropdown-menu-utils.js').ItemPath, focus?: import('./dropdown-menu-utils.js').SubmenuFocusTarget, point?: import('./dropdown-menu-utils.js').PointerPoint) => boolean;
39
- closeSubmenu: (path: import('./dropdown-menu-utils.js').ItemPath) => boolean;
40
- onItemMouseenter: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils.js').ItemPath, event?: MouseEvent) => void;
38
+ openSubmenu: (path: import('./dropdown-menu-model.js').ItemPath, focus?: import('./dropdown-menu-model.js').SubmenuFocusTarget, point?: import('../../utils/geometry.js').Point) => boolean;
39
+ closeSubmenu: (path: import('./dropdown-menu-model.js').ItemPath) => boolean;
40
+ onItemMouseenter: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-model.js').ItemPath, event?: MouseEvent) => void;
41
41
  onTriggerKeydown: (event: KeyboardEvent) => void;
42
42
  onMenuKeydown: (event: KeyboardEvent) => void;
43
- getItemProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils.js').ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => import('./types.js').DropdownMenuItemProps;
44
- getItemSlotProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-utils.js').ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => import('./types.js').DropdownMenuItemSlotProps;
43
+ getItemProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-model.js').ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => import('./types.js').DropdownMenuItemProps;
44
+ getItemSlotProps: (item: DropdownMenuItem, indexOrPath: number | import('./dropdown-menu-model.js').ItemPath, focused?: boolean, disabled?: boolean, submenuOpen?: boolean) => import('./types.js').DropdownMenuItemSlotProps;
45
45
  };
@@ -0,0 +1,9 @@
1
+ import { ComponentElementRef } from '../../utils/dom/componentRef.js';
2
+ import { DropdownMenuContextTriggerPrimitiveProps } from './types.js';
3
+ export declare function useDropdownMenuContextTrigger(props: Readonly<DropdownMenuContextTriggerPrimitiveProps>): {
4
+ isOpen: import('vue').ComputedRef<boolean>;
5
+ rootAttrs: import('vue').ComputedRef<{
6
+ [x: string]: unknown;
7
+ }>;
8
+ setElement: (value: ComponentElementRef) => void;
9
+ };
@@ -0,0 +1,34 @@
1
+ import { Ref } from 'vue';
2
+ import { Point } from '../../utils/geometry.js';
3
+ import { ItemPath, SubmenuFocusTarget } from './dropdown-menu-model.js';
4
+ import { DropdownMenuInteractionRuntime } from './dropdownMenuInteraction.js';
5
+ import { DropdownMenuItem, DropdownMenuPlacement, DropdownMenuProps, DropdownMenuSelectEvent } from './types.js';
6
+ interface UseDropdownMenuDataControllerOptions {
7
+ props: Readonly<DropdownMenuProps>;
8
+ items: Readonly<Ref<DropdownMenuItem[]>>;
9
+ rootMenuId: string;
10
+ menuId: Readonly<Ref<string>>;
11
+ menuRef: Readonly<Ref<HTMLElement | null>>;
12
+ actualPlacement: Readonly<Ref<DropdownMenuPlacement>>;
13
+ interaction: DropdownMenuInteractionRuntime;
14
+ onSelect?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
15
+ }
16
+ export declare function useDropdownMenuDataController({ props, items, rootMenuId, menuId, menuRef, actualPlacement, interaction, onSelect, }: UseDropdownMenuDataControllerOptions): {
17
+ focusedPath: Ref<import('./types.js').DropdownMenuItemPath, import('./types.js').DropdownMenuItemPath>;
18
+ focusedIndex: import('vue').ComputedRef<number>;
19
+ activeDescendantId: import('vue').ComputedRef<string | undefined>;
20
+ getItemId: (path: ItemPath) => string;
21
+ getSubmenuId: (path: ItemPath) => string;
22
+ getItemElement: (path: ItemPath) => HTMLElement | null;
23
+ getMenuActiveDescendant: (path: ItemPath) => string | undefined;
24
+ isItemFocused: (indexOrPath: number | ItemPath) => boolean;
25
+ isSubmenuOpen: (path: ItemPath) => boolean;
26
+ openSubmenu: (path: ItemPath, focus?: SubmenuFocusTarget, point?: Point) => boolean;
27
+ closeSubmenu: (path: ItemPath) => boolean;
28
+ focusHoveredItem: (item: DropdownMenuItem, indexOrPath: number | ItemPath, event?: MouseEvent) => void;
29
+ onMenuMousemove: (event: MouseEvent) => void;
30
+ resetHoverIntent: () => void;
31
+ selectItem: (item: DropdownMenuItem, originalEvent?: Event) => void;
32
+ activateItem: (_item: DropdownMenuItem, path: ItemPath, event?: MouseEvent | KeyboardEvent) => void;
33
+ };
34
+ export {};
@@ -0,0 +1,22 @@
1
+ import { Ref } from 'vue';
2
+ import { DropdownMenuDataIndex } from './dropdownMenuDataModel.js';
3
+ import { DropdownMenuInteractionRuntime } from './dropdownMenuInteraction.js';
4
+ import { DropdownMenuItem, DropdownMenuProps, DropdownMenuSelectEvent } from './types.js';
5
+ import { ItemPath } from './dropdown-menu-model.js';
6
+ type DropdownMenuDataInteraction = Pick<DropdownMenuInteractionRuntime, 'reconcile' | 'registerItem' | 'registerMenu' | 'unregisterItem' | 'unregisterMenu'>;
7
+ interface UseDropdownMenuDataRegistrationOptions {
8
+ props: Readonly<DropdownMenuProps>;
9
+ items: Readonly<Ref<DropdownMenuItem[]>>;
10
+ rootMenuId: string;
11
+ interaction: DropdownMenuDataInteraction;
12
+ menuRef: Readonly<Ref<HTMLElement | null>>;
13
+ getItemElement: (path: ItemPath) => HTMLElement | null;
14
+ getSubmenuElement: (path: ItemPath) => HTMLElement | null;
15
+ isSubmenuOpeningLeft: (path: ItemPath) => boolean;
16
+ onSelect?: (item: DropdownMenuItem, event: DropdownMenuSelectEvent) => void;
17
+ }
18
+ export declare function useDropdownMenuDataRegistration({ props, items, rootMenuId, interaction, menuRef, getItemElement, getSubmenuElement, isSubmenuOpeningLeft, onSelect, }: UseDropdownMenuDataRegistrationOptions): {
19
+ openMenuIds: Ref<Set<string> & Omit<Set<string>, keyof Set<any>>, Set<string> | (Set<string> & Omit<Set<string>, keyof Set<any>>)>;
20
+ registrationIndex: import('vue').ShallowRef<DropdownMenuDataIndex, DropdownMenuDataIndex>;
21
+ };
22
+ export {};
@@ -1,13 +1,14 @@
1
1
  import { Ref } from 'vue';
2
+ import { Point, Triangle } from '../../utils/geometry.js';
3
+ import { ItemPath } from './dropdown-menu-model.js';
2
4
  import { DropdownMenuItem } from './types.js';
3
- import { ItemPath, PointerPoint } from './dropdown-menu-utils.js';
4
- export type SafeTriangle = [PointerPoint, PointerPoint, PointerPoint];
5
+ export type SafeTriangle = Triangle;
5
6
  type GetSafeTriangleOptions = {
6
7
  itemRect: DOMRect | null;
7
8
  submenuRect: DOMRect;
8
- origin: PointerPoint;
9
+ origin: Point;
9
10
  };
10
- type HoverCommit = (item: DropdownMenuItem, path: ItemPath, point?: PointerPoint) => void;
11
+ type HoverCommit = (item: DropdownMenuItem, path: ItemPath, point?: Point) => void;
11
12
  type UseDropdownMenuHoverIntentOptions = {
12
13
  openSubmenuPath: Ref<ItemPath>;
13
14
  getItemElement: (path: ItemPath) => HTMLElement | null;
@@ -17,7 +18,7 @@ export declare function getDropdownMenuSafeTriangle({ itemRect, submenuRect, ori
17
18
  export declare function useDropdownMenuHoverIntent({ openSubmenuPath, getItemElement, getSubmenuElement, }: UseDropdownMenuHoverIntentOptions): {
18
19
  clearPendingHover: () => void;
19
20
  resetHoverIntent: () => void;
20
- trackSubmenuOpen: (path: ItemPath, point?: PointerPoint) => void;
21
+ trackSubmenuOpen: (path: ItemPath, point?: Point) => void;
21
22
  handleItemHover: (item: DropdownMenuItem, path: ItemPath, event: MouseEvent | undefined, commit: HoverCommit) => void;
22
23
  handleMenuMousemove: (event: MouseEvent, commit: HoverCommit) => void;
23
24
  };
@@ -0,0 +1,17 @@
1
+ import { DropdownMenuCloseOptions } from './types.js';
2
+ import { DropdownMenuInteractionRegistry } from './dropdownMenuInteractionRegistry.js';
3
+ import { DropdownMenuInteractionDismissalRegistration, DropdownMenuInteractionHost } from './dropdownMenuInteractionTypes.js';
4
+ type DropdownMenuDismissalRegistry = Pick<DropdownMenuInteractionRegistry, 'activeMenuId' | 'focusMenuElement'>;
5
+ interface UseDropdownMenuInteractionDismissalOptions {
6
+ host: DropdownMenuInteractionHost;
7
+ registry: DropdownMenuDismissalRegistry;
8
+ closeRoot: (options?: DropdownMenuCloseOptions & {
9
+ returnFocus?: boolean;
10
+ }) => void;
11
+ }
12
+ export declare function useDropdownMenuInteractionDismissal({ host, registry, closeRoot, }: UseDropdownMenuInteractionDismissalOptions): {
13
+ registerInside: (element: Element) => void;
14
+ unregisterInside: (element: Element) => void;
15
+ registerDismissal: (registration: DropdownMenuInteractionDismissalRegistration) => () => void;
16
+ };
17
+ export {};
@@ -0,0 +1,19 @@
1
+ import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuOpenOptions } from './types.js';
2
+ import { DropdownMenuInteractionNavigation } from './dropdownMenuInteractionNavigation.js';
3
+ import { DropdownMenuInteractionRegistry } from './dropdownMenuInteractionRegistry.js';
4
+ import { DropdownMenuInteractionHost } from './dropdownMenuInteractionTypes.js';
5
+ interface UseDropdownMenuInteractionKeyboardOptions {
6
+ host: DropdownMenuInteractionHost;
7
+ registry: DropdownMenuInteractionRegistry;
8
+ navigation: DropdownMenuInteractionNavigation;
9
+ openRoot: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
10
+ closeRoot: (options?: DropdownMenuCloseOptions & {
11
+ returnFocus?: boolean;
12
+ }) => void;
13
+ }
14
+ export declare function useDropdownMenuInteractionKeyboard({ host, registry, navigation, openRoot, closeRoot, }: UseDropdownMenuInteractionKeyboardOptions): {
15
+ onMenuKeydown: (menuId: string, event: KeyboardEvent) => void;
16
+ onTriggerKeydown: (event: KeyboardEvent, beforeOpen?: () => void) => void;
17
+ resetTypeahead: () => void;
18
+ };
19
+ export {};
@@ -10,7 +10,6 @@ export declare function useDropdownMenuPortalPosition(options: {
10
10
  arrowRef: Ref<HTMLElement | null>;
11
11
  isVisible: BooleanSource;
12
12
  placement: PlacementSource;
13
- restartKey: () => unknown;
14
13
  }): {
15
14
  actualPlacement: Readonly<Ref<import('../floating/index.js').FloatingPlacement, import('../floating/index.js').FloatingPlacement>>;
16
15
  arrowStyle: Readonly<Ref<import('vue').CSSProperties | undefined, import('vue').CSSProperties | undefined>>;
@@ -0,0 +1,29 @@
1
+ import { Ref } from 'vue';
2
+ import { DropdownMenuInteractionRuntime } from './dropdownMenuInteraction.js';
3
+ import { DropdownMenuCloseOptions, DropdownMenuContentProps, DropdownMenuFocusTarget, DropdownMenuOpenOptions, DropdownMenuPlacement, DropdownMenuProps, DropdownMenuSlotProps, DropdownMenuTriggerProps } from './types.js';
4
+ interface UseDropdownMenuPresentationOptions {
5
+ props: Readonly<DropdownMenuProps>;
6
+ rootMenuId: string;
7
+ menuId: Readonly<Ref<string>>;
8
+ isDisabled: Readonly<Ref<boolean>>;
9
+ isVisible: Readonly<Ref<boolean>>;
10
+ isExplicitTarget: Readonly<Ref<boolean>>;
11
+ actualPlacement: Readonly<Ref<DropdownMenuPlacement>>;
12
+ contentHasSubmenu: Readonly<Ref<boolean>>;
13
+ activeDescendantId: Readonly<Ref<string | undefined>>;
14
+ interaction: DropdownMenuInteractionRuntime;
15
+ resetHoverIntent: () => void;
16
+ onMenuMousemove: (event: MouseEvent) => void;
17
+ open: (options?: DropdownMenuOpenOptions | DropdownMenuFocusTarget) => void;
18
+ close: (options?: DropdownMenuCloseOptions) => void;
19
+ toggle: () => void;
20
+ }
21
+ export declare function useDropdownMenuPresentation({ props, rootMenuId, menuId, isDisabled, isVisible, isExplicitTarget, actualPlacement, contentHasSubmenu, activeDescendantId, interaction, resetHoverIntent, onMenuMousemove, open, close, toggle, }: UseDropdownMenuPresentationOptions): {
22
+ rootClass: import('vue').ComputedRef<string[]>;
23
+ contentClass: import('vue').ComputedRef<string[]>;
24
+ triggerProps: import('vue').ComputedRef<DropdownMenuTriggerProps>;
25
+ contentProps: import('vue').ComputedRef<DropdownMenuContentProps>;
26
+ slotProps: import('vue').ComputedRef<DropdownMenuSlotProps>;
27
+ onMenuKeydown: (event: KeyboardEvent) => void;
28
+ };
29
+ export {};
@@ -1,4 +1,4 @@
1
- import { ComponentRefValue } from './dropdown-menu-primitive-core.js';
1
+ import { ComponentElementRef } from '../../utils/dom/componentRef.js';
2
2
  import { DropdownMenuContentPrimitiveProps, DropdownMenuInteractOutsideEvent, DropdownMenuPlacement } from './types.js';
3
3
  type ContentProps = Readonly<DropdownMenuContentPrimitiveProps>;
4
4
  type ContentEvents = {
@@ -21,7 +21,7 @@ export declare function useDropdownMenuPrimitiveContent(props: ContentProps, att
21
21
  [x: string]: unknown;
22
22
  }>;
23
23
  floating: import('../floating/index.js').UseFloatingPositionReturn;
24
- setElement: (value: ComponentRefValue) => void;
24
+ setElement: (value: ComponentElementRef) => void;
25
25
  close: () => void;
26
26
  };
27
27
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Ref } from 'vue';
2
2
  import { StylesApiPartOptions } from '../../styles-api.js';
3
3
  import { DropdownMenuCloseOptions, DropdownMenuFocusTarget, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuItemSlotProps, DropdownMenuRenderedItem, DropdownMenuPlacement, DropdownMenuPart, DropdownMenuProps, DropdownMenuSubmenuProps } from './types.js';
4
- import { ItemPath } from './dropdown-menu-utils.js';
4
+ import { ItemPath } from './dropdown-menu-model.js';
5
5
  type DropdownMenuItemsSource = {
6
6
  readonly value: DropdownMenuItem[];
7
7
  };
@@ -0,0 +1,19 @@
1
+ import { Ref } from 'vue';
2
+ import { DropdownMenuInteractOutsideEvent, DropdownMenuInteractOutsideTarget } from './types.js';
3
+ import { DropdownMenuInteractionRuntime } from './dropdownMenuInteraction.js';
4
+ interface UseDropdownMenuTargetBindingsOptions {
5
+ interaction: DropdownMenuInteractionRuntime;
6
+ rootRef: Readonly<Ref<HTMLElement | null>>;
7
+ menuRef: Readonly<Ref<HTMLElement | null>>;
8
+ targetElement: Readonly<Ref<Element | null>>;
9
+ isExplicitTarget: Readonly<Ref<boolean>>;
10
+ menuId: Readonly<Ref<string>>;
11
+ isVisible: Readonly<Ref<boolean>>;
12
+ isDisabled: Readonly<Ref<boolean>>;
13
+ ignoredTargets: () => readonly DropdownMenuInteractOutsideTarget[];
14
+ pointerDownOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
15
+ focusOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
16
+ interactOutside?: (event: DropdownMenuInteractOutsideEvent) => void;
17
+ }
18
+ export declare function useDropdownMenuTargetBindings({ interaction, rootRef, menuRef, targetElement, isExplicitTarget, menuId, isVisible, isDisabled, ignoredTargets, pointerDownOutside, focusOutside, interactOutside, }: UseDropdownMenuTargetBindingsOptions): void;
19
+ export {};
@@ -0,0 +1,42 @@
1
+ export type HoverDisclosureInteractionPart = 'trigger' | 'content';
2
+ export interface HoverDisclosureInteractionState {
3
+ contentFocused: boolean;
4
+ contentHovered: boolean;
5
+ touchClickPending: boolean;
6
+ touchPinned: boolean;
7
+ touchPointerActive: boolean;
8
+ triggerFocused: boolean;
9
+ triggerHovered: boolean;
10
+ }
11
+ export type HoverDisclosureInteractionAction = {
12
+ type: 'hover';
13
+ part: HoverDisclosureInteractionPart;
14
+ active: boolean;
15
+ } | {
16
+ type: 'focus';
17
+ part: HoverDisclosureInteractionPart;
18
+ active: boolean;
19
+ } | {
20
+ type: 'pointer-down';
21
+ touch: boolean;
22
+ } | {
23
+ type: 'pointer-up';
24
+ touch: boolean;
25
+ } | {
26
+ type: 'pointer-cancel';
27
+ } | {
28
+ type: 'consume-touch-click';
29
+ } | {
30
+ type: 'set-touch-pinned';
31
+ pinned: boolean;
32
+ } | {
33
+ type: 'reset';
34
+ part: HoverDisclosureInteractionPart | 'all';
35
+ };
36
+ export interface HoverDisclosureInteractionModel {
37
+ read: () => Readonly<HoverDisclosureInteractionState>;
38
+ send: (action: HoverDisclosureInteractionAction) => Readonly<HoverDisclosureInteractionState>;
39
+ }
40
+ export declare function createHoverDisclosureInteractionModel(): HoverDisclosureInteractionModel;
41
+ export declare function hasActiveHoverDisclosureInteraction(state: Readonly<HoverDisclosureInteractionState>): boolean;
42
+ export declare function reduceHoverDisclosureInteraction(state: Readonly<HoverDisclosureInteractionState>, action: HoverDisclosureInteractionAction): HoverDisclosureInteractionState;
@@ -1,3 +1,3 @@
1
- import { n as useFloatingPosition } from "../../useFloatingPosition.js";
1
+ import { t as useFloatingPosition } from "../../useFloatingPosition.js";
2
2
  import { t as useHoverDisclosure } from "../../floating.js";
3
3
  export { useFloatingPosition, useHoverDisclosure };
@@ -3,7 +3,6 @@ import { FloatingReference, FloatingTarget, UseFloatingPositionOptions, UseFloat
3
3
  type Source<T> = () => T;
4
4
  export declare function readFloatingTarget(target: FloatingTarget | null | undefined): string | FloatingReference | null | undefined;
5
5
  export declare function isVirtualReference(value: unknown): value is FloatingReference;
6
- export declare function isElementReference(value: unknown): value is Element;
7
6
  export declare function resolveFloatingTarget(target: string | FloatingReference | null | undefined): FloatingReference | null;
8
7
  export declare function useFloatingTarget(getTarget: Source<FloatingTarget | null | undefined>, fallback: Readonly<Ref<Element | null>>): {
9
8
  isExplicitTarget: import('vue').ComputedRef<boolean>;