Mixins / foldkit-mixins-ui

HoverIntent

namespace · packages/mixins-ui/src/hoverIntent.ts:1

export * as HoverIntent from './hoverIntent.js'

In the guides

Members

HoverIntent.HoverIntentSlots

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

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
  >
}>

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.

HoverIntent.resolve

function · packages/mixins-ui/src/hoverIntent.ts:28

function resolve<Input, Message>(
  render: RenderInfo,
  mixins: MixinList<Message>,
  context: ResolveContext<Input, Message>,
): ResolvedHoverIntent<Message>

Resolves the hover-intent render groups; isVisible passes through unchanged.

HoverIntent.ResolvedHoverIntent

type · packages/mixins-ui/src/hoverIntent.ts:25

type ResolvedHoverIntent<Message> = Resolved<
  RenderInfo,
  typeof HoverIntentSlots,
  Message
>

The hover intent's bundles with the attached Mixins applied.

HoverIntent.toView

function · packages/mixins-ui/src/hoverIntent.ts:35

function toView<Message>(
  mixins: MixinList<Message>,
  context: ResolveContext<unknown, Message>,
  draw: (resolved: ResolvedHoverIntent<Message>) => Html,
): (render: RenderInfo) => Html

The hover intent's toView: draw receives its bundles with mixins applied.