@connectycube/react-ui-kit 0.0.22 → 0.1.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 +33 -6
- package/gen/components/alert-dialog.jsx +2 -2
- package/gen/components/attachment.jsx +10 -11
- package/gen/components/avatar.jsx +2 -2
- package/gen/components/badge.jsx +2 -2
- package/gen/components/button.jsx +4 -3
- package/gen/components/chat-bubble.jsx +8 -8
- package/gen/components/chat-input.jsx +10 -10
- package/gen/components/chat-list.jsx +13 -13
- package/gen/components/checkbox.jsx +2 -2
- package/gen/components/dialog-item.jsx +2 -2
- package/gen/components/dialogs-list.jsx +4 -4
- package/gen/components/dismiss-layer.jsx +7 -7
- package/gen/components/file-picker.jsx +4 -4
- package/gen/components/formatted-date.jsx +2 -2
- package/gen/components/input.jsx +2 -2
- package/gen/components/label.jsx +2 -2
- package/gen/components/link-preview.jsx +7 -7
- package/gen/components/linkify-text.jsx +5 -5
- package/gen/components/placeholder-text.jsx +1 -2
- package/gen/components/presence.jsx +1 -0
- package/gen/components/quick-actions.jsx +2 -2
- package/gen/components/search.jsx +3 -3
- package/gen/components/spinner.jsx +3 -2
- package/gen/components/status-call.jsx +1 -0
- package/gen/components/status-indicator.jsx +2 -2
- package/gen/components/status-sent.jsx +1 -0
- package/gen/components/stream-view.jsx +16 -16
- package/package.json +14 -14
- package/src/components/alert-dialog.tsx +2 -3
- package/src/components/attachment.tsx +12 -13
- package/src/components/avatar.tsx +2 -3
- package/src/components/badge.tsx +2 -3
- package/src/components/button.tsx +4 -4
- package/src/components/chat-bubble.tsx +9 -10
- package/src/components/chat-input.tsx +17 -13
- package/src/components/chat-list.tsx +31 -24
- package/src/components/checkbox.tsx +2 -3
- package/src/components/dialog-item.tsx +2 -3
- package/src/components/dialogs-list.tsx +4 -5
- package/src/components/dismiss-layer.tsx +7 -8
- package/src/components/file-picker.tsx +4 -5
- package/src/components/formatted-date.tsx +4 -3
- package/src/components/input.tsx +2 -3
- package/src/components/label.tsx +2 -3
- package/src/components/link-preview.tsx +16 -26
- package/src/components/linkify-text.tsx +5 -6
- package/src/components/placeholder-text.tsx +1 -2
- package/src/components/presence.tsx +1 -1
- package/src/components/quick-actions.tsx +2 -3
- package/src/components/search.tsx +3 -4
- package/src/components/spinner.tsx +3 -2
- package/src/components/status-call.tsx +1 -0
- package/src/components/status-indicator.tsx +2 -3
- package/src/components/status-sent.tsx +1 -0
- package/src/components/stream-view.tsx +18 -17
- package/src/components/connectycube-ui/attachment.tsx +0 -269
- package/src/components/connectycube-ui/avatar.jsx +0 -54
- package/src/components/connectycube-ui/avatar.tsx +0 -77
- package/src/components/connectycube-ui/badge.jsx +0 -45
- package/src/components/connectycube-ui/badge.tsx +0 -42
- package/src/components/connectycube-ui/chat-input.tsx +0 -174
- package/src/components/connectycube-ui/chat-message.tsx +0 -138
- package/src/components/connectycube-ui/dialog-item.jsx +0 -149
- package/src/components/connectycube-ui/dialog-item.tsx +0 -188
- package/src/components/connectycube-ui/file-picker.jsx +0 -200
- package/src/components/connectycube-ui/file-picker.tsx +0 -231
- package/src/components/connectycube-ui/formatted-date.jsx +0 -57
- package/src/components/connectycube-ui/formatted-date.tsx +0 -57
- package/src/components/connectycube-ui/label.jsx +0 -22
- package/src/components/connectycube-ui/label.tsx +0 -23
- package/src/components/connectycube-ui/link-preview.tsx +0 -149
- package/src/components/connectycube-ui/linkify-text.tsx +0 -40
- package/src/components/connectycube-ui/presence.jsx +0 -81
- package/src/components/connectycube-ui/presence.tsx +0 -96
- package/src/components/connectycube-ui/status-sent.jsx +0 -21
- package/src/components/connectycube-ui/status-sent.tsx +0 -25
- package/src/components/connectycube-ui/utils.js +0 -10
- package/src/components/connectycube-ui/utils.ts +0 -10
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { capitalize, cn } from './utils';
|
|
3
|
-
|
|
4
|
-
type PresenceStatus = 'available' | 'busy' | 'away' | 'unknown' | undefined;
|
|
5
|
-
|
|
6
|
-
interface PresenceProps extends React.ComponentProps<'div'> {
|
|
7
|
-
badge?: boolean;
|
|
8
|
-
status: PresenceStatus;
|
|
9
|
-
label: string;
|
|
10
|
-
badgeProps?: PresenceBadgeProps;
|
|
11
|
-
labelProps?: React.ComponentProps<'span'>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface PresenceBadgeProps extends React.ComponentProps<'svg'> {
|
|
15
|
-
status?: PresenceStatus;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function PresenceBadge({ status, ...props }: PresenceBadgeProps) {
|
|
19
|
-
switch (status) {
|
|
20
|
-
case 'available':
|
|
21
|
-
return (
|
|
22
|
-
<svg
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
width="16"
|
|
25
|
-
height="16"
|
|
26
|
-
fill="currentColor"
|
|
27
|
-
viewBox="0 0 16 16"
|
|
28
|
-
{...props}
|
|
29
|
-
className={cn('rounded-full size-4.5 text-green-600 bg-white', props?.className)}
|
|
30
|
-
>
|
|
31
|
-
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z" />
|
|
32
|
-
</svg>
|
|
33
|
-
);
|
|
34
|
-
case 'busy':
|
|
35
|
-
return (
|
|
36
|
-
<svg
|
|
37
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
-
width="16"
|
|
39
|
-
height="16"
|
|
40
|
-
fill="currentColor"
|
|
41
|
-
viewBox="0 0 16 16"
|
|
42
|
-
{...props}
|
|
43
|
-
className={cn('rounded-full size-4.5 text-red-600 bg-white', props?.className)}
|
|
44
|
-
>
|
|
45
|
-
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1z" />
|
|
46
|
-
</svg>
|
|
47
|
-
);
|
|
48
|
-
case 'away':
|
|
49
|
-
return (
|
|
50
|
-
<svg
|
|
51
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
-
width="16"
|
|
53
|
-
height="16"
|
|
54
|
-
fill="currentColor"
|
|
55
|
-
viewBox="0 0 16 16"
|
|
56
|
-
{...props}
|
|
57
|
-
className={cn('rounded-full size-4.5 text-yellow-500 bg-white', props?.className)}
|
|
58
|
-
>
|
|
59
|
-
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z" />
|
|
60
|
-
</svg>
|
|
61
|
-
);
|
|
62
|
-
case 'unknown':
|
|
63
|
-
return (
|
|
64
|
-
<svg
|
|
65
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
66
|
-
width="16"
|
|
67
|
-
height="16"
|
|
68
|
-
fill="currentColor"
|
|
69
|
-
viewBox="0 0 16 16"
|
|
70
|
-
{...props}
|
|
71
|
-
className={cn('rounded-full size-4.5 text-gray-500 bg-white', props?.className)}
|
|
72
|
-
>
|
|
73
|
-
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247m2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z" />
|
|
74
|
-
</svg>
|
|
75
|
-
);
|
|
76
|
-
default:
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
PresenceBadge.displayName = 'PresenceBadge';
|
|
82
|
-
|
|
83
|
-
function Presence({ badge = true, status, label, badgeProps, labelProps, ...props }: PresenceProps) {
|
|
84
|
-
const presence = capitalize(label || status);
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<div {...props} className={cn('flex items-center gap-2', props?.className)}>
|
|
88
|
-
{badge && <PresenceBadge status={status} {...badgeProps} />}
|
|
89
|
-
<span {...labelProps}>{presence}</span>
|
|
90
|
-
</div>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
Presence.displayName = 'Presence';
|
|
95
|
-
|
|
96
|
-
export { Presence, PresenceBadge, type PresenceStatus, type PresenceProps, type PresenceBadgeProps };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Ban, Check, CheckCheck, Clock } from 'lucide-react';
|
|
2
|
-
import { cn } from './utils';
|
|
3
|
-
|
|
4
|
-
const StatusSent = ({ status, ...props }) => {
|
|
5
|
-
switch (status) {
|
|
6
|
-
case 'wait':
|
|
7
|
-
return <Clock {...props} className={cn('text-gray-500 size-4', props?.className)} />;
|
|
8
|
-
case 'sent':
|
|
9
|
-
return <Check {...props} className={cn('text-gray-500 size-4', props?.className)} />;
|
|
10
|
-
case 'read':
|
|
11
|
-
return <CheckCheck {...props} className={cn('text-gray-500 size-4', props?.className)} />;
|
|
12
|
-
case 'lost':
|
|
13
|
-
return <Ban {...props} className={cn('text-red-500 size-4', props?.className)} />;
|
|
14
|
-
default:
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
StatusSent.displayName = 'StatusSent';
|
|
20
|
-
|
|
21
|
-
export { StatusSent };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Ban, Check, CheckCheck, Clock, type LucideProps } from 'lucide-react';
|
|
2
|
-
import { cn } from './utils';
|
|
3
|
-
|
|
4
|
-
interface StatusSentProps extends LucideProps {
|
|
5
|
-
status?: 'wait' | 'sent' | 'read' | 'lost' | null;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const StatusSent: React.FC<StatusSentProps> = ({ status, ...props }) => {
|
|
9
|
-
switch (status) {
|
|
10
|
-
case 'wait':
|
|
11
|
-
return <Clock {...props} className={cn('text-gray-500 size-4', props?.className)} />;
|
|
12
|
-
case 'sent':
|
|
13
|
-
return <Check {...props} className={cn('text-gray-500 size-4', props?.className)} />;
|
|
14
|
-
case 'read':
|
|
15
|
-
return <CheckCheck {...props} className={cn('text-gray-500 size-4', props?.className)} />;
|
|
16
|
-
case 'lost':
|
|
17
|
-
return <Ban {...props} className={cn('text-red-500 size-4', props?.className)} />;
|
|
18
|
-
default:
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
StatusSent.displayName = 'StatusSent';
|
|
24
|
-
|
|
25
|
-
export { StatusSent, type StatusSentProps };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
export function cn(...inputs) {
|
|
5
|
-
return twMerge(clsx(inputs));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function capitalize(str) {
|
|
9
|
-
return typeof str === 'string' && str.length > 0 ? `${str[0]?.toUpperCase()}${str.slice(1)}` : '';
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from 'clsx';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
export function cn(...inputs: ClassValue[]) {
|
|
5
|
-
return twMerge(clsx(inputs));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function capitalize(str?: string): string {
|
|
9
|
-
return typeof str === 'string' && str.length > 0 ? `${str[0]?.toUpperCase()}${str.slice(1)}` : '';
|
|
10
|
-
}
|