@opencxh/ui-kit 3.175.2 → 3.176.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.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +788 -674
- package/dist/index.js.map +1 -1
- package/dist/src/content/activity/ActivityRow.d.ts +82 -0
- package/dist/src/content/activity/TimelineEvent.d.ts +22 -0
- package/dist/src/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { AvatarTone } from '../Avatar';
|
|
3
|
+
/**
|
|
4
|
+
* What a feed card is, said in colour.
|
|
5
|
+
*
|
|
6
|
+
* Two axes fold into one list. Direction: `neutral` (received, and anything that
|
|
7
|
+
* has no side — a transcript, an upload) versus `out` (sent by us, pale blue).
|
|
8
|
+
* Kind: `note` is amber and not customer-visible, `assistant` is violet. A
|
|
9
|
+
* thread is scanned for "did we answer this yet", so the sides have to differ by
|
|
10
|
+
* hue and not by a percent of grey.
|
|
11
|
+
*/
|
|
12
|
+
export type ActivityTone = "neutral" | "out" | "note" | "assistant";
|
|
13
|
+
export interface ActivityRowProps {
|
|
14
|
+
/** Who or what this row is from — {@link ActivityAvatar} or {@link ActivityGlyph}. */
|
|
15
|
+
avatar: ReactNode;
|
|
16
|
+
/** Bold: a sender's name, or what happened ("Transcript", "2 files"). */
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
/** Muted, beside the title: "to jeroen@…", "3 min 48 s · 2 speakers". */
|
|
19
|
+
context?: ReactNode;
|
|
20
|
+
/** Right of the header, before the time — a badge, a pending spinner. */
|
|
21
|
+
meta?: ReactNode;
|
|
22
|
+
/** Right-most in the header. */
|
|
23
|
+
time?: string;
|
|
24
|
+
tone?: ActivityTone;
|
|
25
|
+
/** Button row along the bottom edge of the card. */
|
|
26
|
+
actions?: ReactNode;
|
|
27
|
+
/** Rendered outside the card, under it — an inline composer, read receipts. */
|
|
28
|
+
below?: ReactNode;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One card in an activity feed: avatar, then a full-width card with a header
|
|
33
|
+
* line and a body.
|
|
34
|
+
*
|
|
35
|
+
* Every kind of activity uses this — mail, note, transcript, files, an
|
|
36
|
+
* assistant's proposal, a comment under a work item, and whatever an app
|
|
37
|
+
* declares. They used to be six hand-built variations on the same idea, each
|
|
38
|
+
* with its own avatar tile, its own header spacing and its own idea of how wide
|
|
39
|
+
* a card is; you could see the difference scrolling a single conversation.
|
|
40
|
+
*
|
|
41
|
+
* The one exception is chat (comms' `ChatMessage`), which keeps left/right
|
|
42
|
+
* bubbles that size to their content — a one-line "ok" in a full-width card
|
|
43
|
+
* reads as a document, and a chat thread is the one place where direction *is*
|
|
44
|
+
* the point.
|
|
45
|
+
*/
|
|
46
|
+
export declare function ActivityRow({ avatar, title, context, meta, time, tone, actions, below, children, }: ActivityRowProps): import("react").JSX.Element;
|
|
47
|
+
/**
|
|
48
|
+
* A `ghost` button in a card's action row needs a hover a step *darker* than the
|
|
49
|
+
* card — its own `surface-hover` is the same colour as the fill it sits on.
|
|
50
|
+
* Applied per button rather than to the row, because a filled button in the same
|
|
51
|
+
* row (an assistant's "Approve") must keep its own hover.
|
|
52
|
+
*/
|
|
53
|
+
export declare const cardActionClass = "hover:bg-surface-track";
|
|
54
|
+
/**
|
|
55
|
+
* A person: initials, or their photo. The plate says which side they are on —
|
|
56
|
+
* the other party in the channel hue, our own side in ink, a note in amber.
|
|
57
|
+
*/
|
|
58
|
+
export declare function ActivityAvatar({ name, src, tone, }: {
|
|
59
|
+
name?: string;
|
|
60
|
+
src?: string;
|
|
61
|
+
tone?: AvatarTone;
|
|
62
|
+
}): import("react").JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* A kind rather than a person — a transcript, an upload, the assistant. One step
|
|
65
|
+
* darker than the card it introduces, so the glyph reads as a marker and not as
|
|
66
|
+
* a second surface.
|
|
67
|
+
*/
|
|
68
|
+
export declare function ActivityGlyph({ icon, tone, title, }: {
|
|
69
|
+
icon: ComponentType<any>;
|
|
70
|
+
tone?: ActivityTone;
|
|
71
|
+
title?: string;
|
|
72
|
+
}): import("react").JSX.Element;
|
|
73
|
+
/**
|
|
74
|
+
* An item *inside* a card — a file, a proposed step, an attachment.
|
|
75
|
+
*
|
|
76
|
+
* White on the card's sunk fill: inside a recess the way to separate something
|
|
77
|
+
* is to lift it, not to sink it further.
|
|
78
|
+
*/
|
|
79
|
+
export declare function RowCard({ children, className }: {
|
|
80
|
+
children: ReactNode;
|
|
81
|
+
className?: string;
|
|
82
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TimelineEventProps {
|
|
2
|
+
/** Kebab-case lucide name, e.g. from the activity catalogue. */
|
|
3
|
+
icon?: string;
|
|
4
|
+
/** The whole sentence, already resolved and translated by the caller. */
|
|
5
|
+
text: string;
|
|
6
|
+
time: string;
|
|
7
|
+
joinUrl?: string;
|
|
8
|
+
joinLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Single-line timeline row: everything that is not a card — assigned, closed,
|
|
12
|
+
* moved. Deliberately *not* folded into card form: an empty event in a card with
|
|
13
|
+
* header and avatar wraps three lines of chrome around one sentence.
|
|
14
|
+
*
|
|
15
|
+
* Still aligned with the cards: indented to where the card edge starts (avatar +
|
|
16
|
+
* gap), so the timeline shares one left margin instead of floating each event
|
|
17
|
+
* in the middle.
|
|
18
|
+
*
|
|
19
|
+
* Purely presentational — the caller owns which sentence this is, so per-type
|
|
20
|
+
* copy stays in the activity catalogue and out of the kit.
|
|
21
|
+
*/
|
|
22
|
+
export declare function TimelineEvent({ icon, text, time, joinUrl, joinLabel }: TimelineEventProps): import("react").JSX.Element;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { ArtifactView, type ArtifactViewProps } from './content/ArtifactView';
|
|
|
9
9
|
export { AssistantCard, type AssistantCardProps } from './content/AssistantCard';
|
|
10
10
|
export { Avatar, type AvatarProps, type AvatarTone } from './content/Avatar';
|
|
11
11
|
export { AvatarStack, type AvatarStackPerson, type AvatarStackProps } from './content/AvatarStack';
|
|
12
|
+
export { ActivityAvatar, ActivityGlyph, ActivityRow, type ActivityRowProps, type ActivityTone, cardActionClass, RowCard, } from './content/activity/ActivityRow';
|
|
13
|
+
export { TimelineEvent, type TimelineEventProps } from './content/activity/TimelineEvent';
|
|
12
14
|
export { ChannelBadge, type ChannelBadgeProps, type ChannelKey } from './content/ChannelBadge';
|
|
13
15
|
export { Icon, type IconProps, resolveLucideIcon } from './content/Icon';
|
|
14
16
|
export { Image, type ImageProps } from './content/Image';
|