@connectycube/react-ui-kit 0.0.17 → 0.0.18
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.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/components/avatar.d.ts +2 -2
- package/dist/types/components/avatar.d.ts.map +1 -1
- package/dist/types/components/badge.d.ts +2 -2
- package/dist/types/components/badge.d.ts.map +1 -1
- package/dist/types/components/dialog-item.d.ts +46 -0
- package/dist/types/components/dialog-item.d.ts.map +1 -0
- package/dist/types/components/file-picker.d.ts +22 -0
- package/dist/types/components/file-picker.d.ts.map +1 -0
- package/dist/types/components/formatted-date.d.ts +8 -0
- package/dist/types/components/formatted-date.d.ts.map +1 -0
- package/dist/types/components/input.d.ts.map +1 -1
- package/dist/types/components/label.d.ts +5 -0
- package/dist/types/components/label.d.ts.map +1 -0
- package/dist/types/components/link-preview.d.ts +21 -0
- package/dist/types/components/link-preview.d.ts.map +1 -0
- package/dist/types/components/linkify-text.d.ts +9 -0
- package/dist/types/components/linkify-text.d.ts.map +1 -0
- package/dist/types/components/spinner.d.ts +3 -1
- package/dist/types/components/spinner.d.ts.map +1 -1
- package/dist/types/components/status-sent.d.ts +7 -0
- package/dist/types/components/status-sent.d.ts.map +1 -0
- package/dist/types/components/stream-view.d.ts.map +1 -1
- package/dist/types/components/utils.d.ts +0 -2
- package/dist/types/components/utils.d.ts.map +1 -1
- package/gen/components/avatar.jsx +13 -3
- package/gen/components/badge.jsx +3 -3
- package/gen/components/button.jsx +2 -2
- package/gen/components/dialog-item.jsx +149 -0
- package/gen/components/file-picker.jsx +200 -0
- package/gen/components/formatted-date.jsx +57 -0
- package/gen/components/label.jsx +22 -0
- package/gen/components/link-preview.jsx +131 -0
- package/gen/components/linkify-text.jsx +31 -0
- package/gen/components/spinner.jsx +29 -5
- package/gen/components/status-sent.jsx +21 -0
- package/gen/components/stream-view.jsx +5 -1
- package/gen/components/utils.js +0 -11
- package/package.json +4 -1
- package/src/components/avatar.tsx +15 -5
- package/src/components/badge.tsx +6 -6
- package/src/components/button.tsx +2 -2
- package/src/components/connectycube-ui/avatar.jsx +54 -0
- package/src/components/connectycube-ui/avatar.tsx +77 -0
- package/src/components/connectycube-ui/badge.jsx +45 -0
- package/src/components/connectycube-ui/badge.tsx +42 -0
- package/src/components/connectycube-ui/dialog-item.jsx +149 -0
- package/src/components/connectycube-ui/dialog-item.tsx +188 -0
- package/src/components/connectycube-ui/file-picker.jsx +200 -0
- package/src/components/connectycube-ui/file-picker.tsx +231 -0
- package/src/components/connectycube-ui/formatted-date.jsx +57 -0
- package/src/components/connectycube-ui/formatted-date.tsx +57 -0
- package/src/components/connectycube-ui/label.jsx +22 -0
- package/src/components/connectycube-ui/label.tsx +23 -0
- package/src/components/connectycube-ui/linkify-text.tsx +40 -0
- package/src/components/connectycube-ui/presence.jsx +81 -0
- package/src/components/connectycube-ui/presence.tsx +96 -0
- package/src/components/connectycube-ui/status-sent.jsx +21 -0
- package/src/components/connectycube-ui/status-sent.tsx +25 -0
- package/src/components/connectycube-ui/utils.js +10 -0
- package/src/components/connectycube-ui/utils.ts +10 -0
- package/src/components/dialog-item.tsx +188 -0
- package/src/components/file-picker.tsx +231 -0
- package/src/components/formatted-date.tsx +57 -0
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +23 -0
- package/src/components/link-preview.tsx +149 -0
- package/src/components/linkify-text.tsx +41 -0
- package/src/components/spinner.tsx +31 -5
- package/src/components/status-sent.tsx +25 -0
- package/src/components/stream-view.tsx +5 -1
- package/src/components/utils.ts +0 -11
|
@@ -2,8 +2,8 @@ import type React from 'react';
|
|
|
2
2
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
3
|
import { type PresenceStatus, type PresenceBadgeProps } from './presence';
|
|
4
4
|
interface AvatarProps extends AvatarPrimitive.AvatarProps {
|
|
5
|
-
src?: string;
|
|
6
|
-
name?: string;
|
|
5
|
+
src?: string | undefined;
|
|
6
|
+
name?: string | undefined;
|
|
7
7
|
online?: boolean;
|
|
8
8
|
presence?: PresenceStatus;
|
|
9
9
|
onlineProps?: React.ComponentProps<'div'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGzF,UAAU,WAAY,SAAQ,eAAe,CAAC,WAAW;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAiB,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGzF,UAAU,WAAY,SAAQ,eAAe,CAAC,WAAW;IACvD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC;IAC9C,aAAa,CAAC,EAAE,eAAe,CAAC,mBAAmB,CAAC;CACrD;AAyDD,QAAA,MAAM,MAAM,+EAA4D,CAAC;AAIzE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
-
interface BadgeProps extends React.HTMLAttributes<
|
|
3
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof badgeVariants> {
|
|
4
4
|
asChild?: boolean;
|
|
5
5
|
}
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
9
|
-
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<
|
|
9
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLElement>>;
|
|
10
10
|
export { Badge, type BadgeProps };
|
|
11
11
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IAChG,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,aAAa;;mFAgBlB,CAAC;AAWF,QAAA,MAAM,KAAK,gFAAiD,CAAC;AAI7D,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type LucideProps } from 'lucide-react';
|
|
3
|
+
import { type AvatarProps } from './avatar';
|
|
4
|
+
import { type PresenceStatus } from './presence';
|
|
5
|
+
import { type StatusSentProps } from './status-sent';
|
|
6
|
+
import { type FormattedDateProps } from './formatted-date';
|
|
7
|
+
import { type BadgeProps } from './badge';
|
|
8
|
+
interface DialogItemProps extends React.ComponentProps<'div'> {
|
|
9
|
+
index?: number;
|
|
10
|
+
isPrivateDialog?: boolean;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
onSelect?: () => void;
|
|
13
|
+
name: string;
|
|
14
|
+
photo?: string;
|
|
15
|
+
userOnline?: boolean;
|
|
16
|
+
userPresence?: PresenceStatus;
|
|
17
|
+
hasGroupIcon?: boolean;
|
|
18
|
+
lastSentStatus?: StatusSentProps['status'];
|
|
19
|
+
lastSentDate?: FormattedDateProps['date'];
|
|
20
|
+
lastSenderName?: string;
|
|
21
|
+
lastMessage?: string;
|
|
22
|
+
typingStatusText?: string;
|
|
23
|
+
draft?: string;
|
|
24
|
+
draftLabel?: string;
|
|
25
|
+
unreadCount?: number;
|
|
26
|
+
language?: string;
|
|
27
|
+
divider?: 'top' | 'bottom' | 'both' | 'none';
|
|
28
|
+
avatarProps?: AvatarProps;
|
|
29
|
+
contentProps?: React.ComponentProps<'div'>;
|
|
30
|
+
headerProps?: React.ComponentProps<'div'>;
|
|
31
|
+
headerLeftProps?: React.ComponentProps<'div'>;
|
|
32
|
+
groupIconProps?: LucideProps;
|
|
33
|
+
nameProps?: React.ComponentProps<'span'>;
|
|
34
|
+
headerRightProps?: React.ComponentProps<'div'>;
|
|
35
|
+
statusSentIconProps?: StatusSentProps;
|
|
36
|
+
formattedDateProps?: FormattedDateProps;
|
|
37
|
+
footerProps?: React.ComponentProps<'div'>;
|
|
38
|
+
lastMessageProps?: React.ComponentProps<'span'>;
|
|
39
|
+
draftLabelProps?: React.ComponentProps<'span'>;
|
|
40
|
+
lastSenderNameProps?: React.ComponentProps<'span'>;
|
|
41
|
+
unreadBadgeProps?: BadgeProps;
|
|
42
|
+
dividerProps?: React.ComponentProps<'div'>;
|
|
43
|
+
}
|
|
44
|
+
declare const DialogItem: React.NamedExoticComponent<Omit<DialogItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export { DialogItem };
|
|
46
|
+
//# sourceMappingURL=dialog-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-item.d.ts","sourceRoot":"","sources":["../../../src/components/dialog-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAEjD,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9C,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,mBAAmB,CAAC,EAAE,eAAe,CAAC;IACtC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAChD,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC/C,mBAAmB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnD,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CAC5C;AA0ID,QAAA,MAAM,UAAU,gGAAoE,CAAC;AAIrF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { LucideProps } from 'lucide-react';
|
|
3
|
+
import { type LabelProps } from './label';
|
|
4
|
+
interface FilePickerInputProps extends React.ComponentProps<'input'> {
|
|
5
|
+
onSelectFile: (files: File[]) => void;
|
|
6
|
+
onInvalidFile?: () => void;
|
|
7
|
+
iconElement?: React.ReactNode;
|
|
8
|
+
labelProps?: LabelProps;
|
|
9
|
+
iconProps?: LucideProps;
|
|
10
|
+
}
|
|
11
|
+
interface FilePickerDropzoneProps extends FilePickerInputProps {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
dropZoneProps?: React.ComponentProps<'div'>;
|
|
15
|
+
placeholderContainerProps?: React.ComponentProps<'div'>;
|
|
16
|
+
iconProps?: LucideProps;
|
|
17
|
+
placeholderProps?: React.ComponentProps<'span'>;
|
|
18
|
+
}
|
|
19
|
+
declare const FilePickerInput: React.ForwardRefExoticComponent<Omit<FilePickerInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
20
|
+
declare const FilePickerDropzone: React.ForwardRefExoticComponent<Omit<FilePickerDropzoneProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export { FilePickerInput, FilePickerDropzone, FilePickerInput as Input, FilePickerDropzone as Dropzone, type FilePickerInputProps, type FilePickerDropzoneProps, };
|
|
22
|
+
//# sourceMappingURL=file-picker.d.ts.map
|
|
@@ -0,0 +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;IACtC,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface FormattedDateProps extends React.ComponentProps<'span'> {
|
|
2
|
+
date?: Date | string | number | null | undefined;
|
|
3
|
+
language?: string;
|
|
4
|
+
distanceToNow?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const FormattedDate: import("react").NamedExoticComponent<Omit<FormattedDateProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
export { FormattedDate, type FormattedDateProps };
|
|
8
|
+
//# sourceMappingURL=formatted-date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatted-date.d.ts","sourceRoot":"","sources":["../../../src/components/formatted-date.tsx"],"names":[],"mappings":"AAKA,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;IAC/D,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA2CD,QAAA,MAAM,aAAa,wHAA2E,CAAC;AAI/F,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAiBhD,QAAA,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAiBhD,QAAA,MAAM,KAAK,8KAAsD,CAAC;AAIlE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type LabelProps } from '@radix-ui/react-label';
|
|
3
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
4
|
+
export { Label, type LabelProps };
|
|
5
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/components/label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgB3E,QAAA,MAAM,KAAK,qFAAsD,CAAC;AAIlE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type LucideProps } from 'lucide-react';
|
|
3
|
+
interface LinkPreviewProps extends React.ComponentProps<'a'> {
|
|
4
|
+
thin?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: React.ComponentProps<'img'>['src'];
|
|
8
|
+
image?: React.ComponentProps<'img'>['src'];
|
|
9
|
+
onReady?: () => void;
|
|
10
|
+
iconFallbackElement?: React.ReactElement;
|
|
11
|
+
titleContainerProps?: React.ComponentProps<'div'>;
|
|
12
|
+
iconProps?: React.ComponentProps<'img'>;
|
|
13
|
+
iconFallbackProps?: LucideProps;
|
|
14
|
+
titleProps?: React.ComponentProps<'span'>;
|
|
15
|
+
descriptionProps?: React.ComponentProps<'div'>;
|
|
16
|
+
imageContainerProps?: React.ComponentProps<'div'>;
|
|
17
|
+
imageProps?: React.ComponentProps<'img'>;
|
|
18
|
+
}
|
|
19
|
+
declare const LinkPreview: React.NamedExoticComponent<Omit<LinkPreviewProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
20
|
+
export { LinkPreview, type LinkPreviewProps };
|
|
21
|
+
//# sourceMappingURL=link-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-preview.d.ts","sourceRoot":"","sources":["../../../src/components/link-preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAevD,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACzC,mBAAmB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,mBAAmB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAClD,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CAC1C;AAgHD,QAAA,MAAM,WAAW,oGAAyE,CAAC;AAI3F,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { Opts } from 'linkifyjs';
|
|
3
|
+
interface LinkifyTextProps extends React.ComponentProps<'p'> {
|
|
4
|
+
text: string;
|
|
5
|
+
linkifyProps?: Opts;
|
|
6
|
+
}
|
|
7
|
+
declare const LinkifyText: React.NamedExoticComponent<Omit<LinkifyTextProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { LinkifyText, type LinkifyTextProps };
|
|
9
|
+
//# sourceMappingURL=linkify-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkify-text.d.ts","sourceRoot":"","sources":["../../../src/components/linkify-text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAUtC,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,IAAI,CAAC;CACrB;AAsBD,QAAA,MAAM,WAAW,uGAA4E,CAAC;AAI9F,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type LucideProps } from 'lucide-react';
|
|
2
2
|
interface SpinnerProps extends LucideProps {
|
|
3
3
|
loading?: boolean;
|
|
4
|
+
type?: 'default' | 'circle';
|
|
5
|
+
layout?: 'absolute' | 'centered' | 'overlay' | 'flow';
|
|
4
6
|
}
|
|
5
|
-
declare function Spinner({ loading, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
declare function Spinner({ loading, layout, type, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
8
|
declare namespace Spinner {
|
|
7
9
|
var displayName: string;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGtE,UAAU,YAAa,SAAQ,WAAW;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;CACvD;AAED,iBAAS,OAAO,CAAC,EAAE,OAAe,EAAE,MAAe,EAAE,IAAgB,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,kDA4B9F;kBA5BQ,OAAO;;;AAgChB,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LucideProps } from 'lucide-react';
|
|
2
|
+
interface StatusSentProps extends LucideProps {
|
|
3
|
+
status?: 'wait' | 'sent' | 'read' | 'lost' | null | undefined;
|
|
4
|
+
}
|
|
5
|
+
declare const StatusSent: React.FC<StatusSentProps>;
|
|
6
|
+
export { StatusSent, type StatusSentProps };
|
|
7
|
+
//# sourceMappingURL=status-sent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-sent.d.ts","sourceRoot":"","sources":["../../../src/components/status-sent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAG/E,UAAU,eAAgB,SAAQ,WAAW;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/D;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAazC,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-view.d.ts","sourceRoot":"","sources":["../../../src/components/stream-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGvF,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAC7D,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"stream-view.d.ts","sourceRoot":"","sources":["../../../src/components/stream-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGvF,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAC7D,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAmDD,QAAA,MAAM,UAAU,uGAAgE,CAAC;AAWjF,QAAA,MAAM,eAAe,uGAAqE,CAAC;AAW3F,QAAA,MAAM,gBAAgB,uGAAsE,CAAC;AAI7F,UAAU,yBAA0B,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACrE,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IAC7C,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IACjD,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAC7C,eAAe,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACrC,eAAe,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACrC,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7C,qBAAqB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IACvD,yBAAyB,CAAC,EAAE,WAAW,CAAC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAChD,kBAAkB,CAAC,EAAE,WAAW,CAAC;CAClC;AAED,UAAU,uBAAwB,SAAQ,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;IACjE,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACpC;AAwHD,QAAA,MAAM,oBAAoB,wHAA2F,CAAC;AAItH,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,GAC7B,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
2
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
-
export declare function getRandomString(length?: number): string;
|
|
4
|
-
export declare function getInitialsFromName(name?: string): string;
|
|
5
3
|
export declare function capitalize(str?: string): string;
|
|
6
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { memo, forwardRef } from 'react';
|
|
2
2
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
3
|
import { PresenceBadge } from './presence';
|
|
4
|
-
import { cn
|
|
4
|
+
import { cn } from './utils';
|
|
5
|
+
|
|
6
|
+
function getInitialsFromName(name) {
|
|
7
|
+
const words = name?.trim().split(/\s+/).filter(Boolean) ?? [];
|
|
8
|
+
const result = words.length > 1 ? `${words[0]?.[0]}${words[1]?.[0]}` : (words[0]?.slice(0, 2) ?? 'NA');
|
|
9
|
+
|
|
10
|
+
return result.toUpperCase();
|
|
11
|
+
}
|
|
5
12
|
|
|
6
13
|
function AvatarBase(
|
|
7
14
|
{ src, name = 'NA', online, presence, className, onlineProps, presenceProps, imageProps, fallbackProps, ...props },
|
|
@@ -25,13 +32,16 @@ function AvatarBase(
|
|
|
25
32
|
{online && (
|
|
26
33
|
<div
|
|
27
34
|
{...onlineProps}
|
|
28
|
-
className={cn(
|
|
35
|
+
className={cn(
|
|
36
|
+
'absolute top-0 right-0 rounded-full border-2 bg-green-600 border-green-200 size-3.5',
|
|
37
|
+
onlineProps?.className
|
|
38
|
+
)}
|
|
29
39
|
/>
|
|
30
40
|
)}
|
|
31
41
|
<PresenceBadge
|
|
32
42
|
status={presence}
|
|
33
43
|
{...presenceProps}
|
|
34
|
-
className={cn('absolute
|
|
44
|
+
className={cn('absolute bottom-0 right-0', presenceProps?.className)}
|
|
35
45
|
/>
|
|
36
46
|
</AvatarPrimitive.Root>
|
|
37
47
|
);
|
package/gen/components/badge.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { cn } from './utils';
|
|
5
5
|
|
|
@@ -22,18 +22,18 @@ const badgeVariants = cva(
|
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
function BadgeBase({ className, variant, asChild = false, ...props }, ref) {
|
|
25
|
-
const Comp = asChild ?
|
|
25
|
+
const Comp = asChild ? Slot : 'span';
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<Comp
|
|
29
29
|
ref={ref}
|
|
30
|
+
{...props}
|
|
30
31
|
className={cn(
|
|
31
32
|
badgeVariants({
|
|
32
33
|
variant,
|
|
33
34
|
}),
|
|
34
35
|
className
|
|
35
36
|
)}
|
|
36
|
-
{...props}
|
|
37
37
|
/>
|
|
38
38
|
);
|
|
39
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { cn } from './utils';
|
|
5
5
|
|
|
@@ -32,7 +32,7 @@ const buttonVariants = cva(
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
function ButtonBase({ asChild = false, variant, size, className, ...props }, ref) {
|
|
35
|
-
const Comp = asChild ?
|
|
35
|
+
const Comp = asChild ? Slot : 'button';
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<Comp
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { forwardRef, memo } from 'react';
|
|
2
|
+
import { Users } from 'lucide-react';
|
|
3
|
+
import { cn } from './utils';
|
|
4
|
+
import { Avatar } from './avatar';
|
|
5
|
+
import { StatusSent } from './status-sent';
|
|
6
|
+
import { FormattedDate } from './formatted-date';
|
|
7
|
+
import { Badge } from './badge';
|
|
8
|
+
|
|
9
|
+
function DialogItemBase(
|
|
10
|
+
{
|
|
11
|
+
index = -1,
|
|
12
|
+
isPrivateDialog,
|
|
13
|
+
selected,
|
|
14
|
+
onSelect = () => {},
|
|
15
|
+
name,
|
|
16
|
+
photo,
|
|
17
|
+
userOnline,
|
|
18
|
+
userPresence,
|
|
19
|
+
hasGroupIcon,
|
|
20
|
+
lastSentStatus,
|
|
21
|
+
lastSentDate,
|
|
22
|
+
lastSenderName,
|
|
23
|
+
lastMessage,
|
|
24
|
+
typingStatusText,
|
|
25
|
+
draft,
|
|
26
|
+
draftLabel = 'Draft',
|
|
27
|
+
unreadCount = 0,
|
|
28
|
+
language = 'en',
|
|
29
|
+
divider = 'bottom',
|
|
30
|
+
avatarProps,
|
|
31
|
+
contentProps,
|
|
32
|
+
headerProps,
|
|
33
|
+
headerLeftProps,
|
|
34
|
+
groupIconProps,
|
|
35
|
+
nameProps,
|
|
36
|
+
headerRightProps,
|
|
37
|
+
statusSentIconProps,
|
|
38
|
+
formattedDateProps,
|
|
39
|
+
footerProps,
|
|
40
|
+
lastMessageProps,
|
|
41
|
+
draftLabelProps,
|
|
42
|
+
lastSenderNameProps,
|
|
43
|
+
unreadBadgeProps,
|
|
44
|
+
dividerProps,
|
|
45
|
+
...props
|
|
46
|
+
},
|
|
47
|
+
ref
|
|
48
|
+
) {
|
|
49
|
+
const avatarSource = photo || avatarProps?.src || undefined;
|
|
50
|
+
const avatarFallback = name || avatarProps?.name || undefined;
|
|
51
|
+
const avatarOnline = isPrivateDialog ? userOnline || avatarProps?.online || false : false;
|
|
52
|
+
const avatarPresence = isPrivateDialog ? userPresence || avatarProps?.presence : undefined;
|
|
53
|
+
const showTopDivider = divider === 'top' || (divider === 'both' && index === 0);
|
|
54
|
+
const showBottomDivider = divider === 'bottom' || divider === 'both';
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
ref={ref}
|
|
59
|
+
{...props}
|
|
60
|
+
onClick={onSelect}
|
|
61
|
+
className={cn(
|
|
62
|
+
'flex items-start gap-2 px-2 flex-1 cursor-pointer',
|
|
63
|
+
'transition-colors duration-200 ease-linear',
|
|
64
|
+
`${selected ? 'border-l-[0.25em] pl-1 border-l-ring bg-ring/20' : 'hover:bg-ring/5'}`,
|
|
65
|
+
props?.className
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
<Avatar
|
|
69
|
+
src={avatarSource}
|
|
70
|
+
name={avatarFallback}
|
|
71
|
+
online={avatarOnline}
|
|
72
|
+
presence={avatarPresence}
|
|
73
|
+
{...avatarProps}
|
|
74
|
+
className={cn(`size-13 my-2 ${photo ? 'bg-ring/10' : 'bg-ring/30'}`, avatarProps?.className)}
|
|
75
|
+
/>
|
|
76
|
+
|
|
77
|
+
<div
|
|
78
|
+
{...contentProps}
|
|
79
|
+
className={cn('relative self-stretch flex-1 flex-col text-foreground', contentProps?.className)}
|
|
80
|
+
>
|
|
81
|
+
<div {...headerProps} className={cn('flex items-center justify-between gap-1', headerProps?.className)}>
|
|
82
|
+
<div {...headerLeftProps} className={cn('flex items-center gap-1', headerLeftProps?.className)}>
|
|
83
|
+
{!isPrivateDialog && hasGroupIcon && (
|
|
84
|
+
<Users
|
|
85
|
+
{...groupIconProps}
|
|
86
|
+
className={cn('text-muted-foreground size-4 min-w-4', groupIconProps?.className)}
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
<span {...nameProps} className={cn('font-medium text-left line-clamp-1', nameProps?.className)}>
|
|
90
|
+
{name}
|
|
91
|
+
</span>
|
|
92
|
+
</div>
|
|
93
|
+
<div {...headerRightProps} className={cn('flex items-center gap-1', headerRightProps?.className)}>
|
|
94
|
+
<StatusSent status={lastSentStatus} {...statusSentIconProps} />
|
|
95
|
+
<FormattedDate date={lastSentDate} language={language} {...formattedDateProps} />
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div {...footerProps} className={cn('flex items-start justify-between gap-1', footerProps?.className)}>
|
|
99
|
+
<span
|
|
100
|
+
{...lastMessageProps}
|
|
101
|
+
className={cn('text-sm text-left text-muted-foreground line-clamp-2', lastMessageProps?.className)}
|
|
102
|
+
>
|
|
103
|
+
{typingStatusText ||
|
|
104
|
+
(draft ? (
|
|
105
|
+
<span>
|
|
106
|
+
<span
|
|
107
|
+
{...draftLabelProps}
|
|
108
|
+
className={cn('text-red-500 font-medium', draftLabelProps?.className)}
|
|
109
|
+
>{`${draftLabel}: `}</span>
|
|
110
|
+
{draft}
|
|
111
|
+
</span>
|
|
112
|
+
) : (
|
|
113
|
+
<span>
|
|
114
|
+
{lastSenderName && (
|
|
115
|
+
<span
|
|
116
|
+
{...lastSenderNameProps}
|
|
117
|
+
className={cn('font-semibold', lastSenderNameProps?.className)}
|
|
118
|
+
>{`${lastSenderName}: `}</span>
|
|
119
|
+
)}
|
|
120
|
+
{lastMessage}
|
|
121
|
+
</span>
|
|
122
|
+
))}
|
|
123
|
+
</span>
|
|
124
|
+
{unreadCount > 0 && (
|
|
125
|
+
<Badge
|
|
126
|
+
{...unreadBadgeProps}
|
|
127
|
+
className={cn(
|
|
128
|
+
'bg-ring text-background text-xs rounded-full p-1 h-6 min-w-6 mt-0.5',
|
|
129
|
+
unreadBadgeProps?.className
|
|
130
|
+
)}
|
|
131
|
+
>
|
|
132
|
+
{unreadCount}
|
|
133
|
+
</Badge>
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
136
|
+
{showTopDivider && (
|
|
137
|
+
<div {...dividerProps} className={cn('absolute -top-px left-0 right-0 border-t', dividerProps?.className)} />
|
|
138
|
+
)}
|
|
139
|
+
{showBottomDivider && <div className="absolute bottom-0 left-0 right-0 border-b" />}
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const DialogItem = memo(forwardRef(DialogItemBase));
|
|
146
|
+
|
|
147
|
+
DialogItem.displayName = 'DialogItem';
|
|
148
|
+
|
|
149
|
+
export { DialogItem };
|