UNPKG

@cossistant/next

Version:

Next.js-ready SDK for building AI-powered support/chat widgets. Hooks + primitives, WS-driven, TypeScript-first. Next.js-ready, Tailwind optional.

110 lines (108 loc) 4.32 kB
import * as React$1 from "react"; //#region ../react/src/primitives/timeline-item-group.d.ts /** * Shape returned to render-prop children describing the grouped timeline items state * and viewer specific flags. */ type TimelineItemGroupRenderProps = { senderType: SenderType; senderId: string; viewerType?: SenderType; isSentByViewer: boolean; isReceivedByViewer: boolean; isVisitor: boolean; isAI: boolean; isTeamMember: boolean; itemCount: number; firstItemId: string | undefined; lastItemId: string | undefined; hasBeenSeenByViewer?: boolean; seenByIds?: string[]; }; /** * Groups sequential timeline items from the same sender and exposes render helpers * that describe who sent the batch and whether the active viewer has seen it. * Consumers can either render their own layout via a render prop or rely on * slotted children. Typically used for MESSAGE-type items; EVENT items are usually rendered separately. */ declare const TimelineItemGroup: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & { children?: React$1.ReactNode | ((props: TimelineItemGroupRenderProps) => React$1.ReactNode); asChild?: boolean; className?: string; items: TimelineItemType[]; viewerId?: string; viewerType?: SenderType; seenByIds?: string[]; lastReadItemIds?: Map<string, string>; } & React$1.RefAttributes<HTMLDivElement>>; /** * Optional slot rendered next to a grouped batch to display an avatar, agent * badge or any other sender metadata supplied by the consumer UI. */ declare const TimelineItemGroupAvatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & { children?: React$1.ReactNode; asChild?: boolean; className?: string; } & React$1.RefAttributes<HTMLDivElement>>; /** * Decorative or semantic wrapper rendered above a timeline item batch. Useful for * injecting agent names, timestamps or custom status labels tied to the sender * metadata supplied by `TimelineItemGroup`. */ declare const TimelineItemGroupHeader: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & { children?: React$1.ReactNode | ((props: { name?: string; senderId?: string; senderType?: SenderType; }) => React$1.ReactNode); asChild?: boolean; className?: string; name?: string; senderId?: string; senderType?: SenderType; } & React$1.RefAttributes<HTMLDivElement>>; /** * Container for the actual timeline items within a batch. Consumers can * override the structure while inheriting layout props passed down from the * parent group. */ declare const TimelineItemGroupContent: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & { children?: React$1.ReactNode; asChild?: boolean; className?: string; } & React$1.RefAttributes<HTMLDivElement>>; /** * Utility slot for showing who has viewed the most recent timeline item in the * group. Works with simple text children or a render prop for advanced * displays. */ declare const TimelineItemGroupSeenIndicator: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & { children?: React$1.ReactNode | ((props: { seenByIds: string[]; hasBeenSeen: boolean; }) => React$1.ReactNode); asChild?: boolean; className?: string; seenByIds?: string[]; } & React$1.RefAttributes<HTMLDivElement>>; /** * Renders read receipts for the tail timeline item in a group. It surfaces the list * of readers and callers can decide whether to render avatars, tooltips or a * basic label. */ declare const TimelineItemGroupReadIndicator: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & { children?: React$1.ReactNode | ((props: { readers: Array<{ userId: string; isLastRead: boolean; }>; lastReaderIds: string[]; }) => React$1.ReactNode); asChild?: boolean; className?: string; itemId: string; lastReadItemIds?: Map<string, string>; } & React$1.RefAttributes<HTMLDivElement>>; //#endregion export { TimelineItemGroup, TimelineItemGroupAvatar, TimelineItemGroupContent, TimelineItemGroupHeader, TimelineItemGroupReadIndicator, TimelineItemGroupSeenIndicator }; //# sourceMappingURL=timeline-item-group.d.ts.map