Mixins / foldkit-mixins-ui

Popover

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

export * as Popover from './popover.js'

Members

Popover.PopoverSlots

const · packages/mixins-ui/src/popover.ts:12

const PopoverSlots: Slots.Contract<{
  readonly button: Slot.UnnamedSlot<
    Capability.Capability<
      'Interactive',
      readonly [Capability.Capability<'Base', readonly []>]
    >,
    readonly [Event.EventToken<'click'>],
    readonly [
      Attr.AttrToken<'role'>,
      Attr.AttrToken<'aria-expanded'>,
      Attr.AttrToken<'aria-disabled'>,
      Attr.AttrToken<'disabled'>,
    ],
    readonly Slot.RequirementName[],
    boolean
  >
  readonly panel: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly [Event.EventToken<'blur'>],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
  readonly backdrop: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly [Event.EventToken<'click'>],
    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
  >
}>

Popover is a Submodel; every bundle is a ChildAttribute group. button owns click (and its pointer/keyboard handlers) while open; panel owns blur; backdrop owns click. The panel and backdrop bundles also carry the anchor and portal Mounts, preserved as opaque ChildAttributes.

Popover.resolve

function · packages/mixins-ui/src/popover.ts:27

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

Resolves the popover's render groups; isVisible passes through unchanged.

Popover.ResolvedPopover

type · packages/mixins-ui/src/popover.ts:24

type ResolvedPopover<Message> = Resolved<
  RenderInfo,
  typeof PopoverSlots,
  Message
>

The popover's bundles with the attached Mixins applied.

Popover.toView

function · packages/mixins-ui/src/popover.ts:34

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

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