@dxos/react-ui-card 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -451,15 +451,17 @@ var Row = {
451
451
  * Callers supply the inner `Card.Header`/`Card.Body` (typically via {@link CardTileHeader} + rows).
452
452
  * Activation is committed by the caller's `onCurrentChange` (Mosaic `current`/selection), so click/Enter light the tile up.
453
453
  */
454
- var CardTileRoot = forwardRef(({ id, data, location, current, onCurrentChange, onClick, classNames, children, "data-testid": testId }, forwardedRef) => /* @__PURE__ */ jsx(Mosaic.Tile, {
454
+ var CardTileRoot = forwardRef(({ id, data, location, current, binding, onCurrentChange, onClick, classNames, children, "data-testid": testId }, forwardedRef) => /* @__PURE__ */ jsx(Mosaic.Tile, {
455
455
  asChild: true,
456
456
  id,
457
457
  data,
458
458
  location,
459
+ binding,
459
460
  classNames: classNames ?? "dx-hover dx-current dx-selected p-1 rounded-md",
460
461
  children: /* @__PURE__ */ jsx(Focus.Item, {
461
462
  asChild: true,
462
463
  current,
464
+ selected: binding?.["aria-selected"],
463
465
  onCurrentChange,
464
466
  children: /* @__PURE__ */ jsx(Card.Root, {
465
467
  grid: true,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["toHue"],"sources":["../../src/util.ts","../../src/components/Avatar/avatar-name.ts","../../src/components/Avatar/Avatar.tsx","../../src/components/Avatar/ObjectAvatar.tsx","../../src/hooks/useActorContact.ts","../../src/components/Row/Row.tsx","../../src/components/CardTile/CardTile.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n/** Deterministic string hash (djb2), used to map a name to a stable avatar hue. */\nexport const hashString = (str?: string): number =>\n str ? Math.abs(str.split('').reduce((hash, char) => (hash << 5) + hash + char.charCodeAt(0), 0)) : 0;\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Actor } from '@dxos/types';\nimport { toHue } from '@dxos/util';\n\nimport { hashString } from '../../util.ts';\n\n// Kept out of `Avatar.tsx`: react-refresh only fast-refreshes a module whose\n// exports are all components, so values exported beside them force a full page reload on\n// every edit.\n\n/** Canonical display name for an actor — the avatar glyph fallback and the hue key are both derived from it. */\nexport const avatarName = (actor?: Actor.Actor): string =>\n actor?.contact?.target?.fullName ?? actor?.name ?? actor?.email ?? '';\n\n/** Single source for a name→hue mapping, so the same sender is one color across every surface. */\nexport const nameToHue = (name?: string): string => toHue(hashString(name));\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DxAvatar, type DxAvatarProps } from '@dxos/lit-ui/react';\nimport { type Actor } from '@dxos/types';\n\nimport { avatarName } from './avatar-name.ts';\nimport { nameToHue } from './avatar-name.ts';\n\nexport type AvatarProps = Pick<DxAvatarProps, 'variant' | 'size' | 'onClick'> & {\n /** Sender/participant; supplies the display name and the hue. */\n actor?: Actor.Actor;\n /** Label override; defaults to the actor's {@link avatarName}. */\n name?: string;\n};\n\n/**\n * Sender/participant avatar with one shared name→hue derivation ({@link nameToHue}) so a given\n * person renders the same color across the mailbox list, the opened thread, and preview cards —\n * previously each site hand-rolled `DxAvatar` off a different input.\n */\nexport const Avatar = ({ actor, name, variant = 'circle', size = 6, onClick }: AvatarProps) => {\n const label = name ?? avatarName(actor);\n return (\n <DxAvatar\n hue={nameToHue(label)}\n hueVariant='surface'\n variant={variant}\n size={size}\n fallback={label}\n onClick={onClick}\n />\n );\n};\n\nAvatar.displayName = 'Avatar';\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Entity, Obj } from '@dxos/echo';\nimport { useLabel, useObject } from '@dxos/echo-react';\nimport { DxAvatar, type DxAvatarProps } from '@dxos/lit-ui/react';\nimport * as Icon from '@dxos/react-ui/Icon';\nimport { getStyles } from '@dxos/ui-theme';\n\nimport { nameToHue } from './avatar-name.ts';\n\n/**\n * Conventional field holding an object's picture, as a URL.\n *\n * A convention rather than an annotation because it is already one across the types that have a\n * picture at all: `Person.image` and `Organization.image` are both an optional URL string, written\n * by `CrmOperation.EnrichImages` (Gravatar / logo service, re-hosted). Promote it to an annotation\n * when a type needs to name a different field — nothing does yet, and an annotation nobody varies is\n * indirection without a payer.\n */\nconst IMAGE_PROPERTY = 'image';\n\nconst asImage = (value: unknown): string | undefined =>\n typeof value === 'string' && value.length > 0 ? value : undefined;\n\nconst isLiveObject = (value: unknown): value is Obj.Unknown & { readonly [IMAGE_PROPERTY]?: unknown } =>\n Obj.isObject(value);\n\n/** The object's picture URL, or `undefined` when it has none. */\nexport const getObjectImage = (entity: Entity.Unknown | Entity.Snapshot): string | undefined =>\n asImage(Reflect.get(entity, IMAGE_PROPERTY));\n\nexport type ObjectAvatarProps = Pick<DxAvatarProps, 'variant' | 'size' | 'onClick'> & {\n /** Any ECHO object — the avatar is derived entirely from it. */\n object: Entity.Unknown | Entity.Snapshot;\n /** Fallback glyph when the object has neither a picture nor a label. */\n fallbackIcon?: string;\n /** False when the host already shows the picture nearby (e.g., a card body), so the avatar keeps to initials. */\n showImage?: boolean;\n};\n\n/**\n * An object depicted as itself: its picture, else its initials, else its type glyph.\n *\n * This is the treatment for objects whose identity IS the point — a person, an organization — so it\n * is opted into per type through `AppSurface.CardIcon` rather than applied to everything. A\n * directory of cards is scanned by kind, and giving every object a per-instance disc would trade\n * that away; the type glyph stays the default.\n */\nexport const ObjectAvatar = ({\n object,\n variant = 'circle',\n size = 6,\n fallbackIcon,\n showImage = true,\n onClick,\n}: ObjectAvatarProps) => {\n const live = isLiveObject(object) ? object : undefined;\n const [liveImage] = useObject(live, IMAGE_PROPERTY);\n const image = showImage ? (live ? asImage(liveImage) : getObjectImage(object)) : undefined;\n const label = useLabel(object);\n const iconAnnotation = Entity.getIcon(object);\n\n // No picture and no label leaves initials with nothing to derive from, so the type's own glyph is\n // the only honest thing left — a blank disc would read as a failed image rather than as an object\n // that has never been named.\n if (!image && !label) {\n const icon = fallbackIcon ?? iconAnnotation?.icon ?? 'ph--circle-dashed--regular';\n return <Icon.Icon icon={icon} classNames={iconAnnotation?.hue ? getStyles(iconAnnotation.hue).text : undefined} />;\n }\n\n return (\n <DxAvatar\n // From the label, not the type: a type declaring one hue (`Person` and `Organization` both\n // declare `neutral`) would put every instance on the same disc, which is exactly what initials\n // exist to prevent. The derivation is pure, so one object keeps its colour everywhere.\n hue={nameToHue(label ?? '')}\n hueVariant='surface'\n variant={variant}\n size={size}\n imgSrc={image}\n fallback={label ?? ''}\n onClick={onClick}\n />\n );\n};\n\nObjectAvatar.displayName = 'ObjectAvatar';\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type Database, Filter, Obj } from '@dxos/echo';\nimport { useQuery } from '@dxos/echo-react';\nimport { EID } from '@dxos/keys';\nimport { type Actor, Person } from '@dxos/types';\n\n// TODO(burdon): Factor out lazy update pattern.\nexport const useActorContact = (db?: Database.Database, actor?: Actor.Actor): EID.EID | undefined => {\n // Don't bother querying the space if there is already a reference to the contact.\n const isLinked = !!actor?.contact;\n const contacts = useQuery(isLinked ? undefined : db, Filter.type(Person.Person));\n const existingContact = useMemo(\n () => contacts.find((contact) => contact.emails?.find((email) => email.value === actor?.email)),\n [contacts, actor?.email],\n );\n\n return useMemo(\n () =>\n actor?.contact\n ? EID.tryParse(actor.contact.uri)\n : existingContact\n ? EID.parse(Obj.getURI(existingContact))\n : undefined,\n [actor?.contact, existingContact],\n );\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { format, intervalToDuration } from 'date-fns';\nimport React, { type KeyboardEvent, type MouseEvent, useCallback, useEffect, useRef } from 'react';\n\nimport { type Database, Obj } from '@dxos/echo';\nimport { useLabel } from '@dxos/echo-react';\nimport { EID, type URI } from '@dxos/keys';\nimport * as Button from '@dxos/react-ui/Button';\nimport * as Card from '@dxos/react-ui/Card';\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport * as Icon from '@dxos/react-ui/Icon';\nimport * as SystemButton from '@dxos/react-ui/SystemButton';\nimport * as Tag from '@dxos/react-ui/Tag';\nimport { type Actor, type Message } from '@dxos/types';\nimport { mx, toHue } from '@dxos/ui-theme';\nimport { DxAnchorActivate } from '@dxos/ui-types';\n\nimport { translationKey } from '#translations';\n\nimport { useActorContact } from '../../hooks/index.ts';\nimport { Avatar, type AvatarProps, avatarName } from '../Avatar/index.ts';\n\n/**\n * Shared Card-row primitives rendered inside a `Card.Body`. These are the single source for the\n * person/date/tags/ref/star rows used across the inbox tiles (`EventStack`/`InboxStack`), the preview\n * cards (`EventCard`/`MessageCard`), and the article headers — so a row of each kind is defined exactly\n * once and every surface composes from it.\n */\n\n//\n// Card activation — internal helpers, not exported on Row.\n//\n\n/**\n * Opens an ECHO object's preview card, anchored on `trigger`. The card surface listens for\n * `DxAnchorActivate` (see `EditorMenuProvider`), so this is the same path a `dx-anchor` link takes.\n */\nconst activateCard = ({\n trigger,\n eid,\n label,\n title,\n}: {\n trigger: HTMLElement | null;\n eid: URI.URI;\n label: string;\n title?: string;\n}) => {\n trigger?.dispatchEvent(new DxAnchorActivate({ trigger, eid: eid.toString(), label, kind: 'card', title }));\n};\n\n/**\n * Delay before a hover opens a card. Long enough that crossing the avatar on the way somewhere else\n * does not fire it, short enough to feel like a hover rather than a wait.\n */\nconst HOVER_CARD_DELAY = 400;\n\n/**\n * Hover intent for a card-opening trigger: `start` opens after {@link HOVER_CARD_DELAY}, `cancel`\n * aborts a pending open. Returned as bare callbacks rather than DOM props so a caller can compose\n * them with its own pointer handlers.\n */\n/**\n * Arms a delayed `open` on hover, cancelling on unmount AND whenever the target changes.\n *\n * Exported for its regression test: the cancellation-on-target-change is a dependency-array property,\n * not extractable logic, so it can only be pinned by rendering the hook.\n */\nexport const useCardHover = (open: () => void, enabled: boolean) => {\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n const cancel = useCallback(() => {\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, []);\n\n const start = useCallback(() => {\n if (!enabled) {\n return;\n }\n cancel();\n timeoutRef.current = setTimeout(() => {\n timeoutRef.current = undefined;\n open();\n }, HOVER_CARD_DELAY);\n }, [enabled, cancel, open]);\n\n // Cancels on unmount AND whenever the target changes: `cancel` is stable, so depending on it alone\n // let a timer armed for the previous contact fire the stale `open` after the row was recycled or\n // re-pointed at another actor.\n useEffect(() => cancel, [cancel, open, enabled]);\n\n return { start, cancel };\n};\n\n//\n// AnchorIconButton — internal helper, not exported on Row.\n//\n\ntype AnchorIconButtonProps = {\n compact?: boolean;\n icon: string;\n fallbackIcon?: string;\n label: string;\n fallbackLabel?: string;\n title?: string;\n value?: URI.URI;\n /** Also open the card on hover (never the `onClick` fallback — hovering must not create anything). */\n hover?: boolean;\n onClick?: () => void;\n};\n\n/**\n * Icon-only button that opens an ECHO object's preview card via `DxAnchorActivate`.\n * Falls back to `onClick` when `value` is absent.\n */\nconst AnchorIconButton = ({\n compact,\n icon,\n fallbackIcon,\n label,\n fallbackLabel,\n title,\n value,\n hover,\n onClick,\n}: AnchorIconButtonProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const openCard = useCallback(() => {\n if (value) {\n activateCard({ trigger: buttonRef.current, eid: value, label, title });\n }\n }, [value, label, title]);\n const { start: startHover, cancel: cancelHover } = useCardHover(openCard, !!hover && !!value);\n\n const handleClick = useCallback(() => {\n if (value) {\n openCard();\n } else {\n onClick?.();\n }\n }, [value, openCard, onClick]);\n\n return (\n <Button.Root\n onPointerEnter={startHover}\n onPointerLeave={cancelHover}\n classNames={compact ? 'min-h-0' : 'aspect-square'}\n variant='ghost'\n disabled={!value && !onClick}\n icon={value ? icon : (fallbackIcon ?? icon)}\n iconOnly\n label={value ? label : (fallbackLabel ?? label)}\n onClick={handleClick}\n ref={buttonRef}\n />\n );\n};\n\n//\n// Date\n//\n\ntype RowDateProps = {\n start: Date;\n end?: Date;\n};\n\n/** A Card.Row rendering a date or date range with a calendar icon. */\nconst RowDate = ({ start, end }: RowDateProps) => {\n let { hours = 0, minutes = 0 } = (end && intervalToDuration({ start, end })) ?? {};\n // Prefer 90m over 1h 30m.\n if (hours === 1 && minutes !== 0) {\n hours = 0;\n minutes += 60;\n }\n const duration = [hours > 0 && `${hours}h`, minutes > 0 && `${minutes}m`].filter(Boolean).join(' ');\n\n return (\n <Card.Row icon='ph--calendar--regular'>\n <div className='flex items-center gap-2 overflow-hidden whitespace-nowrap'>\n <div className='truncate text-fg-muted'>{format(start, 'PPp')}</div>\n {duration.length > 0 && <div className='text-fg-muted text-xs'>({duration})</div>}\n </div>\n </Card.Row>\n );\n};\n\nRowDate.displayName = 'Row.Date';\n\n//\n// Ref\n//\n\ntype RowRefProps = {\n object: Obj.Any;\n};\n\n/** A Card.Row rendering an ECHO ref/relation with a card-preview anchor icon. */\nconst RowRef = ({ object }: RowRefProps) => {\n const label = useLabel(object, { fallback: 'typename' }) ?? 'object';\n const icon = Obj.getIcon(object)?.icon ?? 'ph--cube--regular';\n const echoUri = EID.tryParse(Obj.getURI(object).toString());\n\n // TODO(burdon): Nav?\n return (\n <Card.Row leading={<AnchorIconButton icon={icon} label={label} title={label} value={echoUri} />}>\n <div className='flex items-center'>\n <span className='truncate text-primary-text'>{label}</span>\n </div>\n </Card.Row>\n );\n};\n\nRowRef.displayName = 'Row.Ref';\n\n//\n// Person\n//\n\n/** Recipient/participant kind; drives the leading icon and accessible label. */\nexport type PersonRole = 'from' | 'to' | 'cc' | 'bcc' | 'attendee';\n\ntype RowPersonProps = {\n actor: Actor.Actor;\n /** Recipient/participant kind (aria only; no visible prefix). */\n role?: PersonRole;\n /**\n * Resolving the actor's contact costs a query hook, so passing `db` is what opts a row into the\n * interactive avatar (hover card / create contact). Omit it in virtualized list tiles, which get the\n * hook-free static avatar instead — or give them {@link RowPersonProps.getContact}.\n */\n db?: Database.Database;\n /**\n * Pre-resolved contact lookup, for a LIST that resolves every row's contact from one query of its\n * own: passing this makes the row interactive without the per-row hook `db` implies. Returning\n * `undefined` means \"no contact\" (the create affordance), not \"unknown yet\".\n */\n getContact?: (actor: Actor.Actor) => EID.EID | undefined;\n /** Avatar size: 6 for a dense list row (the default), 9 for a message tile's own header. */\n size?: AvatarProps['size'];\n onContactCreate?: (actor: Actor.Actor) => void;\n /** Render a trailing remove button (e.g. attendee rows in the editable event header). */\n onRemove?: () => void;\n /** Click handler for the avatar (e.g. select the message). */\n onClick?: (event: MouseEvent) => void;\n};\n\n/**\n * Static avatar variant — no contact resolution. Suitable for virtualized list tiles.\n */\nconst PersonAvatarRow = ({ actor, size, onClick }: Pick<RowPersonProps, 'actor' | 'size' | 'onClick'>) => (\n <Card.Row leading={<Avatar actor={actor} size={size} onClick={onClick} />}>\n <Card.Text>{avatarName(actor) || actor.email}</Card.Text>\n </Card.Row>\n);\n\n/**\n * Interactive variant: the gutter always shows the actor's AVATAR, and resolving their contact decides\n * what hovering it does — a Person opens that contact's card, no Person swaps the avatar for a\n * create-contact button (a click, never the hover, since hovering must not write to the space).\n *\n * Uniform across every surface that shows people, so a sender, a recipient and an attendee all read\n * the same. Separate from {@link PersonAvatarRow} only because resolving a contact costs a query hook\n * per row: a virtualized list keeps the static variant.\n */\nexport type ContactAvatarProps = Pick<\n RowPersonProps,\n 'actor' | 'role' | 'db' | 'getContact' | 'size' | 'onContactCreate'\n> & {\n onClick?: (event: MouseEvent) => void;\n};\n\n/**\n * The actor's avatar, wired to their contact: hovering opens that Person's card, and when the space\n * has no Person for the address the avatar gives way to a create-contact button (a click, never the\n * hover, since hovering must not write to the space).\n *\n * Exported because the same treatment belongs to every surface showing a person — `Row.Person`'s\n * gutter, but also list tiles that lay their rows out themselves.\n */\nexport const ContactAvatar = ({\n actor,\n role,\n db,\n getContact,\n size = 5,\n onContactCreate,\n onClick,\n}: ContactAvatarProps) => {\n const { t } = Hooks.useTranslation(translationKey);\n // Unconditional hook, but a `getContact` caller passes no `db`, so it runs no query.\n const resolved = useActorContact(getContact ? undefined : db, actor);\n const contactDXN = getContact ? getContact(actor) : resolved;\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const openCard = useCallback(() => {\n if (contactDXN) {\n activateCard({\n trigger: anchorRef.current,\n eid: contactDXN,\n label: t('show-contact.label'),\n title: role ? `${role}: ${actor.name ?? actor.email}` : (actor.name ?? actor.email),\n });\n }\n }, [contactDXN, t, role, actor.name, actor.email]);\n const { start: startHover, cancel: cancelHover } = useCardHover(openCard, !!contactDXN);\n\n const handleContactCreate = useCallback(() => onContactCreate?.(actor), [actor, onContactCreate]);\n\n // Both are always mounted when a contact can be created: swapping them on hover dropped focus the\n // instant a keyboard user reached the button, and mounting it only on hover kept it out of the tab\n // order entirely. The avatar fades out instead, so the gutter width never changes.\n const canCreate = !contactDXN && !!onContactCreate;\n\n return (\n <div\n ref={anchorRef}\n // Pointer only when hovering does something: a resolved contact opens its card.\n className={mx('relative grid place-items-center group/contact', contactDXN && 'cursor-pointer')}\n data-testid='row.contact-avatar'\n onPointerEnter={startHover}\n onPointerLeave={cancelHover}\n >\n {/* Faded (not unmounted) while the create button covers it, so the gutter never resizes. */}\n {/* `grid`, not the default block: `dx-avatar` is `display: contents` and the frame inside it is\n `inline-flex`, so in a block box it sits on the text baseline and the line box adds descender\n space beneath it — making this wrapper taller than the avatar and pinning the face to its top.\n Every caller that centres this against a line of text then reads as misaligned. */}\n <div className={mx('grid', canCreate && 'group-hover/contact:opacity-0 group-focus-within/contact:opacity-0')}>\n <Avatar actor={actor} size={size} onClick={onClick} />\n </div>\n {canCreate && (\n <Button.Root\n variant='ghost'\n iconOnly\n icon='ph--user-circle-plus--regular'\n // One step below the avatar it replaces, so the button reads as an affordance rather than\n // as a heavier stand-in for the face.\n iconSize={Number(size) >= 8 ? 'lg' : 'md'}\n label={t('create-contact.label')}\n classNames='dx-cover opacity-0 group-hover/contact:opacity-100 focus-visible:opacity-100'\n onClick={handleContactCreate}\n />\n )}\n </div>\n );\n};\n\nContactAvatar.displayName = 'ContactAvatar';\n\nconst PersonContactRow = ({\n actor,\n role,\n db,\n getContact,\n size,\n onContactCreate,\n onRemove,\n onClick,\n}: RowPersonProps) => {\n const { t } = Hooks.useTranslation(translationKey);\n\n return (\n <Card.Row\n leading={\n <ContactAvatar\n actor={actor}\n role={role}\n db={db}\n getContact={getContact}\n size={size}\n onContactCreate={onContactCreate}\n onClick={onClick}\n />\n }\n trailing={\n onRemove && (\n <Button.Root\n variant='ghost'\n iconOnly\n icon='ph--x--regular'\n label={t('remove-attendee.label')}\n onClick={onRemove}\n />\n )\n }\n >\n <Card.Text>{avatarName(actor) || actor.email}</Card.Text>\n </Card.Row>\n );\n};\n\n/** A Card.Row rendering a person (sender, recipient, attendee). */\nconst RowPerson = ({ onClick, ...props }: RowPersonProps) =>\n props.db || props.getContact ? (\n <PersonContactRow {...props} onClick={onClick} />\n ) : (\n <PersonAvatarRow actor={props.actor} size={props.size} onClick={onClick} />\n );\n\nRowPerson.displayName = 'Row.Person';\n\n//\n// Tags\n//\n\ntype TagItem = { id: string; label?: string; hue?: string };\n\ntype RowTagsProps = {\n /** Optional — callers may pass an undefined/empty list (e.g. a message with no tags). */\n tags?: TagItem[];\n /** When provided, each chip is clickable and stops event propagation. */\n onTagClick?: (label: string) => void;\n};\n\n/** A Card.Row rendering a set of label+hue tag chips, optionally clickable. */\nconst RowTags = ({ tags, onTagClick }: RowTagsProps) => {\n if (!tags?.length) {\n return null;\n }\n\n return (\n <Card.Row icon='ph--tag--regular'>\n <div className='flex flex-wrap gap-1 py-1' data-testid='extracted-tags'>\n {tags.map((tag) => (\n <Tag.Tag\n key={tag.id}\n hue={toHue(tag.hue)}\n data-testid={`message-tag-${tag.id}`}\n onClick={\n onTagClick\n ? (event) => {\n event.stopPropagation();\n onTagClick(tag.label ?? tag.id);\n }\n : undefined\n }\n >\n {tag.label ?? tag.id}\n </Tag.Tag>\n ))}\n </div>\n </Card.Row>\n );\n};\n\nRowTags.displayName = 'Row.Tags';\n\n//\n// Star\n//\n\ntype RowStarProps = {\n starred?: boolean;\n /** Toggle handler; the button renders only when provided. */\n onToggle?: () => void;\n};\n\n/**\n * Star toggle for a `Card.Block` leading gutter (shared by event/message tiles and headers). Stops\n * the click from bubbling so starring doesn't also select/activate the surrounding tile or card.\n */\nconst RowStar = ({ starred, onToggle }: RowStarProps) => {\n const handleClick = useCallback<NonNullable<Button.RootProps['onClick']>>(\n (event) => {\n event.stopPropagation();\n onToggle?.();\n },\n [onToggle],\n );\n\n if (!onToggle) {\n return null;\n }\n\n return <SystemButton.Star iconOnly variant='ghost' pressed={starred} onClick={handleClick} />;\n};\n\nRowStar.displayName = 'Row.Star';\n\n//\n// Attachments\n//\n\ntype RowAttachmentsProps = {\n /** Optional — callers may pass an undefined/empty list (e.g. a message with no attachments). */\n attachments?: readonly Message.Attachment[];\n /**\n * Opens an attachment, by its index in `attachments`. The index rather than the attachment itself\n * because an attachment has no identity of its own — it is an entry on the message.\n */\n onAttachmentClick?: (index: number) => void;\n};\n\n/** A Card.Row listing a message's attachments by name; each chip opens its attachment when clickable. */\nconst RowAttachments = ({ attachments, onAttachmentClick }: RowAttachmentsProps) => {\n if (!attachments?.length) {\n return null;\n }\n\n return (\n <Card.Row icon='ph--paperclip--regular'>\n <div className='flex flex-wrap gap-1 py-1' data-testid='message-attachments'>\n {attachments.map((attachment, index) => (\n <Tag.Tag\n key={attachment.ref.uri}\n hue='neutral'\n classNames={mx('inline-flex items-center gap-1', onAttachmentClick && 'cursor-pointer')}\n // `Tag` renders a span, so a bare `onClick` would be mouse-only. `role`/`tabIndex` plus the\n // key handler give it the button semantics it needs to be reachable from the keyboard.\n {...(onAttachmentClick && {\n role: 'button',\n tabIndex: 0,\n onClick: (event: MouseEvent) => {\n // The row sits inside a tile that also handles clicks; opening an attachment must not\n // also select the message behind it.\n event.stopPropagation();\n onAttachmentClick(index);\n },\n onKeyDown: (event: KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n onAttachmentClick(index);\n }\n },\n })}\n >\n <Icon.Icon icon='ph--file--regular' size='xs' />\n {attachment.name ?? attachment.ref.uri}\n </Tag.Tag>\n ))}\n </div>\n </Card.Row>\n );\n};\n\nRowAttachments.displayName = 'Row.Attachments';\n\n//\n// Row\n//\n\nexport const Row = {\n Date: RowDate,\n Ref: RowRef,\n Person: RowPerson,\n Tags: RowTags,\n Star: RowStar,\n Attachments: RowAttachments,\n};\n\nexport type { RowAttachmentsProps, RowDateProps, RowPersonProps, RowRefProps, RowStarProps, RowTagsProps };\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type MouseEvent, PropsWithChildren, type ReactNode, forwardRef } from 'react';\n\nimport { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';\nimport * as Card from '@dxos/react-ui/Card';\nimport * as Focus from '@dxos/react-ui/Focus';\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport * as Layout from '@dxos/react-ui/Layout';\nimport * as Menu from '@dxos/react-ui/Menu';\nimport type * as Util from '@dxos/react-ui/Util';\nimport { osTranslations } from '@dxos/ui-theme';\n\nimport { Row } from '../Row/index.ts';\n\n//\n// Root\n//\n\ntype CardTileRootProps = Util.ThemedClassName<\n PropsWithChildren<\n Pick<MosaicTileProps<unknown>, 'data' | 'location' | 'current'> & {\n 'id': string;\n 'onCurrentChange': () => void;\n 'onClick'?: (event: MouseEvent) => void;\n 'data-testid'?: string;\n }\n >\n>;\n\n/**\n * Shared mosaic tile shell: `Mosaic.Tile` → `Focus.Item` → `Card.Root`. The card is a `grid` card, so every\n * header and row puts its leading cell (star, unread mark, avatar) in the start rail and its text on one\n * content edge.\n * Callers supply the inner `Card.Header`/`Card.Body` (typically via {@link CardTileHeader} + rows).\n * Activation is committed by the caller's `onCurrentChange` (Mosaic `current`/selection), so click/Enter light the tile up.\n */\nconst CardTileRoot = forwardRef<HTMLDivElement, CardTileRootProps>(\n (\n { id, data, location, current, onCurrentChange, onClick, classNames, children, 'data-testid': testId },\n forwardedRef,\n ) => (\n <Mosaic.Tile\n asChild\n id={id}\n data={data}\n location={location}\n classNames={classNames ?? 'dx-hover dx-current dx-selected p-1 rounded-md'}\n >\n <Focus.Item asChild current={current} onCurrentChange={onCurrentChange}>\n <Card.Root grid border={false} onClick={onClick} ref={forwardedRef} data-testid={testId} data-focus-click=''>\n {children}\n </Card.Root>\n </Focus.Item>\n </Mosaic.Tile>\n ),\n);\n\nCardTileRoot.displayName = 'CardTile.Root';\n\n//\n// Header\n//\n\n/** A single `Card.Menu` dropdown item. */\nexport type CardTileMenuItem = {\n label: string;\n icon?: string;\n onClick: () => void;\n};\n\ntype CardTileHeaderProps = {\n /** Header title content (rendered in a flex row). */\n title: ReactNode;\n /** Start-rail content in place of the star (e.g. an unread mark). */\n leading?: ReactNode;\n /** Whether the tile is starred. `Row.Star` renders the button only when `onToggleStar` is set. */\n starred?: boolean;\n /** Render the trailing `Card.Menu` action slot. */\n menu?: boolean;\n /** Items for the `Card.Menu` dropdown (the trigger is disabled when empty). */\n menuItems?: CardTileMenuItem[];\n onToggleStar?: () => void;\n};\n\n/**\n * Tile header row: leading `Row.Star` · title · optional `Card.Menu`. Shared by message/conversation\n * tiles (with menu) and event tiles (star + title only).\n */\nconst CardTileHeader = ({ title, leading, starred, menu = false, menuItems, onToggleStar }: CardTileHeaderProps) => {\n const { t } = Hooks.useTranslation(osTranslations);\n return (\n <Card.Header>\n <Layout.Block>{leading ?? <Row.Star starred={starred} onToggle={onToggleStar} />}</Layout.Block>\n <Card.Title classNames='flex items-center gap-3'>{title}</Card.Title>\n {menu && (\n <Card.Menu label={t('toolbar-menu.label')}>\n {menuItems?.map((item) => (\n <Menu.Item\n key={item.label}\n item={{ value: item.label, label: item.label, icon: item.icon }}\n onClick={item.onClick}\n />\n ))}\n </Card.Menu>\n )}\n </Card.Header>\n );\n};\n\nCardTileHeader.displayName = 'CardTile.Header';\n\n//\n// Tile\n//\n\nexport const CardTile = {\n Root: CardTileRoot,\n Header: CardTileHeader,\n};\n\nexport type { CardTileHeaderProps, CardTileRootProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAa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GAAS,UAAU;EAAe,CAAA,EAAgB,CAAA;EAC/F,oBAAC,KAAK,OAAN;GAAY,YAAW;GAA2B,UAAA;EAAkB,CAAA;EACnE,QACC,oBAAC,KAAK,MAAN;GAAW,OAAO,EAAE,oBAAoB;GACrC,UAAA,WAAW,KAAK,SACf,oBAAC,KAAK,MAAN;IAEE,MAAM;KAAE,OAAO,KAAK;KAAO,OAAO,KAAK;KAAO,MAAM,KAAK;IAAK;IAC9D,SAAS,KAAK;GACf,GAHM,KAAK,KAGX,CACF;EACQ,CAAA;CAEF,EAAA,CAAA;AAEjB;AAEA,eAAe,cAAc;AAM7B,IAAa,WAAW;CACtB,MAAM;CACN,QAAQ;AACV"}
1
+ {"version":3,"file":"index.mjs","names":["toHue"],"sources":["../../src/util.ts","../../src/components/Avatar/avatar-name.ts","../../src/components/Avatar/Avatar.tsx","../../src/components/Avatar/ObjectAvatar.tsx","../../src/hooks/useActorContact.ts","../../src/components/Row/Row.tsx","../../src/components/CardTile/CardTile.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n/** Deterministic string hash (djb2), used to map a name to a stable avatar hue. */\nexport const hashString = (str?: string): number =>\n str ? Math.abs(str.split('').reduce((hash, char) => (hash << 5) + hash + char.charCodeAt(0), 0)) : 0;\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Actor } from '@dxos/types';\nimport { toHue } from '@dxos/util';\n\nimport { hashString } from '../../util.ts';\n\n// Kept out of `Avatar.tsx`: react-refresh only fast-refreshes a module whose\n// exports are all components, so values exported beside them force a full page reload on\n// every edit.\n\n/** Canonical display name for an actor — the avatar glyph fallback and the hue key are both derived from it. */\nexport const avatarName = (actor?: Actor.Actor): string =>\n actor?.contact?.target?.fullName ?? actor?.name ?? actor?.email ?? '';\n\n/** Single source for a name→hue mapping, so the same sender is one color across every surface. */\nexport const nameToHue = (name?: string): string => toHue(hashString(name));\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { DxAvatar, type DxAvatarProps } from '@dxos/lit-ui/react';\nimport { type Actor } from '@dxos/types';\n\nimport { avatarName } from './avatar-name.ts';\nimport { nameToHue } from './avatar-name.ts';\n\nexport type AvatarProps = Pick<DxAvatarProps, 'variant' | 'size' | 'onClick'> & {\n /** Sender/participant; supplies the display name and the hue. */\n actor?: Actor.Actor;\n /** Label override; defaults to the actor's {@link avatarName}. */\n name?: string;\n};\n\n/**\n * Sender/participant avatar with one shared name→hue derivation ({@link nameToHue}) so a given\n * person renders the same color across the mailbox list, the opened thread, and preview cards —\n * previously each site hand-rolled `DxAvatar` off a different input.\n */\nexport const Avatar = ({ actor, name, variant = 'circle', size = 6, onClick }: AvatarProps) => {\n const label = name ?? avatarName(actor);\n return (\n <DxAvatar\n hue={nameToHue(label)}\n hueVariant='surface'\n variant={variant}\n size={size}\n fallback={label}\n onClick={onClick}\n />\n );\n};\n\nAvatar.displayName = 'Avatar';\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Entity, Obj } from '@dxos/echo';\nimport { useLabel, useObject } from '@dxos/echo-react';\nimport { DxAvatar, type DxAvatarProps } from '@dxos/lit-ui/react';\nimport * as Icon from '@dxos/react-ui/Icon';\nimport { getStyles } from '@dxos/ui-theme';\n\nimport { nameToHue } from './avatar-name.ts';\n\n/**\n * Conventional field holding an object's picture, as a URL.\n *\n * A convention rather than an annotation because it is already one across the types that have a\n * picture at all: `Person.image` and `Organization.image` are both an optional URL string, written\n * by `CrmOperation.EnrichImages` (Gravatar / logo service, re-hosted). Promote it to an annotation\n * when a type needs to name a different field — nothing does yet, and an annotation nobody varies is\n * indirection without a payer.\n */\nconst IMAGE_PROPERTY = 'image';\n\nconst asImage = (value: unknown): string | undefined =>\n typeof value === 'string' && value.length > 0 ? value : undefined;\n\nconst isLiveObject = (value: unknown): value is Obj.Unknown & { readonly [IMAGE_PROPERTY]?: unknown } =>\n Obj.isObject(value);\n\n/** The object's picture URL, or `undefined` when it has none. */\nexport const getObjectImage = (entity: Entity.Unknown | Entity.Snapshot): string | undefined =>\n asImage(Reflect.get(entity, IMAGE_PROPERTY));\n\nexport type ObjectAvatarProps = Pick<DxAvatarProps, 'variant' | 'size' | 'onClick'> & {\n /** Any ECHO object — the avatar is derived entirely from it. */\n object: Entity.Unknown | Entity.Snapshot;\n /** Fallback glyph when the object has neither a picture nor a label. */\n fallbackIcon?: string;\n /** False when the host already shows the picture nearby (e.g., a card body), so the avatar keeps to initials. */\n showImage?: boolean;\n};\n\n/**\n * An object depicted as itself: its picture, else its initials, else its type glyph.\n *\n * This is the treatment for objects whose identity IS the point — a person, an organization — so it\n * is opted into per type through `AppSurface.CardIcon` rather than applied to everything. A\n * directory of cards is scanned by kind, and giving every object a per-instance disc would trade\n * that away; the type glyph stays the default.\n */\nexport const ObjectAvatar = ({\n object,\n variant = 'circle',\n size = 6,\n fallbackIcon,\n showImage = true,\n onClick,\n}: ObjectAvatarProps) => {\n const live = isLiveObject(object) ? object : undefined;\n const [liveImage] = useObject(live, IMAGE_PROPERTY);\n const image = showImage ? (live ? asImage(liveImage) : getObjectImage(object)) : undefined;\n const label = useLabel(object);\n const iconAnnotation = Entity.getIcon(object);\n\n // No picture and no label leaves initials with nothing to derive from, so the type's own glyph is\n // the only honest thing left — a blank disc would read as a failed image rather than as an object\n // that has never been named.\n if (!image && !label) {\n const icon = fallbackIcon ?? iconAnnotation?.icon ?? 'ph--circle-dashed--regular';\n return <Icon.Icon icon={icon} classNames={iconAnnotation?.hue ? getStyles(iconAnnotation.hue).text : undefined} />;\n }\n\n return (\n <DxAvatar\n // From the label, not the type: a type declaring one hue (`Person` and `Organization` both\n // declare `neutral`) would put every instance on the same disc, which is exactly what initials\n // exist to prevent. The derivation is pure, so one object keeps its colour everywhere.\n hue={nameToHue(label ?? '')}\n hueVariant='surface'\n variant={variant}\n size={size}\n imgSrc={image}\n fallback={label ?? ''}\n onClick={onClick}\n />\n );\n};\n\nObjectAvatar.displayName = 'ObjectAvatar';\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type Database, Filter, Obj } from '@dxos/echo';\nimport { useQuery } from '@dxos/echo-react';\nimport { EID } from '@dxos/keys';\nimport { type Actor, Person } from '@dxos/types';\n\n// TODO(burdon): Factor out lazy update pattern.\nexport const useActorContact = (db?: Database.Database, actor?: Actor.Actor): EID.EID | undefined => {\n // Don't bother querying the space if there is already a reference to the contact.\n const isLinked = !!actor?.contact;\n const contacts = useQuery(isLinked ? undefined : db, Filter.type(Person.Person));\n const existingContact = useMemo(\n () => contacts.find((contact) => contact.emails?.find((email) => email.value === actor?.email)),\n [contacts, actor?.email],\n );\n\n return useMemo(\n () =>\n actor?.contact\n ? EID.tryParse(actor.contact.uri)\n : existingContact\n ? EID.parse(Obj.getURI(existingContact))\n : undefined,\n [actor?.contact, existingContact],\n );\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { format, intervalToDuration } from 'date-fns';\nimport React, { type KeyboardEvent, type MouseEvent, useCallback, useEffect, useRef } from 'react';\n\nimport { type Database, Obj } from '@dxos/echo';\nimport { useLabel } from '@dxos/echo-react';\nimport { EID, type URI } from '@dxos/keys';\nimport * as Button from '@dxos/react-ui/Button';\nimport * as Card from '@dxos/react-ui/Card';\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport * as Icon from '@dxos/react-ui/Icon';\nimport * as SystemButton from '@dxos/react-ui/SystemButton';\nimport * as Tag from '@dxos/react-ui/Tag';\nimport { type Actor, type Message } from '@dxos/types';\nimport { mx, toHue } from '@dxos/ui-theme';\nimport { DxAnchorActivate } from '@dxos/ui-types';\n\nimport { translationKey } from '#translations';\n\nimport { useActorContact } from '../../hooks/index.ts';\nimport { Avatar, type AvatarProps, avatarName } from '../Avatar/index.ts';\n\n/**\n * Shared Card-row primitives rendered inside a `Card.Body`. These are the single source for the\n * person/date/tags/ref/star rows used across the inbox tiles (`EventStack`/`InboxStack`), the preview\n * cards (`EventCard`/`MessageCard`), and the article headers — so a row of each kind is defined exactly\n * once and every surface composes from it.\n */\n\n//\n// Card activation — internal helpers, not exported on Row.\n//\n\n/**\n * Opens an ECHO object's preview card, anchored on `trigger`. The card surface listens for\n * `DxAnchorActivate` (see `EditorMenuProvider`), so this is the same path a `dx-anchor` link takes.\n */\nconst activateCard = ({\n trigger,\n eid,\n label,\n title,\n}: {\n trigger: HTMLElement | null;\n eid: URI.URI;\n label: string;\n title?: string;\n}) => {\n trigger?.dispatchEvent(new DxAnchorActivate({ trigger, eid: eid.toString(), label, kind: 'card', title }));\n};\n\n/**\n * Delay before a hover opens a card. Long enough that crossing the avatar on the way somewhere else\n * does not fire it, short enough to feel like a hover rather than a wait.\n */\nconst HOVER_CARD_DELAY = 400;\n\n/**\n * Hover intent for a card-opening trigger: `start` opens after {@link HOVER_CARD_DELAY}, `cancel`\n * aborts a pending open. Returned as bare callbacks rather than DOM props so a caller can compose\n * them with its own pointer handlers.\n */\n/**\n * Arms a delayed `open` on hover, cancelling on unmount AND whenever the target changes.\n *\n * Exported for its regression test: the cancellation-on-target-change is a dependency-array property,\n * not extractable logic, so it can only be pinned by rendering the hook.\n */\nexport const useCardHover = (open: () => void, enabled: boolean) => {\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n const cancel = useCallback(() => {\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, []);\n\n const start = useCallback(() => {\n if (!enabled) {\n return;\n }\n cancel();\n timeoutRef.current = setTimeout(() => {\n timeoutRef.current = undefined;\n open();\n }, HOVER_CARD_DELAY);\n }, [enabled, cancel, open]);\n\n // Cancels on unmount AND whenever the target changes: `cancel` is stable, so depending on it alone\n // let a timer armed for the previous contact fire the stale `open` after the row was recycled or\n // re-pointed at another actor.\n useEffect(() => cancel, [cancel, open, enabled]);\n\n return { start, cancel };\n};\n\n//\n// AnchorIconButton — internal helper, not exported on Row.\n//\n\ntype AnchorIconButtonProps = {\n compact?: boolean;\n icon: string;\n fallbackIcon?: string;\n label: string;\n fallbackLabel?: string;\n title?: string;\n value?: URI.URI;\n /** Also open the card on hover (never the `onClick` fallback — hovering must not create anything). */\n hover?: boolean;\n onClick?: () => void;\n};\n\n/**\n * Icon-only button that opens an ECHO object's preview card via `DxAnchorActivate`.\n * Falls back to `onClick` when `value` is absent.\n */\nconst AnchorIconButton = ({\n compact,\n icon,\n fallbackIcon,\n label,\n fallbackLabel,\n title,\n value,\n hover,\n onClick,\n}: AnchorIconButtonProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const openCard = useCallback(() => {\n if (value) {\n activateCard({ trigger: buttonRef.current, eid: value, label, title });\n }\n }, [value, label, title]);\n const { start: startHover, cancel: cancelHover } = useCardHover(openCard, !!hover && !!value);\n\n const handleClick = useCallback(() => {\n if (value) {\n openCard();\n } else {\n onClick?.();\n }\n }, [value, openCard, onClick]);\n\n return (\n <Button.Root\n onPointerEnter={startHover}\n onPointerLeave={cancelHover}\n classNames={compact ? 'min-h-0' : 'aspect-square'}\n variant='ghost'\n disabled={!value && !onClick}\n icon={value ? icon : (fallbackIcon ?? icon)}\n iconOnly\n label={value ? label : (fallbackLabel ?? label)}\n onClick={handleClick}\n ref={buttonRef}\n />\n );\n};\n\n//\n// Date\n//\n\ntype RowDateProps = {\n start: Date;\n end?: Date;\n};\n\n/** A Card.Row rendering a date or date range with a calendar icon. */\nconst RowDate = ({ start, end }: RowDateProps) => {\n let { hours = 0, minutes = 0 } = (end && intervalToDuration({ start, end })) ?? {};\n // Prefer 90m over 1h 30m.\n if (hours === 1 && minutes !== 0) {\n hours = 0;\n minutes += 60;\n }\n const duration = [hours > 0 && `${hours}h`, minutes > 0 && `${minutes}m`].filter(Boolean).join(' ');\n\n return (\n <Card.Row icon='ph--calendar--regular'>\n <div className='flex items-center gap-2 overflow-hidden whitespace-nowrap'>\n <div className='truncate text-fg-muted'>{format(start, 'PPp')}</div>\n {duration.length > 0 && <div className='text-fg-muted text-xs'>({duration})</div>}\n </div>\n </Card.Row>\n );\n};\n\nRowDate.displayName = 'Row.Date';\n\n//\n// Ref\n//\n\ntype RowRefProps = {\n object: Obj.Any;\n};\n\n/** A Card.Row rendering an ECHO ref/relation with a card-preview anchor icon. */\nconst RowRef = ({ object }: RowRefProps) => {\n const label = useLabel(object, { fallback: 'typename' }) ?? 'object';\n const icon = Obj.getIcon(object)?.icon ?? 'ph--cube--regular';\n const echoUri = EID.tryParse(Obj.getURI(object).toString());\n\n // TODO(burdon): Nav?\n return (\n <Card.Row leading={<AnchorIconButton icon={icon} label={label} title={label} value={echoUri} />}>\n <div className='flex items-center'>\n <span className='truncate text-primary-text'>{label}</span>\n </div>\n </Card.Row>\n );\n};\n\nRowRef.displayName = 'Row.Ref';\n\n//\n// Person\n//\n\n/** Recipient/participant kind; drives the leading icon and accessible label. */\nexport type PersonRole = 'from' | 'to' | 'cc' | 'bcc' | 'attendee';\n\ntype RowPersonProps = {\n actor: Actor.Actor;\n /** Recipient/participant kind (aria only; no visible prefix). */\n role?: PersonRole;\n /**\n * Resolving the actor's contact costs a query hook, so passing `db` is what opts a row into the\n * interactive avatar (hover card / create contact). Omit it in virtualized list tiles, which get the\n * hook-free static avatar instead — or give them {@link RowPersonProps.getContact}.\n */\n db?: Database.Database;\n /**\n * Pre-resolved contact lookup, for a LIST that resolves every row's contact from one query of its\n * own: passing this makes the row interactive without the per-row hook `db` implies. Returning\n * `undefined` means \"no contact\" (the create affordance), not \"unknown yet\".\n */\n getContact?: (actor: Actor.Actor) => EID.EID | undefined;\n /** Avatar size: 6 for a dense list row (the default), 9 for a message tile's own header. */\n size?: AvatarProps['size'];\n onContactCreate?: (actor: Actor.Actor) => void;\n /** Render a trailing remove button (e.g. attendee rows in the editable event header). */\n onRemove?: () => void;\n /** Click handler for the avatar (e.g. select the message). */\n onClick?: (event: MouseEvent) => void;\n};\n\n/**\n * Static avatar variant — no contact resolution. Suitable for virtualized list tiles.\n */\nconst PersonAvatarRow = ({ actor, size, onClick }: Pick<RowPersonProps, 'actor' | 'size' | 'onClick'>) => (\n <Card.Row leading={<Avatar actor={actor} size={size} onClick={onClick} />}>\n <Card.Text>{avatarName(actor) || actor.email}</Card.Text>\n </Card.Row>\n);\n\n/**\n * Interactive variant: the gutter always shows the actor's AVATAR, and resolving their contact decides\n * what hovering it does — a Person opens that contact's card, no Person swaps the avatar for a\n * create-contact button (a click, never the hover, since hovering must not write to the space).\n *\n * Uniform across every surface that shows people, so a sender, a recipient and an attendee all read\n * the same. Separate from {@link PersonAvatarRow} only because resolving a contact costs a query hook\n * per row: a virtualized list keeps the static variant.\n */\nexport type ContactAvatarProps = Pick<\n RowPersonProps,\n 'actor' | 'role' | 'db' | 'getContact' | 'size' | 'onContactCreate'\n> & {\n onClick?: (event: MouseEvent) => void;\n};\n\n/**\n * The actor's avatar, wired to their contact: hovering opens that Person's card, and when the space\n * has no Person for the address the avatar gives way to a create-contact button (a click, never the\n * hover, since hovering must not write to the space).\n *\n * Exported because the same treatment belongs to every surface showing a person — `Row.Person`'s\n * gutter, but also list tiles that lay their rows out themselves.\n */\nexport const ContactAvatar = ({\n actor,\n role,\n db,\n getContact,\n size = 5,\n onContactCreate,\n onClick,\n}: ContactAvatarProps) => {\n const { t } = Hooks.useTranslation(translationKey);\n // Unconditional hook, but a `getContact` caller passes no `db`, so it runs no query.\n const resolved = useActorContact(getContact ? undefined : db, actor);\n const contactDXN = getContact ? getContact(actor) : resolved;\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const openCard = useCallback(() => {\n if (contactDXN) {\n activateCard({\n trigger: anchorRef.current,\n eid: contactDXN,\n label: t('show-contact.label'),\n title: role ? `${role}: ${actor.name ?? actor.email}` : (actor.name ?? actor.email),\n });\n }\n }, [contactDXN, t, role, actor.name, actor.email]);\n const { start: startHover, cancel: cancelHover } = useCardHover(openCard, !!contactDXN);\n\n const handleContactCreate = useCallback(() => onContactCreate?.(actor), [actor, onContactCreate]);\n\n // Both are always mounted when a contact can be created: swapping them on hover dropped focus the\n // instant a keyboard user reached the button, and mounting it only on hover kept it out of the tab\n // order entirely. The avatar fades out instead, so the gutter width never changes.\n const canCreate = !contactDXN && !!onContactCreate;\n\n return (\n <div\n ref={anchorRef}\n // Pointer only when hovering does something: a resolved contact opens its card.\n className={mx('relative grid place-items-center group/contact', contactDXN && 'cursor-pointer')}\n data-testid='row.contact-avatar'\n onPointerEnter={startHover}\n onPointerLeave={cancelHover}\n >\n {/* Faded (not unmounted) while the create button covers it, so the gutter never resizes. */}\n {/* `grid`, not the default block: `dx-avatar` is `display: contents` and the frame inside it is\n `inline-flex`, so in a block box it sits on the text baseline and the line box adds descender\n space beneath it — making this wrapper taller than the avatar and pinning the face to its top.\n Every caller that centres this against a line of text then reads as misaligned. */}\n <div className={mx('grid', canCreate && 'group-hover/contact:opacity-0 group-focus-within/contact:opacity-0')}>\n <Avatar actor={actor} size={size} onClick={onClick} />\n </div>\n {canCreate && (\n <Button.Root\n variant='ghost'\n iconOnly\n icon='ph--user-circle-plus--regular'\n // One step below the avatar it replaces, so the button reads as an affordance rather than\n // as a heavier stand-in for the face.\n iconSize={Number(size) >= 8 ? 'lg' : 'md'}\n label={t('create-contact.label')}\n classNames='dx-cover opacity-0 group-hover/contact:opacity-100 focus-visible:opacity-100'\n onClick={handleContactCreate}\n />\n )}\n </div>\n );\n};\n\nContactAvatar.displayName = 'ContactAvatar';\n\nconst PersonContactRow = ({\n actor,\n role,\n db,\n getContact,\n size,\n onContactCreate,\n onRemove,\n onClick,\n}: RowPersonProps) => {\n const { t } = Hooks.useTranslation(translationKey);\n\n return (\n <Card.Row\n leading={\n <ContactAvatar\n actor={actor}\n role={role}\n db={db}\n getContact={getContact}\n size={size}\n onContactCreate={onContactCreate}\n onClick={onClick}\n />\n }\n trailing={\n onRemove && (\n <Button.Root\n variant='ghost'\n iconOnly\n icon='ph--x--regular'\n label={t('remove-attendee.label')}\n onClick={onRemove}\n />\n )\n }\n >\n <Card.Text>{avatarName(actor) || actor.email}</Card.Text>\n </Card.Row>\n );\n};\n\n/** A Card.Row rendering a person (sender, recipient, attendee). */\nconst RowPerson = ({ onClick, ...props }: RowPersonProps) =>\n props.db || props.getContact ? (\n <PersonContactRow {...props} onClick={onClick} />\n ) : (\n <PersonAvatarRow actor={props.actor} size={props.size} onClick={onClick} />\n );\n\nRowPerson.displayName = 'Row.Person';\n\n//\n// Tags\n//\n\ntype TagItem = { id: string; label?: string; hue?: string };\n\ntype RowTagsProps = {\n /** Optional — callers may pass an undefined/empty list (e.g. a message with no tags). */\n tags?: TagItem[];\n /** When provided, each chip is clickable and stops event propagation. */\n onTagClick?: (label: string) => void;\n};\n\n/** A Card.Row rendering a set of label+hue tag chips, optionally clickable. */\nconst RowTags = ({ tags, onTagClick }: RowTagsProps) => {\n if (!tags?.length) {\n return null;\n }\n\n return (\n <Card.Row icon='ph--tag--regular'>\n <div className='flex flex-wrap gap-1 py-1' data-testid='extracted-tags'>\n {tags.map((tag) => (\n <Tag.Tag\n key={tag.id}\n hue={toHue(tag.hue)}\n data-testid={`message-tag-${tag.id}`}\n onClick={\n onTagClick\n ? (event) => {\n event.stopPropagation();\n onTagClick(tag.label ?? tag.id);\n }\n : undefined\n }\n >\n {tag.label ?? tag.id}\n </Tag.Tag>\n ))}\n </div>\n </Card.Row>\n );\n};\n\nRowTags.displayName = 'Row.Tags';\n\n//\n// Star\n//\n\ntype RowStarProps = {\n starred?: boolean;\n /** Toggle handler; the button renders only when provided. */\n onToggle?: () => void;\n};\n\n/**\n * Star toggle for a `Card.Block` leading gutter (shared by event/message tiles and headers). Stops\n * the click from bubbling so starring doesn't also select/activate the surrounding tile or card.\n */\nconst RowStar = ({ starred, onToggle }: RowStarProps) => {\n const handleClick = useCallback<NonNullable<Button.RootProps['onClick']>>(\n (event) => {\n event.stopPropagation();\n onToggle?.();\n },\n [onToggle],\n );\n\n if (!onToggle) {\n return null;\n }\n\n return <SystemButton.Star iconOnly variant='ghost' pressed={starred} onClick={handleClick} />;\n};\n\nRowStar.displayName = 'Row.Star';\n\n//\n// Attachments\n//\n\ntype RowAttachmentsProps = {\n /** Optional — callers may pass an undefined/empty list (e.g. a message with no attachments). */\n attachments?: readonly Message.Attachment[];\n /**\n * Opens an attachment, by its index in `attachments`. The index rather than the attachment itself\n * because an attachment has no identity of its own — it is an entry on the message.\n */\n onAttachmentClick?: (index: number) => void;\n};\n\n/** A Card.Row listing a message's attachments by name; each chip opens its attachment when clickable. */\nconst RowAttachments = ({ attachments, onAttachmentClick }: RowAttachmentsProps) => {\n if (!attachments?.length) {\n return null;\n }\n\n return (\n <Card.Row icon='ph--paperclip--regular'>\n <div className='flex flex-wrap gap-1 py-1' data-testid='message-attachments'>\n {attachments.map((attachment, index) => (\n <Tag.Tag\n key={attachment.ref.uri}\n hue='neutral'\n classNames={mx('inline-flex items-center gap-1', onAttachmentClick && 'cursor-pointer')}\n // `Tag` renders a span, so a bare `onClick` would be mouse-only. `role`/`tabIndex` plus the\n // key handler give it the button semantics it needs to be reachable from the keyboard.\n {...(onAttachmentClick && {\n role: 'button',\n tabIndex: 0,\n onClick: (event: MouseEvent) => {\n // The row sits inside a tile that also handles clicks; opening an attachment must not\n // also select the message behind it.\n event.stopPropagation();\n onAttachmentClick(index);\n },\n onKeyDown: (event: KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n onAttachmentClick(index);\n }\n },\n })}\n >\n <Icon.Icon icon='ph--file--regular' size='xs' />\n {attachment.name ?? attachment.ref.uri}\n </Tag.Tag>\n ))}\n </div>\n </Card.Row>\n );\n};\n\nRowAttachments.displayName = 'Row.Attachments';\n\n//\n// Row\n//\n\nexport const Row = {\n Date: RowDate,\n Ref: RowRef,\n Person: RowPerson,\n Tags: RowTags,\n Star: RowStar,\n Attachments: RowAttachments,\n};\n\nexport type { RowAttachmentsProps, RowDateProps, RowPersonProps, RowRefProps, RowStarProps, RowTagsProps };\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type MouseEvent, PropsWithChildren, type ReactNode, forwardRef } from 'react';\n\nimport { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';\nimport * as Card from '@dxos/react-ui/Card';\nimport * as Focus from '@dxos/react-ui/Focus';\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport * as Layout from '@dxos/react-ui/Layout';\nimport * as Menu from '@dxos/react-ui/Menu';\nimport type * as Util from '@dxos/react-ui/Util';\nimport { osTranslations } from '@dxos/ui-theme';\n\nimport { Row } from '../Row/index.ts';\n\n//\n// Root\n//\n\ntype CardTileRootProps = Util.ThemedClassName<\n PropsWithChildren<\n Pick<MosaicTileProps<unknown>, 'data' | 'location' | 'current' | 'binding'> & {\n 'id': string;\n 'onCurrentChange': () => void;\n 'onClick'?: (event: MouseEvent) => void;\n 'data-testid'?: string;\n }\n >\n>;\n\n/**\n * Shared mosaic tile shell: `Mosaic.Tile` → `Focus.Item` → `Card.Root`. The card is a `grid` card, so every\n * header and row puts its leading cell (star, unread mark, avatar) in the start rail and its text on one\n * content edge.\n * Callers supply the inner `Card.Header`/`Card.Body` (typically via {@link CardTileHeader} + rows).\n * Activation is committed by the caller's `onCurrentChange` (Mosaic `current`/selection), so click/Enter light the tile up.\n */\nconst CardTileRoot = forwardRef<HTMLDivElement, CardTileRootProps>(\n (\n { id, data, location, current, binding, onCurrentChange, onClick, classNames, children, 'data-testid': testId },\n forwardedRef,\n ) => (\n <Mosaic.Tile\n asChild\n id={id}\n data={data}\n location={location}\n binding={binding}\n classNames={classNames ?? 'dx-hover dx-current dx-selected p-1 rounded-md'}\n >\n {/* Selected here too: the item would otherwise override the tile's `aria-selected` with its own unset one. */}\n <Focus.Item asChild current={current} selected={binding?.['aria-selected']} onCurrentChange={onCurrentChange}>\n <Card.Root grid border={false} onClick={onClick} ref={forwardedRef} data-testid={testId} data-focus-click=''>\n {children}\n </Card.Root>\n </Focus.Item>\n </Mosaic.Tile>\n ),\n);\n\nCardTileRoot.displayName = 'CardTile.Root';\n\n//\n// Header\n//\n\n/** A single `Card.Menu` dropdown item. */\nexport type CardTileMenuItem = {\n label: string;\n icon?: string;\n onClick: () => void;\n};\n\ntype CardTileHeaderProps = {\n /** Header title content (rendered in a flex row). */\n title: ReactNode;\n /** Start-rail content in place of the star (e.g. an unread mark). */\n leading?: ReactNode;\n /** Whether the tile is starred. `Row.Star` renders the button only when `onToggleStar` is set. */\n starred?: boolean;\n /** Render the trailing `Card.Menu` action slot. */\n menu?: boolean;\n /** Items for the `Card.Menu` dropdown (the trigger is disabled when empty). */\n menuItems?: CardTileMenuItem[];\n onToggleStar?: () => void;\n};\n\n/**\n * Tile header row: leading `Row.Star` · title · optional `Card.Menu`. Shared by message/conversation\n * tiles (with menu) and event tiles (star + title only).\n */\nconst CardTileHeader = ({ title, leading, starred, menu = false, menuItems, onToggleStar }: CardTileHeaderProps) => {\n const { t } = Hooks.useTranslation(osTranslations);\n return (\n <Card.Header>\n <Layout.Block>{leading ?? <Row.Star starred={starred} onToggle={onToggleStar} />}</Layout.Block>\n <Card.Title classNames='flex items-center gap-3'>{title}</Card.Title>\n {menu && (\n <Card.Menu label={t('toolbar-menu.label')}>\n {menuItems?.map((item) => (\n <Menu.Item\n key={item.label}\n item={{ value: item.label, label: item.label, icon: item.icon }}\n onClick={item.onClick}\n />\n ))}\n </Card.Menu>\n )}\n </Card.Header>\n );\n};\n\nCardTileHeader.displayName = 'CardTile.Header';\n\n//\n// Tile\n//\n\nexport const CardTile = {\n Root: CardTileRoot,\n Header: CardTileHeader,\n};\n\nexport type { CardTileHeaderProps, CardTileRootProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAa,cAAc,QACzB,MAAM,KAAK,IAAI,IAAI,MAAM,EAAE,CAAC,CAAC,QAAQ,MAAM,UAAU,QAAQ,KAAK,OAAO,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI;;;;ACQrG,IAAa,cAAc,UACzB,OAAO,SAAS,QAAQ,YAAY,OAAO,QAAQ,OAAO,SAAS;;AAGrE,IAAa,aAAa,SA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AM;KAAE,OAAO,KAAK;KAAO,OAAO,KAAK;KAAO,MAAM,KAAK;IAAK;IAC9D,SAAS,KAAK;GACf,GAHM,KAAK,KAGX,CACF;EACQ,CAAA;CAEF,EAAA,CAAA;AAEjB;AAEA,eAAe,cAAc;AAM7B,IAAa,WAAW;CACtB,MAAM;CACN,QAAQ;AACV"}
@@ -1,7 +1,7 @@
1
1
  import React, { type MouseEvent, PropsWithChildren, type ReactNode } from 'react';
2
2
  import { type MosaicTileProps } from '@dxos/react-ui-mosaic';
3
3
  import type * as Util from '@dxos/react-ui/Util';
4
- type CardTileRootProps = Util.ThemedClassName<PropsWithChildren<Pick<MosaicTileProps<unknown>, 'data' | 'location' | 'current'> & {
4
+ type CardTileRootProps = Util.ThemedClassName<PropsWithChildren<Pick<MosaicTileProps<unknown>, 'data' | 'location' | 'current' | 'binding'> & {
5
5
  'id': string;
6
6
  'onCurrentChange': () => void;
7
7
  'onClick'?: (event: MouseEvent) => void;
@@ -35,7 +35,7 @@ declare const CardTileHeader: {
35
35
  displayName: string;
36
36
  };
37
37
  export declare const CardTile: {
38
- Root: React.ForwardRefExoticComponent<Omit<PropsWithChildren<Pick<MosaicTileProps<unknown>, "current" | "data" | "location"> & {
38
+ Root: React.ForwardRefExoticComponent<Omit<PropsWithChildren<Pick<MosaicTileProps<unknown>, "binding" | "current" | "data" | "location"> & {
39
39
  id: string;
40
40
  onCurrentChange: () => void;
41
41
  onClick?: (event: MouseEvent) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"CardTile.d.ts","sourceRoot":"","sources":["../../../../../src/components/CardTile/CardTile.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,UAAU,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMrE,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AASjD,KAAK,iBAA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