@connectycube/react-ui-kit 0.0.19 → 0.0.22
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/configs/dependencies.json +21 -0
- package/configs/imports.json +7 -0
- package/dist/index.cjs +1 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -35
- package/dist/index.js.map +1 -1
- package/dist/types/components/attachment.d.ts +7 -8
- package/dist/types/components/attachment.d.ts.map +1 -1
- package/dist/types/components/avatar.d.ts +1 -0
- package/dist/types/components/avatar.d.ts.map +1 -1
- package/dist/types/components/badge.d.ts +1 -1
- package/dist/types/components/button.d.ts +2 -2
- 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/dialog-item.d.ts.map +1 -1
- 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/linkify-text.d.ts +6 -1
- package/dist/types/components/linkify-text.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/components/switch.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/gen/components/attachment.jsx +27 -25
- package/gen/components/avatar.jsx +14 -2
- package/gen/components/button.jsx +1 -1
- package/gen/components/chat-bubble.jsx +141 -0
- 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 +5 -2
- 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/linkify-text.jsx +41 -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/components/switch.jsx +0 -2
- package/gen/index.js +16 -0
- package/package.json +17 -13
- package/src/components/attachment.tsx +38 -37
- package/src/components/avatar.tsx +3 -1
- 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/attachment.tsx +269 -0
- package/src/components/connectycube-ui/chat-input.tsx +174 -0
- package/src/components/connectycube-ui/chat-message.tsx +138 -0
- package/src/components/connectycube-ui/link-preview.tsx +149 -0
- package/src/components/dialog-item.tsx +5 -2
- 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/linkify-text.tsx +44 -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/components/switch.tsx +0 -2
- package/src/index.ts +21 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { cn } from './utils';
|
|
4
|
+
|
|
5
|
+
interface QuickActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: string[];
|
|
9
|
+
onAction?: (action: string) => void;
|
|
10
|
+
containerProps?: React.ComponentProps<'div'>;
|
|
11
|
+
titleProps?: React.ComponentProps<'h2'>;
|
|
12
|
+
descriptionProps?: React.ComponentProps<'span'>;
|
|
13
|
+
actionProps?: React.ComponentProps<'div'>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function QuickActionsBase(
|
|
17
|
+
{
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
actions = [],
|
|
21
|
+
onAction = () => {},
|
|
22
|
+
containerProps,
|
|
23
|
+
titleProps,
|
|
24
|
+
descriptionProps,
|
|
25
|
+
actionProps,
|
|
26
|
+
...props
|
|
27
|
+
}: QuickActionsProps,
|
|
28
|
+
ref: React.ForwardedRef<HTMLDivElement>
|
|
29
|
+
) {
|
|
30
|
+
if (!actions.length) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
ref={ref}
|
|
37
|
+
{...containerProps}
|
|
38
|
+
className={cn('flex flex-col h-full overflow-y-auto py-2', containerProps?.className)}
|
|
39
|
+
>
|
|
40
|
+
<div className="grow" />
|
|
41
|
+
<div {...props} className={cn('grid gap-2 m-4', props?.className)}>
|
|
42
|
+
{title && (
|
|
43
|
+
<h2 {...titleProps} className={cn('font-medium text-foreground text-lg', titleProps?.className)}>
|
|
44
|
+
{title}
|
|
45
|
+
</h2>
|
|
46
|
+
)}
|
|
47
|
+
{description && (
|
|
48
|
+
<span {...descriptionProps} className={cn('text-sm text-muted-foreground mb-4', descriptionProps?.className)}>
|
|
49
|
+
{description}
|
|
50
|
+
</span>
|
|
51
|
+
)}
|
|
52
|
+
{actions.map((action, index) => (
|
|
53
|
+
<div
|
|
54
|
+
key={index}
|
|
55
|
+
{...actionProps}
|
|
56
|
+
className={cn(
|
|
57
|
+
'w-full border p-2 rounded-md wrap-break-word cursor-pointer overflow-hidden text-ellipsis bg-ring/5 hover:bg-ring/20 transition-colors duration-200 ease-out',
|
|
58
|
+
actionProps?.className
|
|
59
|
+
)}
|
|
60
|
+
onClick={() => onAction(action)}
|
|
61
|
+
>
|
|
62
|
+
{action}
|
|
63
|
+
</div>
|
|
64
|
+
))}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const QuickActions = forwardRef<HTMLDivElement, QuickActionsProps>(QuickActionsBase);
|
|
71
|
+
|
|
72
|
+
QuickActions.displayName = 'QuickActions';
|
|
73
|
+
|
|
74
|
+
export { QuickActions, type QuickActionsProps };
|
|
@@ -69,7 +69,7 @@ function SearchBase(
|
|
|
69
69
|
onClick={handleOnCancel}
|
|
70
70
|
{...cancelIconProps}
|
|
71
71
|
className={cn(
|
|
72
|
-
'absolute top-1/2 right-2 transform -translate-y-1/2 size-5 text-muted-foreground cursor-pointer hover:text-ring transition-all duration-300 ease-
|
|
72
|
+
'absolute top-1/2 right-2 transform -translate-y-1/2 size-5 text-muted-foreground cursor-pointer hover:text-ring transition-all duration-300 ease-out',
|
|
73
73
|
value.length > 0 ? 'opacity-100 scale-100' : 'opacity-0 scale-75 pointer-events-none',
|
|
74
74
|
cancelIconProps?.className
|
|
75
75
|
)}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Phone, PhoneIncoming, PhoneMissed, PhoneOutgoing, type LucideProps } from 'lucide-react';
|
|
2
|
+
import { cn } from './utils';
|
|
3
|
+
|
|
4
|
+
interface StatusCallProps extends LucideProps {
|
|
5
|
+
fromMe?: boolean;
|
|
6
|
+
status?: 'reject' | 'notAnswer' | 'hungUp' | 'cancel' | undefined;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const StatusCall: React.FC<StatusCallProps> = ({ fromMe, status, ...props }) => {
|
|
10
|
+
const CallIcon =
|
|
11
|
+
status === 'hungUp' ? Phone : fromMe ? PhoneOutgoing : status === 'reject' ? PhoneIncoming : PhoneMissed;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<CallIcon
|
|
15
|
+
{...props}
|
|
16
|
+
className={cn('size-4', status === 'hungUp' ? 'text-green-500' : 'text-red-500', props?.className)}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
StatusCall.displayName = 'StatusCall';
|
|
22
|
+
|
|
23
|
+
export { StatusCall, type StatusCallProps };
|
|
@@ -18,7 +18,7 @@ function StreamViewBase(
|
|
|
18
18
|
const defaultClassName = 'size-full object-contain';
|
|
19
19
|
const mirrorClassName = mirror ? 'scale-x-[-1]' : '';
|
|
20
20
|
|
|
21
|
-
useImperativeHandle(ref, () => innerRef.current
|
|
21
|
+
useImperativeHandle(ref, () => innerRef.current || ({} as HTMLVideoElement), []);
|
|
22
22
|
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
if (innerRef.current && stream) {
|
|
@@ -146,13 +146,13 @@ function FullscreenStreamViewBase(
|
|
|
146
146
|
|
|
147
147
|
useImperativeHandle(
|
|
148
148
|
ref,
|
|
149
|
-
() =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
149
|
+
() => ({
|
|
150
|
+
...(innerRef.current || ({} as HTMLDivElement)),
|
|
151
|
+
isFullscreen,
|
|
152
|
+
isPictureInPicture,
|
|
153
|
+
toggleFullscreen,
|
|
154
|
+
togglePictureInPicture,
|
|
155
|
+
}),
|
|
156
156
|
[isFullscreen, isPictureInPicture, toggleFullscreen, togglePictureInPicture]
|
|
157
157
|
);
|
|
158
158
|
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { AlertDialog, type AlertDialogProps } from './components/alert-dialog';
|
|
2
|
+
|
|
1
3
|
export {
|
|
2
4
|
Attachment,
|
|
3
5
|
AttachmentLink,
|
|
@@ -21,8 +23,23 @@ export { Badge, type BadgeProps } from './components/badge';
|
|
|
21
23
|
|
|
22
24
|
export { Button, type ButtonProps } from './components/button';
|
|
23
25
|
|
|
26
|
+
export {
|
|
27
|
+
ChatBubbleMessage,
|
|
28
|
+
ChatBubbleInfo,
|
|
29
|
+
type ChatBubbleMessageProps,
|
|
30
|
+
type ChatBubbleInfoProps,
|
|
31
|
+
} from './components/chat-bubble';
|
|
32
|
+
|
|
33
|
+
export { ChatInput, type ChatInputProps } from './components/chat-input';
|
|
34
|
+
|
|
35
|
+
export { ChatList, type ChatListProps, type ChatListHandle } from './components/chat-list';
|
|
36
|
+
|
|
37
|
+
export { Checkbox, type CheckboxProps } from './components/checkbox';
|
|
38
|
+
|
|
24
39
|
export { DialogItem, type DialogItemProps } from './components/dialog-item';
|
|
25
40
|
|
|
41
|
+
export { DialogsList, type DialogsListProps } from './components/dialogs-list';
|
|
42
|
+
|
|
26
43
|
export { DismissLayer, type DismissLayerProps } from './components/dismiss-layer';
|
|
27
44
|
|
|
28
45
|
export {
|
|
@@ -52,10 +69,14 @@ export {
|
|
|
52
69
|
type PresenceBadgeProps,
|
|
53
70
|
} from './components/presence';
|
|
54
71
|
|
|
72
|
+
export { QuickActions, type QuickActionsProps } from './components/quick-actions';
|
|
73
|
+
|
|
55
74
|
export { Search, type SearchProps } from './components/search';
|
|
56
75
|
|
|
57
76
|
export { Spinner, type SpinnerProps } from './components/spinner';
|
|
58
77
|
|
|
78
|
+
export { StatusCall, type StatusCallProps } from './components/status-call';
|
|
79
|
+
|
|
59
80
|
export { StatusIndicator, type StatusName, type StatusIndicatorProps } from './components/status-indicator';
|
|
60
81
|
|
|
61
82
|
export { StatusSent, type StatusSentProps } from './components/status-sent';
|