UNPKG

@zag-js/avatar

Version:

Core logic for the avatar widget implemented as a state machine

14 lines (13 loc) 424 B
// src/avatar.dom.ts var getRootId = (ctx) => ctx.ids?.root ?? `avatar:${ctx.id}`; var getImageId = (ctx) => ctx.ids?.image ?? `avatar:${ctx.id}:image`; var getFallbackId = (ctx) => ctx.ids?.fallback ?? `avatar:${ctx.id}:fallback`; var getRootEl = (ctx) => ctx.getById(getRootId(ctx)); var getImageEl = (ctx) => ctx.getById(getImageId(ctx)); export { getFallbackId, getImageEl, getImageId, getRootEl, getRootId };