@connectycube/react-ui-kit 0.0.20 → 0.1.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/README.md +31 -4
- package/configs/dependencies.json +19 -4
- package/configs/imports.json +7 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/components/attachment.d.ts +5 -6
- package/dist/types/components/attachment.d.ts.map +1 -1
- package/dist/types/components/chat-bubble.d.ts +32 -0
- package/dist/types/components/chat-bubble.d.ts.map +1 -0
- package/dist/types/components/chat-input.d.ts +27 -0
- package/dist/types/components/chat-input.d.ts.map +1 -0
- package/dist/types/components/chat-list.d.ts +30 -0
- package/dist/types/components/chat-list.d.ts.map +1 -0
- package/dist/types/components/checkbox.d.ts +11 -0
- package/dist/types/components/checkbox.d.ts.map +1 -0
- package/dist/types/components/dialogs-list.d.ts +14 -0
- package/dist/types/components/dialogs-list.d.ts.map +1 -0
- package/dist/types/components/file-picker.d.ts +1 -1
- package/dist/types/components/file-picker.d.ts.map +1 -1
- package/dist/types/components/placeholder-text.d.ts.map +1 -1
- package/dist/types/components/quick-actions.d.ts +14 -0
- package/dist/types/components/quick-actions.d.ts.map +1 -0
- package/dist/types/components/status-call.d.ts +8 -0
- package/dist/types/components/status-call.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -2
- package/dist/types/index.d.ts.map +1 -1
- package/gen/components/attachment.jsx +6 -6
- package/gen/components/button.jsx +1 -1
- package/gen/components/{chat-message.jsx → chat-bubble.jsx} +69 -48
- package/gen/components/chat-input.jsx +152 -0
- package/gen/components/chat-list.jsx +151 -0
- package/gen/components/checkbox.jsx +30 -0
- package/gen/components/dialog-item.jsx +1 -1
- package/gen/components/dialogs-list.jsx +73 -0
- package/gen/components/dismiss-layer.jsx +1 -1
- package/gen/components/file-picker.jsx +2 -2
- package/gen/components/placeholder-text.jsx +5 -1
- package/gen/components/quick-actions.jsx +62 -0
- package/gen/components/search.jsx +1 -1
- package/gen/components/status-call.jsx +18 -0
- package/gen/components/stream-view.jsx +8 -8
- package/gen/index.js +14 -2
- package/package.json +11 -8
- package/src/components/attachment.tsx +16 -14
- package/src/components/button.tsx +1 -1
- package/src/components/chat-bubble.tsx +176 -0
- package/src/components/chat-input.tsx +172 -0
- package/src/components/chat-list.tsx +164 -0
- package/src/components/checkbox.tsx +40 -0
- package/src/components/connectycube-ui/chat-input.tsx +174 -0
- package/src/components/dialog-item.tsx +1 -1
- package/src/components/dialogs-list.tsx +84 -0
- package/src/components/dismiss-layer.tsx +1 -1
- package/src/components/file-picker.tsx +3 -3
- package/src/components/placeholder-text.tsx +5 -1
- package/src/components/quick-actions.tsx +74 -0
- package/src/components/search.tsx +1 -1
- package/src/components/status-call.tsx +23 -0
- package/src/components/stream-view.tsx +8 -8
- package/src/index.ts +17 -2
- package/dist/types/components/call-message.d.ts +0 -17
- package/dist/types/components/call-message.d.ts.map +0 -1
- package/dist/types/components/chat-message.d.ts +0 -30
- package/dist/types/components/chat-message.d.ts.map +0 -1
- package/gen/components/call-message.jsx +0 -62
- package/src/components/call-message.tsx +0 -75
- package/src/components/chat-message.tsx +0 -138
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type LucideProps } from 'lucide-react';
|
|
3
3
|
interface AttachmentProps {
|
|
4
|
+
pending?: boolean;
|
|
4
5
|
uid?: string;
|
|
5
6
|
url?: string;
|
|
6
7
|
mimeType?: string;
|
|
7
|
-
|
|
8
|
-
onReady?: (skipOnce?: boolean) => void;
|
|
8
|
+
onReady?: () => void;
|
|
9
9
|
linkProps?: AttachmentLinkProps;
|
|
10
10
|
containerProps?: React.ComponentProps<'div'>;
|
|
11
11
|
}
|
|
12
|
-
interface AttachmentLinkProps extends React.ComponentProps<'a'>, Omit<AttachmentProps, 'containerProps' & 'mimeType'
|
|
13
|
-
children?: React.ReactNode;
|
|
12
|
+
interface AttachmentLinkProps extends React.ComponentProps<'a'>, Omit<AttachmentProps, 'containerProps' & 'mimeType'> {
|
|
14
13
|
}
|
|
15
14
|
interface AttachmentImageProps extends React.ComponentProps<'img'>, Omit<AttachmentProps, 'containerProps' & 'mimeType'> {
|
|
16
15
|
}
|
|
17
|
-
interface AttachmentAudioProps extends React.ComponentProps<'audio'>, Omit<AttachmentProps, 'linkProps' & 'mimeType'
|
|
16
|
+
interface AttachmentAudioProps extends React.ComponentProps<'audio'>, Omit<AttachmentProps, 'linkProps' & 'mimeType'> {
|
|
18
17
|
}
|
|
19
18
|
interface AttachmentVideoProps extends React.ComponentProps<'video'>, Omit<AttachmentProps, 'linkProps' & 'mimeType'> {
|
|
20
19
|
maxSize?: number;
|
|
@@ -39,7 +38,7 @@ declare function AttachmentFailed({ name, pending, iconElement, containerProps,
|
|
|
39
38
|
declare namespace AttachmentFailed {
|
|
40
39
|
var displayName: string;
|
|
41
40
|
}
|
|
42
|
-
declare function AttachmentBase({ mimeType, ...props }: AttachmentProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function AttachmentBase({ mimeType, onReady, containerProps, linkProps, ...props }: AttachmentProps): import("react/jsx-runtime").JSX.Element;
|
|
43
42
|
declare const Attachment: React.MemoExoticComponent<typeof AttachmentBase>;
|
|
44
43
|
export { Attachment, AttachmentLink, AttachmentImage, AttachmentAudio, AttachmentVideo, AttachmentFile, AttachmentFailed, type AttachmentLinkProps, type AttachmentImageProps, type AttachmentAudioProps, type AttachmentVideoProps, type AttachmentFileProps, type AttachmentFailedProps, type AttachmentProps, };
|
|
45
44
|
//# sourceMappingURL=attachment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../src/components/attachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAInE,UAAU,eA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/B;AAED,UAAU,qBAAsB,SAAQ,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,UAAU,CAAC;IAClG,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAwBD,QAAA,MAAM,cAAc,4GAAyE,CAAC;AAqB9F,QAAA,MAAM,eAAe,4GAA0E,CAAC;AAmDhG,QAAA,MAAM,eAAe,4GAA0E,CAAC;AAgChG,QAAA,MAAM,eAAe,4GAA0E,CAAC;AAIhG,iBAAS,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAe,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CA2B5G;kBA3BQ,cAAc;;;AA+BvB,iBAAS,gBAAgB,CAAC,EACxB,IAAqB,EACrB,OAAe,EACf,WAAW,EACX,cAAc,EACd,GAAG,KAAK,EACT,EAAE,qBAAqB,2CAkBvB;kBAxBQ,gBAAgB;;;AA4BzB,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,OAAkB,EAClB,cAAmB,EACnB,SAAc,EACd,GAAG,KAAK,EACT,EAAE,eAAe,2CAiBjB;AAED,QAAA,MAAM,UAAU,kDAAuB,CAAC;AAIxC,OAAO,EACL,UAAU,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,GACrB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type AvatarProps } from './avatar';
|
|
3
|
+
import { type FormattedDateProps } from './formatted-date';
|
|
4
|
+
import { type StatusSentProps } from './status-sent';
|
|
5
|
+
interface ChatBubbleProps extends React.ComponentProps<'div'> {
|
|
6
|
+
onView?: () => void;
|
|
7
|
+
isLast?: boolean;
|
|
8
|
+
date?: FormattedDateProps['date'];
|
|
9
|
+
language?: FormattedDateProps['language'];
|
|
10
|
+
formattedDateProps?: FormattedDateProps;
|
|
11
|
+
}
|
|
12
|
+
interface ChatBubbleMessageProps extends ChatBubbleProps {
|
|
13
|
+
fromMe: boolean;
|
|
14
|
+
sameSenderAbove: boolean;
|
|
15
|
+
title?: string;
|
|
16
|
+
senderName?: string;
|
|
17
|
+
senderAvatar?: AvatarProps['src'];
|
|
18
|
+
statusSent?: StatusSentProps['status'];
|
|
19
|
+
avatarProps?: AvatarProps;
|
|
20
|
+
bubbleProps?: React.ComponentProps<'div'>;
|
|
21
|
+
titleProps?: React.ComponentProps<'span'>;
|
|
22
|
+
statusSentProps?: StatusSentProps;
|
|
23
|
+
}
|
|
24
|
+
interface ChatBubbleInfoProps extends ChatBubbleProps {
|
|
25
|
+
info?: string | undefined;
|
|
26
|
+
iconElement?: React.ReactNode;
|
|
27
|
+
infoProps?: React.ComponentProps<'span'>;
|
|
28
|
+
}
|
|
29
|
+
declare const ChatBubbleMessage: React.NamedExoticComponent<Omit<ChatBubbleMessageProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const ChatBubbleInfo: React.NamedExoticComponent<Omit<ChatBubbleInfoProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export { ChatBubbleMessage, ChatBubbleInfo, type ChatBubbleMessageProps, type ChatBubbleInfoProps };
|
|
32
|
+
//# sourceMappingURL=chat-bubble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-bubble.d.ts","sourceRoot":"","sources":["../../../src/components/chat-bubble.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,E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K,sBAAsB,EAAE,KAAK,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type TextareaAutosizeProps } from 'react-textarea-autosize';
|
|
3
|
+
import { type LucideProps } from 'lucide-react';
|
|
4
|
+
import { type LabelProps } from './label';
|
|
5
|
+
interface ChatInputSendProps extends LabelProps {
|
|
6
|
+
onSend: () => void;
|
|
7
|
+
iconElement?: React.ReactNode;
|
|
8
|
+
iconProps?: LucideProps;
|
|
9
|
+
}
|
|
10
|
+
interface ChatInputProps extends TextareaAutosizeProps, Omit<React.ComponentProps<'textarea'>, 'style'> {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
pending?: boolean;
|
|
13
|
+
draft?: string;
|
|
14
|
+
onSend?: (value?: string) => void;
|
|
15
|
+
onDraft?: (value?: string) => void;
|
|
16
|
+
onTyping?: (typing?: boolean) => void;
|
|
17
|
+
onHeightGrow?: (data: {
|
|
18
|
+
height: number;
|
|
19
|
+
shift: number;
|
|
20
|
+
}) => void;
|
|
21
|
+
hideChatInputSend?: boolean;
|
|
22
|
+
chatInputSendProps?: ChatInputSendProps;
|
|
23
|
+
containerProps?: React.ComponentProps<'div'>;
|
|
24
|
+
}
|
|
25
|
+
declare const ChatInput: React.ForwardRefExoticComponent<Omit<ChatInputProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
26
|
+
export { ChatInput, type ChatInputProps };
|
|
27
|
+
//# sourceMappingURL=chat-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../../src/components/chat-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAyB,EAAE,KAAK,qBAAqB,EAAiC,MAAM,yBAAyB,CAAC;AACtH,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAGjD,UAAU,kBAAmB,SAAQ,UAAU;IAC7C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,UAAU,cAAe,SAAQ,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACjE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CAC9C;AA+ID,QAAA,MAAM,SAAS,yGAAiE,CAAC;AAIjF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VirtualizerProps, type VirtualizerHandle } from 'virtua';
|
|
3
|
+
import { type FilePickerDropzoneProps } from './file-picker';
|
|
4
|
+
import { type QuickActionsProps } from './quick-actions';
|
|
5
|
+
interface ChatListProps extends VirtualizerProps {
|
|
6
|
+
key: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
textareaMeasurement: {
|
|
9
|
+
height: number;
|
|
10
|
+
shift: number;
|
|
11
|
+
};
|
|
12
|
+
offsetToReach?: number;
|
|
13
|
+
onScrollStartReached?: () => void;
|
|
14
|
+
onScrollEndReached?: () => void;
|
|
15
|
+
onListReset?: (prev: string | undefined, next: string | undefined) => void;
|
|
16
|
+
onListCreate?: () => void;
|
|
17
|
+
onListGrow?: () => void;
|
|
18
|
+
enableFilePickerDropzone?: boolean;
|
|
19
|
+
containerProps?: React.ComponentProps<'div'>;
|
|
20
|
+
filePickerDropzoneProps?: FilePickerDropzoneProps;
|
|
21
|
+
quickActionsProps?: QuickActionsProps;
|
|
22
|
+
quickActionsVisible?: boolean;
|
|
23
|
+
minItemsCount?: number;
|
|
24
|
+
}
|
|
25
|
+
interface ChatListHandle extends VirtualizerHandle {
|
|
26
|
+
scrollToBottom: (force?: boolean) => void;
|
|
27
|
+
}
|
|
28
|
+
declare const ChatList: React.ForwardRefExoticComponent<ChatListProps & React.RefAttributes<ChatListHandle>>;
|
|
29
|
+
export { ChatList, type ChatListProps, type ChatListHandle };
|
|
30
|
+
//# sourceMappingURL=chat-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-list.d.ts","sourceRoot":"","sources":["../../../src/components/chat-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoF,MAAM,OAAO,CAAC;AACzG,OAAO,EAAe,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIvE,UAAU,aAAc,SAAQ,gBAAgB;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC3E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,cAAe,SAAQ,iBAAiB;IAChD,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C;AAoID,QAAA,MAAM,QAAQ,sFAA0D,CAAC;AAIzE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
import { type LucideProps } from 'lucide-react';
|
|
4
|
+
interface CheckboxProps extends CheckboxPrimitive.CheckboxProps {
|
|
5
|
+
iconElement?: React.ReactNode;
|
|
6
|
+
iconProps?: LucideProps;
|
|
7
|
+
indicatorProps?: CheckboxPrimitive.CheckboxIndicatorProps;
|
|
8
|
+
}
|
|
9
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export { Checkbox, type CheckboxProps };
|
|
11
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3D,UAAU,aAAc,SAAQ,iBAAiB,CAAC,aAAa;IAC7D,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,cAAc,CAAC,EAAE,iBAAiB,CAAC,sBAAsB,CAAC;CAC3D;AAyBD,QAAA,MAAM,QAAQ,yFAA6D,CAAC;AAI5E,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type VListHandle, type VListProps } from 'virtua';
|
|
3
|
+
interface DialogsListProps extends VListProps {
|
|
4
|
+
pending?: boolean;
|
|
5
|
+
pendingListLength?: number;
|
|
6
|
+
offsetToReach?: number;
|
|
7
|
+
placeholderVisible?: boolean;
|
|
8
|
+
placeholderTitles?: string[];
|
|
9
|
+
onScrollStartReached?: () => void;
|
|
10
|
+
onScrollEndReached?: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const DialogsList: React.ForwardRefExoticComponent<DialogsListProps & React.RefAttributes<VListHandle>>;
|
|
13
|
+
export { DialogsList, type DialogsListProps };
|
|
14
|
+
//# sourceMappingURL=dialogs-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogs-list.d.ts","sourceRoot":"","sources":["../../../src/components/dialogs-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAS,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGlE,UAAU,gBAAiB,SAAQ,UAAU;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAkED,QAAA,MAAM,WAAW,sFAA6D,CAAC;AAI/E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import { LucideProps } from 'lucide-react';
|
|
3
3
|
import { type LabelProps } from './label';
|
|
4
4
|
interface FilePickerInputProps extends React.ComponentProps<'input'> {
|
|
5
|
-
onSelectFile
|
|
5
|
+
onSelectFile?: (files: File[]) => void;
|
|
6
6
|
onInvalidFile?: () => void;
|
|
7
7
|
iconElement?: React.ReactNode;
|
|
8
8
|
labelProps?: LabelProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-picker.d.ts","sourceRoot":"","sources":["../../../src/components/file-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAkB,WAAW,EAAa,MAAM,cAAc,CAAC;AACtE,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAwDjD,UAAU,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAClE,YAAY,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"file-picker.d.ts","sourceRoot":"","sources":["../../../src/components/file-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAkB,WAAW,EAAa,MAAM,cAAc,CAAC;AACtE,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAwDjD,UAAU,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAClE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,UAAU,uBAAwB,SAAQ,oBAAoB;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC5C,yBAAyB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACxD,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;CACjD;AAoDD,QAAA,MAAM,eAAe,4GAA0E,CAAC;AA6FhG,QAAA,MAAM,kBAAkB,6GAA8E,CAAC;AAIvG,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,eAAe,IAAI,KAAK,EACxB,kBAAkB,IAAI,QAAQ,EAC9B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeholder-text.d.ts","sourceRoot":"","sources":["../../../src/components/placeholder-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CACxC;
|
|
1
|
+
{"version":3,"file":"placeholder-text.d.ts","sourceRoot":"","sources":["../../../src/components/placeholder-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CACxC;AA2BD,QAAA,MAAM,eAAe,0GAAkC,CAAC;AAIxD,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface QuickActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: string[];
|
|
6
|
+
onAction?: (action: string) => void;
|
|
7
|
+
containerProps?: React.ComponentProps<'div'>;
|
|
8
|
+
titleProps?: React.ComponentProps<'h2'>;
|
|
9
|
+
descriptionProps?: React.ComponentProps<'span'>;
|
|
10
|
+
actionProps?: React.ComponentProps<'div'>;
|
|
11
|
+
}
|
|
12
|
+
declare const QuickActions: React.ForwardRefExoticComponent<QuickActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { QuickActions, type QuickActionsProps };
|
|
14
|
+
//# sourceMappingURL=quick-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-actions.d.ts","sourceRoot":"","sources":["../../../src/components/quick-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7C,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAChD,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CAC3C;AAwDD,QAAA,MAAM,YAAY,0FAAkE,CAAC;AAIrF,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type LucideProps } from 'lucide-react';
|
|
2
|
+
interface StatusCallProps extends LucideProps {
|
|
3
|
+
fromMe?: boolean;
|
|
4
|
+
status?: 'reject' | 'notAnswer' | 'hungUp' | 'cancel' | undefined;
|
|
5
|
+
}
|
|
6
|
+
declare const StatusCall: React.FC<StatusCallProps>;
|
|
7
|
+
export { StatusCall, type StatusCallProps };
|
|
8
|
+
//# sourceMappingURL=status-call.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-call.d.ts","sourceRoot":"","sources":["../../../src/components/status-call.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGlG,UAAU,eAAgB,SAAQ,WAAW;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;CACnE;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAUzC,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,9 +3,12 @@ export { Attachment, AttachmentLink, AttachmentImage, AttachmentAudio, Attachmen
|
|
|
3
3
|
export { Avatar, type AvatarProps } from './components/avatar';
|
|
4
4
|
export { Badge, type BadgeProps } from './components/badge';
|
|
5
5
|
export { Button, type ButtonProps } from './components/button';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
6
|
+
export { ChatBubbleMessage, ChatBubbleInfo, type ChatBubbleMessageProps, type ChatBubbleInfoProps, } from './components/chat-bubble';
|
|
7
|
+
export { ChatInput, type ChatInputProps } from './components/chat-input';
|
|
8
|
+
export { ChatList, type ChatListProps, type ChatListHandle } from './components/chat-list';
|
|
9
|
+
export { Checkbox, type CheckboxProps } from './components/checkbox';
|
|
8
10
|
export { DialogItem, type DialogItemProps } from './components/dialog-item';
|
|
11
|
+
export { DialogsList, type DialogsListProps } from './components/dialogs-list';
|
|
9
12
|
export { DismissLayer, type DismissLayerProps } from './components/dismiss-layer';
|
|
10
13
|
export { FilePickerInput, FilePickerDropzone, type FilePickerInputProps, type FilePickerDropzoneProps, } from './components/file-picker';
|
|
11
14
|
export { FormattedDate, type FormattedDateProps } from './components/formatted-date';
|
|
@@ -15,8 +18,10 @@ export { LinkPreview, type LinkPreviewProps } from './components/link-preview';
|
|
|
15
18
|
export { LinkifyText, type LinkifyTextProps } from './components/linkify-text';
|
|
16
19
|
export { PlaceholderText, type PlaceholderTextProps } from './components/placeholder-text';
|
|
17
20
|
export { Presence, PresenceBadge, type PresenceStatus, type PresenceProps, type PresenceBadgeProps, } from './components/presence';
|
|
21
|
+
export { QuickActions, type QuickActionsProps } from './components/quick-actions';
|
|
18
22
|
export { Search, type SearchProps } from './components/search';
|
|
19
23
|
export { Spinner, type SpinnerProps } from './components/spinner';
|
|
24
|
+
export { StatusCall, type StatusCallProps } from './components/status-call';
|
|
20
25
|
export { StatusIndicator, type StatusName, type StatusIndicatorProps } from './components/status-indicator';
|
|
21
26
|
export { StatusSent, type StatusSentProps } from './components/status-sent';
|
|
22
27
|
export { StreamView, LocalStreamView, RemoteStreamView, FullscreenStreamView, type StreamViewProps, type FullscreenStreamViewProps, type FullscreenStreamViewRef, } from './components/stream-view';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE/E,OAAO,EACL,UAAU,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,2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perativeHandle(ref, () => playerRef.current, []);
|
|
76
|
+
useImperativeHandle(ref, () => playerRef.current || {}, []);
|
|
77
77
|
|
|
78
78
|
return (
|
|
79
79
|
<div
|
|
@@ -182,7 +182,7 @@ function AttachmentFailed({ name = 'Unknown file', pending = false, iconElement,
|
|
|
182
182
|
|
|
183
183
|
AttachmentFailed.displayName = 'AttachmentFailed';
|
|
184
184
|
|
|
185
|
-
function AttachmentBase({ mimeType, ...props }) {
|
|
185
|
+
function AttachmentBase({ mimeType, onReady = () => {}, containerProps = {}, linkProps = {}, ...props }) {
|
|
186
186
|
const [type = ''] = mimeType?.split('/') || [];
|
|
187
187
|
|
|
188
188
|
if (!props.url) {
|
|
@@ -191,13 +191,13 @@ function AttachmentBase({ mimeType, ...props }) {
|
|
|
191
191
|
|
|
192
192
|
switch (type) {
|
|
193
193
|
case 'image':
|
|
194
|
-
return <AttachmentImage {...props} />;
|
|
194
|
+
return <AttachmentImage onReady={onReady} linkProps={linkProps} {...props} />;
|
|
195
195
|
case 'video':
|
|
196
|
-
return <AttachmentVideo {...props} />;
|
|
196
|
+
return <AttachmentVideo onReady={onReady} containerProps={containerProps} {...props} />;
|
|
197
197
|
case 'audio':
|
|
198
|
-
return <AttachmentAudio {...props} />;
|
|
198
|
+
return <AttachmentAudio containerProps={containerProps} {...props} />;
|
|
199
199
|
default:
|
|
200
|
-
return <AttachmentFile name={mimeType} {...props} />;
|
|
200
|
+
return <AttachmentFile name={mimeType} containerProps={containerProps} {...props} />;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -1,70 +1,69 @@
|
|
|
1
1
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
2
2
|
import { useInView } from 'react-intersection-observer';
|
|
3
|
-
import { Attachment } from './attachment';
|
|
4
3
|
import { Avatar } from './avatar';
|
|
5
4
|
import { FormattedDate } from './formatted-date';
|
|
6
|
-
import { LinkifyText } from './linkify-text';
|
|
7
|
-
import { LinkPreview } from './link-preview';
|
|
8
5
|
import { StatusSent } from './status-sent';
|
|
9
6
|
import { cn } from './utils';
|
|
10
7
|
|
|
11
|
-
function
|
|
8
|
+
function ChatBubbleBase({ onView = () => {}, isLast, children, ...props }, ref) {
|
|
9
|
+
const [setRef, inView] = useInView();
|
|
10
|
+
const messageRef = useRef(null);
|
|
11
|
+
const setRefs = useCallback(
|
|
12
|
+
(node) => {
|
|
13
|
+
messageRef.current = node;
|
|
14
|
+
setRef(node);
|
|
15
|
+
},
|
|
16
|
+
[setRef]
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (inView) {
|
|
21
|
+
onView();
|
|
22
|
+
}
|
|
23
|
+
}, [inView, onView]);
|
|
24
|
+
|
|
25
|
+
useImperativeHandle(ref, () => messageRef.current || {}, []);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div ref={setRefs} {...props} className={cn('mt-2', isLast && 'mb-2', inView && 'view', props?.className)}>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const ChatBubble = forwardRef(ChatBubbleBase);
|
|
35
|
+
|
|
36
|
+
function ChatBubbleMessageBase(
|
|
12
37
|
{
|
|
13
|
-
isLast,
|
|
14
38
|
fromMe,
|
|
15
39
|
sameSenderAbove,
|
|
16
40
|
title,
|
|
17
41
|
senderName,
|
|
18
42
|
senderAvatar,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onView = () => {},
|
|
43
|
+
date = new Date(),
|
|
44
|
+
language = 'en',
|
|
45
|
+
statusSent,
|
|
23
46
|
avatarProps,
|
|
24
47
|
bubbleProps,
|
|
25
48
|
titleProps,
|
|
26
49
|
formattedDateProps,
|
|
27
50
|
statusSentProps,
|
|
28
|
-
attachmentProps,
|
|
29
|
-
linkifyTextProps,
|
|
30
|
-
linkPreviewProps,
|
|
31
51
|
children,
|
|
32
52
|
...props
|
|
33
53
|
},
|
|
34
54
|
ref
|
|
35
55
|
) {
|
|
36
|
-
const [setRef, inView] = useInView();
|
|
37
|
-
const messageRef = useRef(null);
|
|
38
|
-
const setRefs = useCallback(
|
|
39
|
-
(node) => {
|
|
40
|
-
messageRef.current = node;
|
|
41
|
-
setRef(node);
|
|
42
|
-
},
|
|
43
|
-
[setRef]
|
|
44
|
-
);
|
|
45
56
|
const hasAvatar = Boolean((avatarProps || senderAvatar) && !sameSenderAbove);
|
|
46
57
|
const hasAvatarMargin = Boolean((avatarProps || senderAvatar) && sameSenderAbove);
|
|
47
|
-
const hasThinMarginTop = hasAvatarMargin || Boolean(fromMe && sameSenderAbove);
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (inView) {
|
|
51
|
-
onView();
|
|
52
|
-
}
|
|
53
|
-
}, [inView, onView]);
|
|
54
|
-
|
|
55
|
-
useImperativeHandle(ref, () => messageRef.current, []);
|
|
56
58
|
|
|
57
59
|
return (
|
|
58
|
-
<
|
|
59
|
-
ref={
|
|
60
|
+
<ChatBubble
|
|
61
|
+
ref={ref}
|
|
60
62
|
{...props}
|
|
61
63
|
className={cn(
|
|
62
64
|
`flex relative text-left whitespace-pre-wrap`,
|
|
63
65
|
fromMe ? 'self-end flex-row-reverse ml-12' : `self-start mr-12`,
|
|
64
|
-
|
|
65
|
-
hasThinMarginTop ? 'mt-1' : 'mt-2',
|
|
66
|
-
inView && 'view',
|
|
67
|
-
props?.className
|
|
66
|
+
sameSenderAbove && 'mt-1'
|
|
68
67
|
)}
|
|
69
68
|
>
|
|
70
69
|
{hasAvatar && (
|
|
@@ -72,10 +71,10 @@ function ChatMessageBase(
|
|
|
72
71
|
name={senderName}
|
|
73
72
|
src={senderAvatar}
|
|
74
73
|
imageProps={{
|
|
75
|
-
className: 'bg-
|
|
74
|
+
className: 'bg-blue-200',
|
|
76
75
|
}}
|
|
77
76
|
fallbackProps={{
|
|
78
|
-
className: 'bg-
|
|
77
|
+
className: 'bg-blue-200',
|
|
79
78
|
}}
|
|
80
79
|
{...avatarProps}
|
|
81
80
|
className={cn('mt-1 mr-1', avatarProps?.className)}
|
|
@@ -84,8 +83,8 @@ function ChatMessageBase(
|
|
|
84
83
|
|
|
85
84
|
<div
|
|
86
85
|
className={cn(
|
|
87
|
-
'relative flex flex-col min-w-42 max-w-120 rounded-xl px-2 pt-2 pb-6',
|
|
88
|
-
fromMe ? 'bg-
|
|
86
|
+
'relative flex flex-col min-w-42 max-w-120 rounded-xl px-2 pt-2 pb-6 shadow-sm',
|
|
87
|
+
fromMe ? 'bg-gray-200' : 'bg-blue-200',
|
|
89
88
|
hasAvatarMargin && 'ml-9',
|
|
90
89
|
bubbleProps?.className
|
|
91
90
|
)}
|
|
@@ -103,18 +102,40 @@ function ChatMessageBase(
|
|
|
103
102
|
</span>
|
|
104
103
|
)}
|
|
105
104
|
{children}
|
|
106
|
-
{attachmentElement || (attachmentProps ? <Attachment {...attachmentProps} /> : null)}
|
|
107
|
-
{linkifyTextElement || (linkifyTextProps ? <LinkifyText {...linkifyTextProps} /> : null)}
|
|
108
|
-
{linkPreviewElement || (linkPreviewProps ? <LinkPreview {...linkPreviewProps} /> : null)}
|
|
109
105
|
<div className="absolute bottom-1 right-2 flex items-center gap-1 italic">
|
|
110
|
-
<FormattedDate distanceToNow {...formattedDateProps} />
|
|
111
|
-
<StatusSent {...statusSentProps} />
|
|
106
|
+
<FormattedDate date={date} language={language} distanceToNow {...formattedDateProps} />
|
|
107
|
+
<StatusSent status={statusSent} {...statusSentProps} />
|
|
112
108
|
</div>
|
|
113
109
|
</div>
|
|
114
|
-
</
|
|
110
|
+
</ChatBubble>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const ChatBubbleMessage = memo(forwardRef(ChatBubbleMessageBase));
|
|
115
|
+
|
|
116
|
+
ChatBubbleMessage.displayName = 'ChatBubbleMessage';
|
|
117
|
+
|
|
118
|
+
function ChatBubbleInfoBase(
|
|
119
|
+
{ info = '', iconElement, date = new Date(), language = 'en', infoProps, formattedDateProps, ...props },
|
|
120
|
+
ref
|
|
121
|
+
) {
|
|
122
|
+
return (
|
|
123
|
+
<ChatBubble
|
|
124
|
+
ref={ref}
|
|
125
|
+
{...props}
|
|
126
|
+
className={cn('flex items-center justify-center gap-2 rounded-full w-fit bg-ring/20 mx-auto px-3 py-1.5 mt-2')}
|
|
127
|
+
>
|
|
128
|
+
{iconElement}
|
|
129
|
+
<span {...infoProps} className={cn('text-sm mb-px', infoProps?.className)}>
|
|
130
|
+
{info}
|
|
131
|
+
</span>
|
|
132
|
+
<FormattedDate date={date} language={language} distanceToNow {...formattedDateProps} />
|
|
133
|
+
</ChatBubble>
|
|
115
134
|
);
|
|
116
135
|
}
|
|
117
136
|
|
|
118
|
-
const
|
|
137
|
+
const ChatBubbleInfo = memo(forwardRef(ChatBubbleInfoBase));
|
|
138
|
+
|
|
139
|
+
ChatBubbleInfo.displayName = 'ChatBubbleInfo';
|
|
119
140
|
|
|
120
|
-
export {
|
|
141
|
+
export { ChatBubbleMessage, ChatBubbleInfo };
|