@poolse/react-ui 1.0.1-beta.0 → 1.0.2
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/README.md +30 -15
- package/dist/index.cjs +611 -233
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -4
- package/dist/index.d.ts +35 -4
- package/dist/index.js +610 -235
- package/dist/index.js.map +1 -1
- package/dist/styles.css +367 -18
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Uuid, Message, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
3
3
|
import { ReactNode, SVGProps, ReactElement } from 'react';
|
|
4
|
-
import { ReactionMap } from '@poolse/react';
|
|
4
|
+
import { UploadItem, ReactionMap } from '@poolse/react';
|
|
5
5
|
|
|
6
6
|
interface ConversationViewProps {
|
|
7
7
|
conversationId: Uuid;
|
|
@@ -273,6 +273,22 @@ interface AvatarProps {
|
|
|
273
273
|
}
|
|
274
274
|
declare function Avatar({ src, name, online, size, className }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
275
275
|
|
|
276
|
+
interface UserNameProps {
|
|
277
|
+
userId: Uuid | null | undefined;
|
|
278
|
+
/** Sync override. When set, skips the async resolver entirely. */
|
|
279
|
+
labelFor?: (userId: Uuid) => string;
|
|
280
|
+
/** What to render when the userId itself is null (e.g. system messages). */
|
|
281
|
+
emptyFallback?: string;
|
|
282
|
+
className?: string;
|
|
283
|
+
}
|
|
284
|
+
declare function UserName({ userId, labelFor, emptyFallback, className, }: UserNameProps): react_jsx_runtime.JSX.Element;
|
|
285
|
+
/**
|
|
286
|
+
* Same priority chain as the component but as a plain hook so callers
|
|
287
|
+
* that need the resolved name in a string context (aria-label,
|
|
288
|
+
* tooltip, etc.) don't have to render an extra element.
|
|
289
|
+
*/
|
|
290
|
+
declare function useDisplayName(userId: Uuid | null | undefined, labelFor?: (userId: Uuid) => string, emptyFallback?: string): string;
|
|
291
|
+
|
|
276
292
|
interface ConversationListProps {
|
|
277
293
|
/** Currently selected conversation id — sets `aria-current` + selected styling. */
|
|
278
294
|
selectedId?: string | null;
|
|
@@ -318,8 +334,11 @@ interface MemberListProps {
|
|
|
318
334
|
*/
|
|
319
335
|
avatarFor?: (userId: Uuid) => string | null;
|
|
320
336
|
/**
|
|
321
|
-
*
|
|
322
|
-
*
|
|
337
|
+
* Override the online set with a caller-supplied source. By default
|
|
338
|
+
* MemberList wires `usePresence(conversationId).online` itself, so the
|
|
339
|
+
* presence dots light up out-of-the-box. Pass an explicit `Set` when
|
|
340
|
+
* you want to merge presence with other signals (typing, focus, etc),
|
|
341
|
+
* or an empty `new Set()` to disable the dots entirely.
|
|
323
342
|
*/
|
|
324
343
|
onlineUserIds?: Set<Uuid>;
|
|
325
344
|
/**
|
|
@@ -353,6 +372,18 @@ interface AttachmentPreviewProps {
|
|
|
353
372
|
}
|
|
354
373
|
declare function AttachmentPreview({ attachment, onClick }: AttachmentPreviewProps): react_jsx_runtime.JSX.Element;
|
|
355
374
|
|
|
375
|
+
interface UploadQueueStripProps {
|
|
376
|
+
items: UploadItem[];
|
|
377
|
+
onCancel: (localId: string) => void;
|
|
378
|
+
onDismiss: (localId: string) => void;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Strip of pending / uploading / errored attachments shown above the
|
|
382
|
+
* composer. Ready items aren't included — they get cleared by the
|
|
383
|
+
* parent once the send completes.
|
|
384
|
+
*/
|
|
385
|
+
declare function UploadQueueStrip({ items, onCancel, onDismiss }: UploadQueueStripProps): react_jsx_runtime.JSX.Element | null;
|
|
386
|
+
|
|
356
387
|
interface ReactionStripProps {
|
|
357
388
|
messageId: Uuid;
|
|
358
389
|
conversationId: Uuid;
|
|
@@ -609,4 +640,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
|
|
|
609
640
|
*/
|
|
610
641
|
declare function PoolseFonts(): null;
|
|
611
642
|
|
|
612
|
-
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, type IconName, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, usePoolseFonts };
|
|
643
|
+
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, type IconName, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, useDisplayName, usePoolseFonts };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Uuid, Message, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
3
3
|
import { ReactNode, SVGProps, ReactElement } from 'react';
|
|
4
|
-
import { ReactionMap } from '@poolse/react';
|
|
4
|
+
import { UploadItem, ReactionMap } from '@poolse/react';
|
|
5
5
|
|
|
6
6
|
interface ConversationViewProps {
|
|
7
7
|
conversationId: Uuid;
|
|
@@ -273,6 +273,22 @@ interface AvatarProps {
|
|
|
273
273
|
}
|
|
274
274
|
declare function Avatar({ src, name, online, size, className }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
275
275
|
|
|
276
|
+
interface UserNameProps {
|
|
277
|
+
userId: Uuid | null | undefined;
|
|
278
|
+
/** Sync override. When set, skips the async resolver entirely. */
|
|
279
|
+
labelFor?: (userId: Uuid) => string;
|
|
280
|
+
/** What to render when the userId itself is null (e.g. system messages). */
|
|
281
|
+
emptyFallback?: string;
|
|
282
|
+
className?: string;
|
|
283
|
+
}
|
|
284
|
+
declare function UserName({ userId, labelFor, emptyFallback, className, }: UserNameProps): react_jsx_runtime.JSX.Element;
|
|
285
|
+
/**
|
|
286
|
+
* Same priority chain as the component but as a plain hook so callers
|
|
287
|
+
* that need the resolved name in a string context (aria-label,
|
|
288
|
+
* tooltip, etc.) don't have to render an extra element.
|
|
289
|
+
*/
|
|
290
|
+
declare function useDisplayName(userId: Uuid | null | undefined, labelFor?: (userId: Uuid) => string, emptyFallback?: string): string;
|
|
291
|
+
|
|
276
292
|
interface ConversationListProps {
|
|
277
293
|
/** Currently selected conversation id — sets `aria-current` + selected styling. */
|
|
278
294
|
selectedId?: string | null;
|
|
@@ -318,8 +334,11 @@ interface MemberListProps {
|
|
|
318
334
|
*/
|
|
319
335
|
avatarFor?: (userId: Uuid) => string | null;
|
|
320
336
|
/**
|
|
321
|
-
*
|
|
322
|
-
*
|
|
337
|
+
* Override the online set with a caller-supplied source. By default
|
|
338
|
+
* MemberList wires `usePresence(conversationId).online` itself, so the
|
|
339
|
+
* presence dots light up out-of-the-box. Pass an explicit `Set` when
|
|
340
|
+
* you want to merge presence with other signals (typing, focus, etc),
|
|
341
|
+
* or an empty `new Set()` to disable the dots entirely.
|
|
323
342
|
*/
|
|
324
343
|
onlineUserIds?: Set<Uuid>;
|
|
325
344
|
/**
|
|
@@ -353,6 +372,18 @@ interface AttachmentPreviewProps {
|
|
|
353
372
|
}
|
|
354
373
|
declare function AttachmentPreview({ attachment, onClick }: AttachmentPreviewProps): react_jsx_runtime.JSX.Element;
|
|
355
374
|
|
|
375
|
+
interface UploadQueueStripProps {
|
|
376
|
+
items: UploadItem[];
|
|
377
|
+
onCancel: (localId: string) => void;
|
|
378
|
+
onDismiss: (localId: string) => void;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Strip of pending / uploading / errored attachments shown above the
|
|
382
|
+
* composer. Ready items aren't included — they get cleared by the
|
|
383
|
+
* parent once the send completes.
|
|
384
|
+
*/
|
|
385
|
+
declare function UploadQueueStrip({ items, onCancel, onDismiss }: UploadQueueStripProps): react_jsx_runtime.JSX.Element | null;
|
|
386
|
+
|
|
356
387
|
interface ReactionStripProps {
|
|
357
388
|
messageId: Uuid;
|
|
358
389
|
conversationId: Uuid;
|
|
@@ -609,4 +640,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
|
|
|
609
640
|
*/
|
|
610
641
|
declare function PoolseFonts(): null;
|
|
611
642
|
|
|
612
|
-
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, type IconName, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, usePoolseFonts };
|
|
643
|
+
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, type IconName, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, useDisplayName, usePoolseFonts };
|