@liveblocks/react-ui 3.18.0-rc1 → 3.18.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.
Files changed (55) hide show
  1. package/dist/_private/index.cjs +3 -2
  2. package/dist/_private/index.cjs.map +1 -1
  3. package/dist/_private/index.d.cts +24 -18
  4. package/dist/_private/index.d.ts +24 -18
  5. package/dist/_private/index.js +1 -1
  6. package/dist/components/Avatar.cjs +142 -0
  7. package/dist/components/Avatar.cjs.map +1 -0
  8. package/dist/components/Avatar.js +138 -0
  9. package/dist/components/Avatar.js.map +1 -0
  10. package/dist/components/AvatarStack.cjs +58 -44
  11. package/dist/components/AvatarStack.cjs.map +1 -1
  12. package/dist/components/AvatarStack.js +58 -44
  13. package/dist/components/AvatarStack.js.map +1 -1
  14. package/dist/components/Comment.cjs +3 -3
  15. package/dist/components/Comment.cjs.map +1 -1
  16. package/dist/components/Comment.js +3 -3
  17. package/dist/components/Comment.js.map +1 -1
  18. package/dist/components/CommentPin.cjs +2 -2
  19. package/dist/components/CommentPin.cjs.map +1 -1
  20. package/dist/components/CommentPin.js +2 -2
  21. package/dist/components/CommentPin.js.map +1 -1
  22. package/dist/components/Composer.cjs +3 -3
  23. package/dist/components/Composer.cjs.map +1 -1
  24. package/dist/components/Composer.js +3 -3
  25. package/dist/components/Composer.js.map +1 -1
  26. package/dist/components/InboxNotification.cjs +2 -2
  27. package/dist/components/InboxNotification.cjs.map +1 -1
  28. package/dist/components/InboxNotification.js +2 -2
  29. package/dist/components/InboxNotification.js.map +1 -1
  30. package/dist/components/internal/User.cjs +24 -10
  31. package/dist/components/internal/User.cjs.map +1 -1
  32. package/dist/components/internal/User.js +25 -11
  33. package/dist/components/internal/User.js.map +1 -1
  34. package/dist/index.cjs +2 -0
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +33 -1
  37. package/dist/index.d.ts +33 -1
  38. package/dist/index.js +1 -0
  39. package/dist/index.js.map +1 -1
  40. package/dist/version.cjs +1 -1
  41. package/dist/version.cjs.map +1 -1
  42. package/dist/version.js +1 -1
  43. package/dist/version.js.map +1 -1
  44. package/package.json +4 -4
  45. package/src/styles/index.css +21 -0
  46. package/styles.css +1 -1
  47. package/styles.css.map +1 -1
  48. package/dist/components/internal/Avatar.cjs +0 -63
  49. package/dist/components/internal/Avatar.cjs.map +0 -1
  50. package/dist/components/internal/Avatar.js +0 -61
  51. package/dist/components/internal/Avatar.js.map +0 -1
  52. package/dist/utils/use-user-or-group-info.cjs +0 -49
  53. package/dist/utils/use-user-or-group-info.cjs.map +0 -1
  54. package/dist/utils/use-user-or-group-info.js +0 -46
  55. package/dist/utils/use-user-or-group-info.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs } from 'react/jsx-runtime';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useUser } from '@liveblocks/react';
4
4
  import { useMemo } from 'react';
5
5
  import { useOverrides } from '../../overrides.js';
@@ -7,19 +7,13 @@ import { useCurrentUserId } from '../../shared.js';
7
7
  import { cn } from '../../utils/cn.js';
8
8
 
9
9
 
10
- function User({
11
- userId,
12
- replaceSelf,
10
+ function UserLayout({
11
+ isLoading,
12
+ name,
13
13
  className,
14
14
  children,
15
15
  ...props
16
16
  }) {
17
- const currentId = useCurrentUserId();
18
- const { user, isLoading } = useUser(userId);
19
- const $ = useOverrides();
20
- const resolvedUserName = useMemo(() => {
21
- return replaceSelf && currentId === userId ? $.USER_SELF : user?.name ?? $.USER_UNKNOWN;
22
- }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);
23
17
  return /* @__PURE__ */ jsxs(
24
18
  "span",
25
19
  {
@@ -27,12 +21,32 @@ function User({
27
21
  "data-loading": isLoading ? "" : void 0,
28
22
  ...props,
29
23
  children: [
30
- isLoading ? null : resolvedUserName,
24
+ isLoading ? null : name,
31
25
  children
32
26
  ]
33
27
  }
34
28
  );
35
29
  }
30
+ function ResolvedUser({
31
+ userId,
32
+ replaceSelf,
33
+ ...props
34
+ }) {
35
+ const currentId = useCurrentUserId();
36
+ const { user, isLoading } = useUser(userId);
37
+ const $ = useOverrides();
38
+ const resolvedUserName = useMemo(() => {
39
+ return replaceSelf && currentId === userId ? $.USER_SELF : user?.name ?? $.USER_UNKNOWN;
40
+ }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);
41
+ return /* @__PURE__ */ jsx(UserLayout, { isLoading, name: resolvedUserName, ...props });
42
+ }
43
+ function User({ userId, ...props }) {
44
+ const $ = useOverrides();
45
+ if (!userId) {
46
+ return /* @__PURE__ */ jsx(UserLayout, { isLoading: false, name: $.USER_UNKNOWN, ...props });
47
+ }
48
+ return /* @__PURE__ */ jsx(ResolvedUser, { userId, ...props });
49
+ }
36
50
 
37
51
  export { User };
38
52
  //# sourceMappingURL=User.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"User.js","sources":["../../../src/components/internal/User.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { useOverrides } from \"../../overrides\";\nimport { useCurrentUserId } from \"../../shared\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface UserProps extends ComponentProps<\"span\"> {\n /**\n * The user ID to display the user name for.\n */\n userId: string;\n\n /**\n * Whether to replace the user name with \"you\" ($.USER_SELF) for the current user.\n */\n replaceSelf?: boolean;\n}\n\nexport function User({\n userId,\n replaceSelf,\n className,\n children,\n ...props\n}: UserProps) {\n const currentId = useCurrentUserId();\n const { user, isLoading } = useUser(userId);\n const $ = useOverrides();\n const resolvedUserName = useMemo(() => {\n return replaceSelf && currentId === userId\n ? $.USER_SELF\n : (user?.name ?? $.USER_UNKNOWN);\n }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);\n\n return (\n <span\n className={cn(\"lb-name lb-user\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedUserName}\n {children}\n </span>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAsBO;AAAc;AACnB;AACA;AACA;AACA;AAEF;AACE;AACA;AACA;AACA;AACE;AAEqB;AAGvB;AACE;AAAC;AAAA;AAC2C;AACX;AAC3B;AAEH;AAAmB;AACnB;AAAA;AAAA;AAGP;;"}
1
+ {"version":3,"file":"User.js","sources":["../../../src/components/internal/User.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { useOverrides } from \"../../overrides\";\nimport { useCurrentUserId } from \"../../shared\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface UserProps extends ComponentProps<\"span\"> {\n /**\n * The user ID to display the user name for.\n */\n userId?: string;\n\n /**\n * Whether to replace the user name with \"you\" ($.USER_SELF) for the current user.\n */\n replaceSelf?: boolean;\n}\n\ninterface UserLayoutProps extends ComponentProps<\"span\"> {\n isLoading: boolean;\n name: string;\n}\n\nfunction UserLayout({\n isLoading,\n name,\n className,\n children,\n ...props\n}: UserLayoutProps) {\n return (\n <span\n className={cn(\"lb-name lb-user\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : name}\n {children}\n </span>\n );\n}\n\nfunction ResolvedUser({\n userId,\n replaceSelf,\n ...props\n}: UserProps & { userId: string }) {\n const currentId = useCurrentUserId();\n const { user, isLoading } = useUser(userId);\n const $ = useOverrides();\n const resolvedUserName = useMemo(() => {\n return replaceSelf && currentId === userId\n ? $.USER_SELF\n : (user?.name ?? $.USER_UNKNOWN);\n }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);\n\n return (\n <UserLayout isLoading={isLoading} name={resolvedUserName} {...props} />\n );\n}\n\nexport function User({ userId, ...props }: UserProps) {\n const $ = useOverrides();\n\n if (!userId) {\n return <UserLayout isLoading={false} name={$.USER_UNKNOWN} {...props} />;\n }\n\n return <ResolvedUser userId={userId} {...props} />;\n}\n"],"names":[],"mappings":";;;;;;;;;AA2BA;AAAoB;AAClB;AACA;AACA;AACA;AAEF;AACE;AACE;AAAC;AAAA;AAC2C;AACX;AAC3B;AAEH;AAAmB;AACnB;AAAA;AAAA;AAGP;AAEA;AAAsB;AACpB;AACA;AAEF;AACE;AACA;AACA;AACA;AACE;AAEqB;AAGvB;AAGF;AAEO;AACL;AAEA;AACE;AAAsE;AAGxE;AACF;;"}
package/dist/index.cjs CHANGED
@@ -4,6 +4,7 @@ var core = require('@liveblocks/core');
4
4
  var version = require('./version.cjs');
5
5
  var AiChat = require('./components/AiChat.cjs');
6
6
  var AiTool = require('./components/AiTool.cjs');
7
+ var Avatar = require('./components/Avatar.cjs');
7
8
  var AvatarStack = require('./components/AvatarStack.cjs');
8
9
  var Comment = require('./components/Comment.cjs');
9
10
  var CommentPin = require('./components/CommentPin.cjs');
@@ -25,6 +26,7 @@ core.detectDupes(version.PKG_NAME, version.PKG_VERSION, version.PKG_FORMAT);
25
26
 
26
27
  exports.AiChat = AiChat.AiChat;
27
28
  exports.AiTool = AiTool.AiTool;
29
+ exports.Avatar = Avatar.Avatar;
28
30
  exports.AvatarStack = AvatarStack.AvatarStack;
29
31
  exports.Comment = Comment.Comment;
30
32
  exports.CommentPin = CommentPin.CommentPin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type {\n AiChatComponents,\n AiChatComponentsEmptyProps,\n AiChatComponentsLoadingProps,\n AiChatProps,\n} from \"./components/AiChat\";\nexport { AiChat } from \"./components/AiChat\";\nexport type { AiToolIconProps, AiToolProps } from \"./components/AiTool\";\nexport { AiTool } from \"./components/AiTool\";\nexport type { AvatarStackProps } from \"./components/AvatarStack\";\nexport { AvatarStack } from \"./components/AvatarStack\";\nexport type {\n CommentAuthorProps,\n CommentAvatarProps,\n CommentDateProps,\n CommentDropdownItemProps,\n CommentProps,\n} from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { CommentPinProps } from \"./components/CommentPin\";\nexport { CommentPin } from \"./components/CommentPin\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { CursorProps } from \"./components/Cursor\";\nexport { Cursor } from \"./components/Cursor\";\nexport type { CursorsCursorProps, CursorsProps } from \"./components/Cursors\";\nexport { Cursors } from \"./components/Cursors\";\nexport type { FloatingComposerProps } from \"./components/FloatingComposer\";\nexport { FloatingComposer } from \"./components/FloatingComposer\";\nexport type { FloatingThreadProps } from \"./components/FloatingThread\";\nexport { FloatingThread } from \"./components/FloatingThread\";\nexport type { HistoryVersionSummaryProps } from \"./components/HistoryVersionSummary\";\nexport { HistoryVersionSummary } from \"./components/HistoryVersionSummary\";\nexport type { HistoryVersionSummaryListProps } from \"./components/HistoryVersionSummaryList\";\nexport { HistoryVersionSummaryList } from \"./components/HistoryVersionSummaryList\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationInspectorProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUiConfig } from \"./config\";\nexport * as Icon from \"./icon\";\nexport type {\n CommentOverrides,\n ComposerOverrides,\n GlobalOverrides,\n InboxNotificationOverrides,\n LocalizationOverrides,\n Overrides,\n ThreadOverrides,\n} from \"./overrides\";\nexport { useOverrides } from \"./overrides\";\nexport type {\n AiComposerSubmitMessage,\n ComposerSubmitComment,\n} from \"./primitives\";\nexport type {\n CommentAttachmentArgs,\n ComposerBodyMark,\n ComposerBodyMarks,\n} from \"./types\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type {\n AiChatComponents,\n AiChatComponentsEmptyProps,\n AiChatComponentsLoadingProps,\n AiChatProps,\n} from \"./components/AiChat\";\nexport { AiChat } from \"./components/AiChat\";\nexport type { AiToolIconProps, AiToolProps } from \"./components/AiTool\";\nexport { AiTool } from \"./components/AiTool\";\nexport type { AvatarProps } from \"./components/Avatar\";\nexport { Avatar } from \"./components/Avatar\";\nexport type { AvatarStackProps } from \"./components/AvatarStack\";\nexport { AvatarStack } from \"./components/AvatarStack\";\nexport type {\n CommentAuthorProps,\n CommentAvatarProps,\n CommentDateProps,\n CommentDropdownItemProps,\n CommentProps,\n} from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { CommentPinProps } from \"./components/CommentPin\";\nexport { CommentPin } from \"./components/CommentPin\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { CursorProps } from \"./components/Cursor\";\nexport { Cursor } from \"./components/Cursor\";\nexport type { CursorsCursorProps, CursorsProps } from \"./components/Cursors\";\nexport { Cursors } from \"./components/Cursors\";\nexport type { FloatingComposerProps } from \"./components/FloatingComposer\";\nexport { FloatingComposer } from \"./components/FloatingComposer\";\nexport type { FloatingThreadProps } from \"./components/FloatingThread\";\nexport { FloatingThread } from \"./components/FloatingThread\";\nexport type { HistoryVersionSummaryProps } from \"./components/HistoryVersionSummary\";\nexport { HistoryVersionSummary } from \"./components/HistoryVersionSummary\";\nexport type { HistoryVersionSummaryListProps } from \"./components/HistoryVersionSummaryList\";\nexport { HistoryVersionSummaryList } from \"./components/HistoryVersionSummaryList\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationInspectorProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUiConfig } from \"./config\";\nexport * as Icon from \"./icon\";\nexport type {\n CommentOverrides,\n ComposerOverrides,\n GlobalOverrides,\n InboxNotificationOverrides,\n LocalizationOverrides,\n Overrides,\n ThreadOverrides,\n} from \"./overrides\";\nexport { useOverrides } from \"./overrides\";\nexport type {\n AiComposerSubmitMessage,\n ComposerSubmitComment,\n} from \"./primitives\";\nexport type {\n CommentAttachmentArgs,\n ComposerBodyMark,\n ComposerBodyMarks,\n} from \"./types\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -810,6 +810,34 @@ declare const AiTool: react.ForwardRefExoticComponent<Omit<AiToolProps, "ref"> &
810
810
  Confirmation: typeof AiToolConfirmation;
811
811
  };
812
812
 
813
+ interface AvatarProps extends ComponentProps<"div"> {
814
+ /**
815
+ * The URL of the avatar's image.
816
+ */
817
+ src?: string;
818
+ /**
819
+ * The name of the avatar.
820
+ */
821
+ name?: string;
822
+ /**
823
+ * The content to display in the avatar's tooltip.
824
+ */
825
+ tooltip?: ReactNode;
826
+ /**
827
+ * Whether and how the avatar should have an outline.
828
+ */
829
+ outline?: string | boolean | {
830
+ color?: string;
831
+ width?: string | number;
832
+ gap?: string | number;
833
+ };
834
+ /**
835
+ * Override the avatar's content.
836
+ */
837
+ children?: ReactNode;
838
+ }
839
+ declare function Avatar({ src, name, className, children, tooltip, outline, style, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
840
+
813
841
  interface AvatarStackProps extends ComponentPropsWithoutRef<"div"> {
814
842
  /**
815
843
  * Optional additional user IDs to include in the stack.
@@ -828,6 +856,10 @@ interface AvatarStackProps extends ComponentPropsWithoutRef<"div"> {
828
856
  * The gap around the avatars.
829
857
  */
830
858
  gap?: string | number;
859
+ /**
860
+ * The avatar stack visual variant.
861
+ */
862
+ variant?: "default" | "outline";
831
863
  /**
832
864
  * Override the component's strings.
833
865
  */
@@ -1855,4 +1887,4 @@ declare namespace icon {
1855
1887
  };
1856
1888
  }
1857
1889
 
1858
- export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiComposerSubmitMessage, AiTool, AiToolIconProps, AiToolProps, AvatarStack, AvatarStackProps, Comment, CommentAttachmentArgs, CommentAuthorProps, CommentAvatarProps, CommentDateProps, CommentDropdownItemProps, CommentOverrides, CommentPin, CommentPinProps, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, Cursor, CursorProps, Cursors, CursorsCursorProps, CursorsProps, FloatingComposer, FloatingComposerProps, FloatingThread, FloatingThreadProps, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationInspectorProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUiConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
1890
+ export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiComposerSubmitMessage, AiTool, AiToolIconProps, AiToolProps, Avatar, AvatarProps, AvatarStack, AvatarStackProps, Comment, CommentAttachmentArgs, CommentAuthorProps, CommentAvatarProps, CommentDateProps, CommentDropdownItemProps, CommentOverrides, CommentPin, CommentPinProps, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, Cursor, CursorProps, Cursors, CursorsCursorProps, CursorsProps, FloatingComposer, FloatingComposerProps, FloatingThread, FloatingThreadProps, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationInspectorProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUiConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
package/dist/index.d.ts CHANGED
@@ -810,6 +810,34 @@ declare const AiTool: react.ForwardRefExoticComponent<Omit<AiToolProps, "ref"> &
810
810
  Confirmation: typeof AiToolConfirmation;
811
811
  };
812
812
 
813
+ interface AvatarProps extends ComponentProps<"div"> {
814
+ /**
815
+ * The URL of the avatar's image.
816
+ */
817
+ src?: string;
818
+ /**
819
+ * The name of the avatar.
820
+ */
821
+ name?: string;
822
+ /**
823
+ * The content to display in the avatar's tooltip.
824
+ */
825
+ tooltip?: ReactNode;
826
+ /**
827
+ * Whether and how the avatar should have an outline.
828
+ */
829
+ outline?: string | boolean | {
830
+ color?: string;
831
+ width?: string | number;
832
+ gap?: string | number;
833
+ };
834
+ /**
835
+ * Override the avatar's content.
836
+ */
837
+ children?: ReactNode;
838
+ }
839
+ declare function Avatar({ src, name, className, children, tooltip, outline, style, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
840
+
813
841
  interface AvatarStackProps extends ComponentPropsWithoutRef<"div"> {
814
842
  /**
815
843
  * Optional additional user IDs to include in the stack.
@@ -828,6 +856,10 @@ interface AvatarStackProps extends ComponentPropsWithoutRef<"div"> {
828
856
  * The gap around the avatars.
829
857
  */
830
858
  gap?: string | number;
859
+ /**
860
+ * The avatar stack visual variant.
861
+ */
862
+ variant?: "default" | "outline";
831
863
  /**
832
864
  * Override the component's strings.
833
865
  */
@@ -1855,4 +1887,4 @@ declare namespace icon {
1855
1887
  };
1856
1888
  }
1857
1889
 
1858
- export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiComposerSubmitMessage, AiTool, AiToolIconProps, AiToolProps, AvatarStack, AvatarStackProps, Comment, CommentAttachmentArgs, CommentAuthorProps, CommentAvatarProps, CommentDateProps, CommentDropdownItemProps, CommentOverrides, CommentPin, CommentPinProps, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, Cursor, CursorProps, Cursors, CursorsCursorProps, CursorsProps, FloatingComposer, FloatingComposerProps, FloatingThread, FloatingThreadProps, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationInspectorProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUiConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
1890
+ export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiComposerSubmitMessage, AiTool, AiToolIconProps, AiToolProps, Avatar, AvatarProps, AvatarStack, AvatarStackProps, Comment, CommentAttachmentArgs, CommentAuthorProps, CommentAvatarProps, CommentDateProps, CommentDropdownItemProps, CommentOverrides, CommentPin, CommentPinProps, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, Cursor, CursorProps, Cursors, CursorsCursorProps, CursorsProps, FloatingComposer, FloatingComposerProps, FloatingThread, FloatingThreadProps, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationInspectorProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUiConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { detectDupes } from '@liveblocks/core';
2
2
  import { PKG_NAME, PKG_VERSION, PKG_FORMAT } from './version.js';
3
3
  export { AiChat } from './components/AiChat.js';
4
4
  export { AiTool } from './components/AiTool.js';
5
+ export { Avatar } from './components/Avatar.js';
5
6
  export { AvatarStack } from './components/AvatarStack.js';
6
7
  export { Comment } from './components/Comment.js';
7
8
  export { CommentPin } from './components/CommentPin.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type {\n AiChatComponents,\n AiChatComponentsEmptyProps,\n AiChatComponentsLoadingProps,\n AiChatProps,\n} from \"./components/AiChat\";\nexport { AiChat } from \"./components/AiChat\";\nexport type { AiToolIconProps, AiToolProps } from \"./components/AiTool\";\nexport { AiTool } from \"./components/AiTool\";\nexport type { AvatarStackProps } from \"./components/AvatarStack\";\nexport { AvatarStack } from \"./components/AvatarStack\";\nexport type {\n CommentAuthorProps,\n CommentAvatarProps,\n CommentDateProps,\n CommentDropdownItemProps,\n CommentProps,\n} from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { CommentPinProps } from \"./components/CommentPin\";\nexport { CommentPin } from \"./components/CommentPin\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { CursorProps } from \"./components/Cursor\";\nexport { Cursor } from \"./components/Cursor\";\nexport type { CursorsCursorProps, CursorsProps } from \"./components/Cursors\";\nexport { Cursors } from \"./components/Cursors\";\nexport type { FloatingComposerProps } from \"./components/FloatingComposer\";\nexport { FloatingComposer } from \"./components/FloatingComposer\";\nexport type { FloatingThreadProps } from \"./components/FloatingThread\";\nexport { FloatingThread } from \"./components/FloatingThread\";\nexport type { HistoryVersionSummaryProps } from \"./components/HistoryVersionSummary\";\nexport { HistoryVersionSummary } from \"./components/HistoryVersionSummary\";\nexport type { HistoryVersionSummaryListProps } from \"./components/HistoryVersionSummaryList\";\nexport { HistoryVersionSummaryList } from \"./components/HistoryVersionSummaryList\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationInspectorProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUiConfig } from \"./config\";\nexport * as Icon from \"./icon\";\nexport type {\n CommentOverrides,\n ComposerOverrides,\n GlobalOverrides,\n InboxNotificationOverrides,\n LocalizationOverrides,\n Overrides,\n ThreadOverrides,\n} from \"./overrides\";\nexport { useOverrides } from \"./overrides\";\nexport type {\n AiComposerSubmitMessage,\n ComposerSubmitComment,\n} from \"./primitives\";\nexport type {\n CommentAttachmentArgs,\n ComposerBodyMark,\n ComposerBodyMarks,\n} from \"./types\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,WAAY,CAAA,QAAA,EAAU,aAAa,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type {\n AiChatComponents,\n AiChatComponentsEmptyProps,\n AiChatComponentsLoadingProps,\n AiChatProps,\n} from \"./components/AiChat\";\nexport { AiChat } from \"./components/AiChat\";\nexport type { AiToolIconProps, AiToolProps } from \"./components/AiTool\";\nexport { AiTool } from \"./components/AiTool\";\nexport type { AvatarProps } from \"./components/Avatar\";\nexport { Avatar } from \"./components/Avatar\";\nexport type { AvatarStackProps } from \"./components/AvatarStack\";\nexport { AvatarStack } from \"./components/AvatarStack\";\nexport type {\n CommentAuthorProps,\n CommentAvatarProps,\n CommentDateProps,\n CommentDropdownItemProps,\n CommentProps,\n} from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { CommentPinProps } from \"./components/CommentPin\";\nexport { CommentPin } from \"./components/CommentPin\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { CursorProps } from \"./components/Cursor\";\nexport { Cursor } from \"./components/Cursor\";\nexport type { CursorsCursorProps, CursorsProps } from \"./components/Cursors\";\nexport { Cursors } from \"./components/Cursors\";\nexport type { FloatingComposerProps } from \"./components/FloatingComposer\";\nexport { FloatingComposer } from \"./components/FloatingComposer\";\nexport type { FloatingThreadProps } from \"./components/FloatingThread\";\nexport { FloatingThread } from \"./components/FloatingThread\";\nexport type { HistoryVersionSummaryProps } from \"./components/HistoryVersionSummary\";\nexport { HistoryVersionSummary } from \"./components/HistoryVersionSummary\";\nexport type { HistoryVersionSummaryListProps } from \"./components/HistoryVersionSummaryList\";\nexport { HistoryVersionSummaryList } from \"./components/HistoryVersionSummaryList\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationInspectorProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUiConfig } from \"./config\";\nexport * as Icon from \"./icon\";\nexport type {\n CommentOverrides,\n ComposerOverrides,\n GlobalOverrides,\n InboxNotificationOverrides,\n LocalizationOverrides,\n Overrides,\n ThreadOverrides,\n} from \"./overrides\";\nexport { useOverrides } from \"./overrides\";\nexport type {\n AiComposerSubmitMessage,\n ComposerSubmitComment,\n} from \"./primitives\";\nexport type {\n CommentAttachmentArgs,\n ComposerBodyMark,\n ComposerBodyMarks,\n} from \"./types\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA,WAAY,CAAA,QAAA,EAAU,aAAa,UAAU,CAAA"}
package/dist/version.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const PKG_NAME = "@liveblocks/react-ui";
4
- const PKG_VERSION = typeof "3.18.0-rc1" === "string" && "3.18.0-rc1";
4
+ const PKG_VERSION = typeof "3.18.0" === "string" && "3.18.0";
5
5
  const PKG_FORMAT = typeof "cjs" === "string" && "cjs";
6
6
 
7
7
  exports.PKG_FORMAT = PKG_FORMAT;
@@ -1 +1 @@
1
- {"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,YAAA,KAAgB,QAAY,IAAA,aAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;;;"}
1
+ {"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,QAAA,KAAgB,QAAY,IAAA,SAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;;;"}
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const PKG_NAME = "@liveblocks/react-ui";
2
- const PKG_VERSION = typeof "3.18.0-rc1" === "string" && "3.18.0-rc1";
2
+ const PKG_VERSION = typeof "3.18.0" === "string" && "3.18.0";
3
3
  const PKG_FORMAT = typeof "esm" === "string" && "esm";
4
4
 
5
5
  export { PKG_FORMAT, PKG_NAME, PKG_VERSION };
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,YAAA,KAAgB,QAAY,IAAA,aAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAc,OAAO,QAAA,KAAgB,QAAY,IAAA,SAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react-ui",
3
- "version": "3.18.0-rc1",
3
+ "version": "3.18.0",
4
4
  "description": "A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Liveblocks Inc.",
@@ -78,9 +78,9 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "@floating-ui/react-dom": "^2.1.0",
81
- "@liveblocks/client": "3.18.0-rc1",
82
- "@liveblocks/core": "3.18.0-rc1",
83
- "@liveblocks/react": "3.18.0-rc1",
81
+ "@liveblocks/client": "3.18.0",
82
+ "@liveblocks/core": "3.18.0",
83
+ "@liveblocks/react": "3.18.0",
84
84
  "frimousse": "^0.2.0",
85
85
  "marked": "^15.0.11",
86
86
  "radix-ui": "^1.4.0",
@@ -1042,6 +1042,27 @@
1042
1042
  background: var(--lb-foreground);
1043
1043
  opacity: $lb-loading-opacity;
1044
1044
  }
1045
+
1046
+ &:where([data-variant="outline"]) {
1047
+ --lb-avatar-outline-gap: 2px;
1048
+ --lb-avatar-outline-width: 2px;
1049
+
1050
+ padding: var(--lb-avatar-outline-gap);
1051
+ border: var(--lb-avatar-outline-width) solid
1052
+ var(--lb-avatar-outline-color, var(--lb-accent));
1053
+ background-clip: content-box;
1054
+ }
1055
+ }
1056
+
1057
+ .lb-avatar-content {
1058
+ position: relative;
1059
+ display: flex;
1060
+ justify-content: center;
1061
+ align-items: center;
1062
+ overflow: hidden;
1063
+ inline-size: 100%;
1064
+ block-size: 100%;
1065
+ border-radius: inherit;
1045
1066
  }
1046
1067
 
1047
1068
  .lb-avatar-image {