Mixins / foldkit-mixins-ui

Empty

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

export * as Empty from './empty.js'

In the guides

Members

Empty.configure

function · packages/mixins-ui/src/empty.ts:63

function configure<const Names extends string = never>(
  config: Presets<EmptyPreset, Names>,
): {
  readonly view: <Outer>(
    options: EmptyView<Outer> & PresetOption<Names>,
    h: HtmlBuilder<Outer>,
  ) => Html
}

The application's own Empty: base for every use, presets chosen at a use, and the call over both.

Empty.EmptyPreset

type · packages/mixins-ui/src/empty.ts:60

type EmptyPreset = Pick<EmptyView<never>, 'style'> & {
  readonly mixins?: MixinList<never>
}

What an Empty is given once: its look.

Empty.EmptySlots

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

const EmptySlots: Slots.Contract<{
  readonly root: 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 icon: 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 title: 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 description: 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 action: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly Slot.EventName[],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
}>

An empty state publishes its regions as slots; it owns no state, messages, or bundles. It says what is not here, why that is fine (or what went wrong), and what creates the first one or tries again. The icon or illustration is drawing: the title says what it would.

Empty.EmptyView

interface · packages/mixins-ui/src/empty.ts:25

interface EmptyView<Message = never> {
  readonly title: string
  readonly description?: string | undefined
  readonly icon?: Html | undefined
  readonly action?: Html | undefined
  readonly style?: NamedStyle<typeof EmptySlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

An empty state in one call: the title it always has, the regions it earns, a style for its slots, and mixins beside the style. No upstream component stands behind it.

Empty.view

function · packages/mixins-ui/src/empty.ts:38

function view<Message = never>(
  options: EmptyView<Message>,
  h: HtmlBuilder<Message>,
): Html