Mixins / foldkit-mixins-ui

TooltipSlots

const · packages/mixins-ui/src/tooltip.ts:20

const TooltipSlots: Slots.Contract<{
  readonly trigger: Slot.UnnamedSlot<
    Capability.Capability<
      'Interactive',
      readonly [Capability.Capability<'Base', readonly []>]
    >,
    readonly [
      Event.EventToken<'focus'>,
      Event.EventToken<'blur'>,
      Event.EventToken<'pointerdown'>,
    ],
    readonly [
      Attr.AttrToken<'role'>,
      Attr.AttrToken<'aria-disabled'>,
      Attr.AttrToken<'disabled'>,
    ],
    readonly Slot.RequirementName[],
    boolean
  >
  readonly layer: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly Slot.EventName[],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
  readonly panel: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly Slot.EventName[],
    readonly [Attr.AttrToken<'role'>],
    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
  >
}>

Tooltip is a Submodel; both upstream bundles are ChildAttribute groups. trigger owns focus, blur and pointerdown (the hover/keyboard entry points); panel carries the anchor Mount. resolve preserves each group by identity.

layer and arrow are this package's. layer, drawn around the panel, shows it in the browser's top layer (Anchor.layer); draw the panel without a portal (portal: false, as anchor gives). arrow, drawn as the panel's child, points at the trigger: upstream's tooltip anchor computes no arrow, so Anchor.PlaceArrow places it.

In the guides