Mixins / foldkit-mixins-ui

HoverIntentSlots

const · packages/mixins-ui/src/hoverIntent.ts:22

const HoverIntentSlots: Slots.Contract<{
  readonly trigger: Slot.UnnamedSlot<
    Capability.Capability<
      'Interactive',
      readonly [Capability.Capability<'Base', readonly []>]
    >,
    readonly [
      Event.EventToken<'hover'>,
      Event.EventToken<'focus'>,
      Event.EventToken<'blur'>,
    ],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
  readonly panel: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly [
      Event.EventToken<'hover'>,
      Event.EventToken<'focus'>,
      Event.EventToken<'blur'>,
    ],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
  readonly arrow: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly Slot.EventName[],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
}>

HoverIntent is a Submodel: open and close delays with intent, for a hover card or a menu that should not flicker. Both bundles are ChildAttribute groups: trigger owns the pointer and focus entry points, panel owns its own so moving into the panel keeps it open. resolve preserves each group by identity.

Upstream's HoverIntent places nothing. Given anchored, resolve places the panel against the trigger itself, as a hover card does: the panel shows in the browser's top layer and the anchor positions it there, and arrow, drawn as the panel's child, points at the trigger. The trigger then carries aria-expanded, and aria-describedby the panel while it is open. Escape closes the card from the trigger or the panel while either has focus.