@algolia/satellite 2.3.0-rc.6 → 2.3.0-rc.8

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 (122) hide show
  1. package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
  2. package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
  3. package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +23 -4
  4. package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
  5. package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
  6. package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
  7. package/dist/{esm/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → cjs/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
  8. package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +12 -12
  9. package/dist/{esm/Layout → cjs}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
  10. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
  11. package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
  12. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
  13. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
  14. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
  15. package/dist/{esm/Layout → cjs}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
  16. package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +2 -2
  17. package/dist/cjs/Chat/ChatMessages/ChatMessages.d.ts +141 -0
  18. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +18 -7
  19. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
  20. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
  21. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.d.ts +7 -1
  22. package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +6 -0
  23. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.d.ts +16 -2
  24. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +32 -20
  25. package/dist/cjs/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
  26. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +10 -3
  27. package/dist/cjs/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
  28. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useFocusTyping.js +19 -14
  29. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
  30. package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
  31. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
  32. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
  33. package/dist/cjs/Layout/index.d.ts +0 -1
  34. package/dist/cjs/Layout/index.js +0 -11
  35. package/dist/cjs/Satellite/locale.d.ts +3 -3
  36. package/dist/cjs/index.d.ts +1 -0
  37. package/dist/cjs/index.js +12 -0
  38. package/dist/cjs/styles/helpers/tv.d.ts +5 -1
  39. package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
  40. package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
  41. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
  42. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +23 -4
  43. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
  44. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
  45. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
  46. package/dist/{cjs/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → esm/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
  47. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +12 -12
  48. package/dist/{cjs/Layout → esm}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
  49. package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
  50. package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
  51. package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
  52. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
  53. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
  54. package/dist/{cjs/Layout → esm}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
  55. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +2 -2
  56. package/dist/esm/Chat/ChatMessages/ChatMessages.d.ts +141 -0
  57. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +18 -7
  58. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
  59. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
  60. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.d.ts +7 -1
  61. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +6 -0
  62. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.d.ts +16 -2
  63. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +33 -20
  64. package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
  65. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +10 -3
  66. package/dist/esm/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
  67. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useFocusTyping.js +19 -14
  68. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
  69. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
  70. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
  71. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
  72. package/dist/esm/Layout/index.d.ts +0 -1
  73. package/dist/esm/Layout/index.js +0 -1
  74. package/dist/esm/Satellite/locale.d.ts +3 -3
  75. package/dist/esm/index.d.ts +1 -0
  76. package/dist/esm/index.js +1 -0
  77. package/dist/esm/styles/helpers/tv.d.ts +5 -1
  78. package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
  79. package/dist/satellite.min.css +1 -1
  80. package/package.json +2 -2
  81. package/dist/cjs/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
  82. package/dist/cjs/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
  83. package/dist/cjs/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
  84. package/dist/cjs/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
  85. package/dist/cjs/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
  86. package/dist/esm/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
  87. package/dist/esm/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
  88. package/dist/esm/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
  89. package/dist/esm/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
  90. package/dist/esm/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
  91. /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
  92. /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
  93. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
  94. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
  95. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
  96. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
  97. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
  98. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
  99. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
  100. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
  101. /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
  102. /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
  103. /package/dist/cjs/{Layout/Chat → Chat}/index.d.ts +0 -0
  104. /package/dist/cjs/{Layout/Chat → Chat}/index.js +0 -0
  105. /package/dist/cjs/{Layout/Chat → Chat}/types.d.ts +0 -0
  106. /package/dist/cjs/{Layout/Chat → Chat}/types.js +0 -0
  107. /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
  108. /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
  109. /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
  110. /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
  111. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
  112. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
  113. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
  114. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
  115. /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
  116. /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
  117. /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
  118. /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
  119. /package/dist/esm/{Layout/Chat → Chat}/index.d.ts +0 -0
  120. /package/dist/esm/{Layout/Chat → Chat}/index.js +0 -0
  121. /package/dist/esm/{Layout/Chat → Chat}/types.d.ts +0 -0
  122. /package/dist/esm/{Layout/Chat → Chat}/types.js +0 -0
@@ -0,0 +1,23 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ import type { AccordionProps } from "../../Actions";
3
+ import type { IconComponentType } from "../../Icons";
4
+ export declare type ChatContextAccordionProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & Omit<AccordionProps, "multiple" | "defaultValue" | "value" | "onChange"> & {
5
+ /**
6
+ * The header of the accordion.
7
+ */
8
+ header: ReactNode;
9
+ /**
10
+ * The icon of the accordion.
11
+ */
12
+ icon?: IconComponentType;
13
+ /**
14
+ * Whether the accordion is open by default.
15
+ */
16
+ defaultOpen?: boolean;
17
+ };
18
+ /**
19
+ * The `ChatContextAccordion` component provides a context menu for the chat.
20
+ *
21
+ * See the [ChatContextAccordion documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-context-accordion) for more information.
22
+ */
23
+ export declare const ChatContextAccordion: ({ header, icon, children, className, defaultOpen, ...props }: ChatContextAccordionProps) => import("react/jsx-runtime").JSX.Element;
@@ -8,19 +8,26 @@ exports.ChatContextAccordion = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _ChatContextAccordion = require("./ChatContextAccordion.styles");
11
- var _Actions = require("./../../../Actions");
11
+ var _Actions = require("./../../Actions");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
- var _excluded = ["header", "icon", "children", "className"];
13
+ var _excluded = ["header", "icon", "children", "className", "defaultOpen"];
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
+ /**
17
+ * The `ChatContextAccordion` component provides a context menu for the chat.
18
+ *
19
+ * See the [ChatContextAccordion documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-context-accordion) for more information.
20
+ */
16
21
  var ChatContextAccordion = exports.ChatContextAccordion = function ChatContextAccordion(_ref) {
17
22
  var header = _ref.header,
18
23
  icon = _ref.icon,
19
24
  children = _ref.children,
20
25
  className = _ref.className,
26
+ defaultOpen = _ref.defaultOpen,
21
27
  props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
22
28
  var styles = (0, _ChatContextAccordion.chatContextAccordionStyles)();
23
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Actions.Accordion, _objectSpread(_objectSpread({}, props), {}, {
30
+ defaultValue: defaultOpen ? "default" : undefined,
24
31
  className: styles.base({
25
32
  className: className
26
33
  }),
@@ -6,8 +6,8 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
6
6
  title?: import("tailwind-merge").ClassNameValue;
7
7
  content?: import("tailwind-merge").ClassNameValue;
8
8
  item?: import("tailwind-merge").ClassNameValue;
9
- iconBg?: import("tailwind-merge").ClassNameValue;
10
9
  trigger?: import("tailwind-merge").ClassNameValue;
10
+ iconBg?: import("tailwind-merge").ClassNameValue;
11
11
  titleWrapper?: import("tailwind-merge").ClassNameValue;
12
12
  };
13
13
  };
@@ -19,8 +19,8 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
19
19
  title?: import("tailwind-merge").ClassNameValue;
20
20
  content?: import("tailwind-merge").ClassNameValue;
21
21
  item?: import("tailwind-merge").ClassNameValue;
22
- iconBg?: import("tailwind-merge").ClassNameValue;
23
22
  trigger?: import("tailwind-merge").ClassNameValue;
23
+ iconBg?: import("tailwind-merge").ClassNameValue;
24
24
  titleWrapper?: import("tailwind-merge").ClassNameValue;
25
25
  };
26
26
  };
@@ -34,6 +34,12 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
34
34
  title: string;
35
35
  content: string;
36
36
  }, undefined, {
37
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {} | undefined;
38
+ } & import("tailwind-variants/dist/config").TWMConfig & {
39
+ twMergeConfig: {
40
+ prefix: string;
41
+ };
42
+ }, {
37
43
  [key: string]: {
38
44
  [key: string]: import("tailwind-merge").ClassNameValue | {
39
45
  base?: import("tailwind-merge").ClassNameValue;
@@ -41,8 +47,8 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
41
47
  title?: import("tailwind-merge").ClassNameValue;
42
48
  content?: import("tailwind-merge").ClassNameValue;
43
49
  item?: import("tailwind-merge").ClassNameValue;
44
- iconBg?: import("tailwind-merge").ClassNameValue;
45
50
  trigger?: import("tailwind-merge").ClassNameValue;
51
+ iconBg?: import("tailwind-merge").ClassNameValue;
46
52
  titleWrapper?: import("tailwind-merge").ClassNameValue;
47
53
  };
48
54
  };
@@ -64,4 +70,17 @@ export declare const chatContextAccordionStyles: import("tailwind-variants").TVR
64
70
  titleWrapper: string;
65
71
  title: string;
66
72
  content: string;
67
- }, undefined, unknown, unknown, undefined>>;
73
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<unknown, {
74
+ [key: string]: {
75
+ [key: string]: import("tailwind-merge").ClassNameValue | {
76
+ base?: import("tailwind-merge").ClassNameValue;
77
+ header?: import("tailwind-merge").ClassNameValue;
78
+ title?: import("tailwind-merge").ClassNameValue;
79
+ content?: import("tailwind-merge").ClassNameValue;
80
+ item?: import("tailwind-merge").ClassNameValue;
81
+ trigger?: import("tailwind-merge").ClassNameValue;
82
+ iconBg?: import("tailwind-merge").ClassNameValue;
83
+ titleWrapper?: import("tailwind-merge").ClassNameValue;
84
+ };
85
+ };
86
+ } | {}>, unknown, unknown, undefined>>;
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.chatContextAccordionStyles = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _satellitePrefixer = _interopRequireDefault(require("./../../../styles/helpers/satellitePrefixer"));
10
- var _tv = require("./../../../styles/helpers/tv");
9
+ var _satellitePrefixer = _interopRequireDefault(require("./../../styles/helpers/satellitePrefixer"));
10
+ var _tv = require("./../../styles/helpers/tv");
11
11
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
12
12
  var chatContextAccordionStyles = exports.chatContextAccordionStyles = (0, _tv.tv)({
13
13
  slots: {
@@ -18,6 +18,6 @@ var chatContextAccordionStyles = exports.chatContextAccordionStyles = (0, _tv.tv
18
18
  trigger: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["!px-2 !py-0.5"]))),
19
19
  titleWrapper: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["gap-x-1"]))),
20
20
  title: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["typo-subdued typo-display-caption"]))),
21
- content: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100 [&>div]:px-3 [&>div]:py-2 overflow-y-auto max-h-36"])))
21
+ content: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100 [&>div]:px-3 [&>div]:py-2 overflow-y-auto max-h-36 data-[state=closed]:overflow-y-hidden"])))
22
22
  }
23
23
  });
@@ -1,38 +1,115 @@
1
1
  import type { HTMLAttributes, MouseEvent, ReactElement, ReactNode, Ref } from "react";
2
2
  import type { VariantProps } from "tailwind-variants";
3
3
  import { chatMessageStyles } from "./ChatMessage.styles";
4
- import type { IconButtonWithFeedbackProps } from "../../../Actions";
5
- import type { UserAvatarProps } from "../../../Indicators";
4
+ import type { IconButtonWithFeedbackProps } from "../../Actions";
5
+ import type { UserAvatarProps } from "../../Indicators";
6
6
  declare type ChatMessageVariants = VariantProps<typeof chatMessageStyles>;
7
7
  declare type Actions<ActionsExtraData extends Record<string, any> = Record<string, any>> = Array<Omit<IconButtonWithFeedbackProps, "onClick" | "tooltipDelay" | "tooltipHideDelay"> & {
8
8
  onClick?: (e: MouseEvent<HTMLButtonElement>, actionsExtraData?: ActionsExtraData) => Promise<void> | void;
9
9
  }>;
10
10
  export declare type ChatMessageProps<ActionsExtraData extends Record<string, any> = Record<string, any>> = Omit<HTMLAttributes<HTMLElement>, "children" | "content"> & {
11
+ /**
12
+ * The content of the message.
13
+ */
11
14
  content: ReactNode;
15
+ /**
16
+ * The avatar of the message.
17
+ */
12
18
  avatar?: UserAvatarProps["user"];
19
+ /**
20
+ * The size of the avatar.
21
+ */
13
22
  avatarSize?: UserAvatarProps["size"];
23
+ /**
24
+ * The side of the message.
25
+ */
14
26
  side?: ChatMessageVariants["side"];
27
+ /**
28
+ * The variant of the message.
29
+ */
15
30
  variant?: ChatMessageVariants["variant"];
31
+ /**
32
+ * The actions of the message.
33
+ */
16
34
  actions?: Actions<ActionsExtraData>;
35
+ /**
36
+ * Whether to automatically hide the actions.
37
+ */
17
38
  autoHideActions?: boolean;
39
+ /**
40
+ * The leading content of the message.
41
+ */
18
42
  renderLeading?: ReactNode;
43
+ /**
44
+ * The actions content of the message.
45
+ */
19
46
  renderActions?: (actions?: Actions<ActionsExtraData>) => ReactNode;
47
+ /**
48
+ * The footer content of the message.
49
+ */
20
50
  renderFooter?: ReactNode;
51
+ /**
52
+ * The extra data of the actions.
53
+ */
21
54
  actionsExtraData?: ActionsExtraData;
55
+ /**
56
+ * Whether to render the message in RTL.
57
+ */
22
58
  rtl?: boolean;
23
59
  };
60
+ /**
61
+ * The `ChatMessage` component provides a message to display in the chat.
62
+ *
63
+ * See the [ChatMessage documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message) for more information.
64
+ */
24
65
  export declare const ChatMessage: <ActionsExtraData extends Record<string, any> = Record<string, any>>(props: Omit<HTMLAttributes<HTMLElement>, "children" | "content"> & {
66
+ /**
67
+ * The content of the message.
68
+ */
25
69
  content: ReactNode;
26
- avatar?: import("../../../Indicators/Avatars/types").MinimalUser | undefined;
70
+ /**
71
+ * The avatar of the message.
72
+ */
73
+ avatar?: import("../../Indicators/Avatars/types").MinimalUser | undefined;
74
+ /**
75
+ * The size of the avatar.
76
+ */
27
77
  avatarSize?: UserAvatarProps["size"];
78
+ /**
79
+ * The side of the message.
80
+ */
28
81
  side?: ChatMessageVariants["side"];
82
+ /**
83
+ * The variant of the message.
84
+ */
29
85
  variant?: ChatMessageVariants["variant"];
86
+ /**
87
+ * The actions of the message.
88
+ */
30
89
  actions?: Actions<ActionsExtraData> | undefined;
90
+ /**
91
+ * Whether to automatically hide the actions.
92
+ */
31
93
  autoHideActions?: boolean | undefined;
94
+ /**
95
+ * The leading content of the message.
96
+ */
32
97
  renderLeading?: ReactNode;
98
+ /**
99
+ * The actions content of the message.
100
+ */
33
101
  renderActions?: ((actions?: Actions<ActionsExtraData> | undefined) => ReactNode) | undefined;
102
+ /**
103
+ * The footer content of the message.
104
+ */
34
105
  renderFooter?: ReactNode;
106
+ /**
107
+ * The extra data of the actions.
108
+ */
35
109
  actionsExtraData?: ActionsExtraData | undefined;
110
+ /**
111
+ * Whether to render the message in RTL.
112
+ */
36
113
  rtl?: boolean | undefined;
37
114
  } & {
38
115
  ref?: Ref<HTMLDivElement> | undefined;
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = require("react");
11
11
  var _ChatMessage = require("./ChatMessage.styles");
12
- var _Actions = require("./../../../Actions");
13
- var _Indicators = require("./../../../Indicators");
12
+ var _Actions = require("./../../Actions");
13
+ var _Indicators = require("./../../Indicators");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
  var _excluded = ["content", "avatar", "avatarSize", "side", "variant", "actions", "autoHideActions", "renderLeading", "renderActions", "renderFooter", "actionsExtraData", "rtl", "className"];
16
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -50,10 +50,10 @@ var ChatMessageBase = function ChatMessageBase(_ref, ref) {
50
50
  className: styles.container(),
51
51
  children: [(!!avatar || !!renderLeading) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
52
52
  className: styles.leading(),
53
- children: avatar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Indicators.UserAvatar, {
53
+ children: renderLeading || avatar && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Indicators.UserAvatar, {
54
54
  user: avatar,
55
55
  size: avatarSize
56
- }) : renderLeading
56
+ })
57
57
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
58
58
  className: styles.content(),
59
59
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -75,9 +75,18 @@ var ChatMessageBase = function ChatMessageBase(_ref, ref) {
75
75
  tooltipHideDelay: 0
76
76
  }), index);
77
77
  }))
78
- }), renderFooter]
78
+ }), !!renderFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
79
+ className: styles.footer(),
80
+ children: renderFooter
81
+ })]
79
82
  })]
80
83
  })
81
84
  }));
82
85
  };
86
+
87
+ /**
88
+ * The `ChatMessage` component provides a message to display in the chat.
89
+ *
90
+ * See the [ChatMessage documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message) for more information.
91
+ */
83
92
  var ChatMessage = exports.ChatMessage = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(ChatMessageBase));
@@ -1,44 +1,50 @@
1
- export declare const chatMessageErrorStyles: import("tailwind-variants").TVReturnType<{
2
- [key: string]: {
3
- [key: string]: import("tailwind-merge").ClassNameValue | {
4
- content?: import("tailwind-merge").ClassNameValue;
5
- };
6
- };
7
- } | {
1
+ export declare const chatMessageStyles: import("tailwind-variants").TVReturnType<{
8
2
  variant: {
9
- neutral: import("tailwind-merge").ClassNameValue | {
10
- content?: import("tailwind-merge").ClassNameValue;
3
+ neutral: {
4
+ message: string;
11
5
  };
12
- subtle: import("tailwind-merge").ClassNameValue | {
13
- content?: import("tailwind-merge").ClassNameValue;
6
+ subtle: {
7
+ message: string;
14
8
  };
15
9
  };
16
10
  side: {
17
- left: import("tailwind-merge").ClassNameValue | {
18
- content?: import("tailwind-merge").ClassNameValue;
11
+ left: {
12
+ container: string;
19
13
  };
20
- right: import("tailwind-merge").ClassNameValue | {
21
- content?: import("tailwind-merge").ClassNameValue;
14
+ right: {
15
+ container: string;
22
16
  };
23
17
  };
24
18
  leading: {
25
- true: import("tailwind-merge").ClassNameValue | {
26
- content?: import("tailwind-merge").ClassNameValue;
27
- };
19
+ true: string;
28
20
  };
29
21
  actions: {
30
- true: import("tailwind-merge").ClassNameValue | {
31
- content?: import("tailwind-merge").ClassNameValue;
32
- };
22
+ true: string;
33
23
  };
34
24
  autoHideActions: {
35
- true: import("tailwind-merge").ClassNameValue | {
36
- content?: import("tailwind-merge").ClassNameValue;
37
- };
25
+ true: string;
38
26
  };
39
27
  }, {
28
+ base: string;
29
+ container: string;
30
+ leading: string;
40
31
  content: string;
32
+ message: string;
33
+ actions: string;
34
+ footer: string;
41
35
  }, undefined, {
36
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
37
+ variant?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
38
+ leading?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
39
+ side?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
40
+ actions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
41
+ autoHideActions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
42
+ } | undefined;
43
+ } & import("tailwind-variants/dist/config").TWMConfig & {
44
+ twMergeConfig: {
45
+ prefix: string;
46
+ };
47
+ }, {
42
48
  variant: {
43
49
  neutral: {
44
50
  message: string;
@@ -71,6 +77,7 @@ export declare const chatMessageErrorStyles: import("tailwind-variants").TVRetur
71
77
  content: string;
72
78
  message: string;
73
79
  actions: string;
80
+ footer: string;
74
81
  }, import("tailwind-variants").TVReturnType<{
75
82
  variant: {
76
83
  neutral: {
@@ -104,7 +111,8 @@ export declare const chatMessageErrorStyles: import("tailwind-variants").TVRetur
104
111
  content: string;
105
112
  message: string;
106
113
  actions: string;
107
- }, undefined, {
114
+ footer: string;
115
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
108
116
  variant: {
109
117
  neutral: {
110
118
  message: string;
@@ -131,13 +139,6 @@ export declare const chatMessageErrorStyles: import("tailwind-variants").TVRetur
131
139
  true: string;
132
140
  };
133
141
  }, {
134
- base: string;
135
- container: string;
136
- leading: string;
137
- content: string;
138
- message: string;
139
- actions: string;
140
- }, import("tailwind-variants").TVReturnType<{
141
142
  variant: {
142
143
  neutral: {
143
144
  message: string;
@@ -163,11 +164,4 @@ export declare const chatMessageErrorStyles: import("tailwind-variants").TVRetur
163
164
  autoHideActions: {
164
165
  true: string;
165
166
  };
166
- }, {
167
- base: string;
168
- container: string;
169
- leading: string;
170
- content: string;
171
- message: string;
172
- actions: string;
173
- }, undefined, unknown, unknown, undefined>>>;
167
+ }>, unknown, unknown, undefined>>;
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.chatMessageStyles = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _satellitePrefixer = _interopRequireDefault(require("./../../../styles/helpers/satellitePrefixer"));
10
- var _tv = require("./../../../styles/helpers/tv");
9
+ var _satellitePrefixer = _interopRequireDefault(require("./../../styles/helpers/satellitePrefixer"));
10
+ var _tv = require("./../../styles/helpers/tv");
11
11
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
12
12
  var chatMessageStyles = exports.chatMessageStyles = (0, _tv.tv)({
13
13
  slots: {
@@ -16,40 +16,40 @@ var chatMessageStyles = exports.chatMessageStyles = (0, _tv.tv)({
16
16
  leading: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["inline-flex items-center justify-center"]))),
17
17
  content: (0, _satellitePrefixer["default"])(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["flex flex-col gap-3 group-data-[role=assistant]/message:grow overflow-y-hidden overflow-x-auto"]))),
18
18
  message: (0, _satellitePrefixer["default"])(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["relative text-pretty typo-display-body"]))),
19
- actions: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["flex items-center gap-1"])))
19
+ actions: (0, _satellitePrefixer["default"])(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["flex items-center gap-1"]))),
20
+ footer: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])([""])))
20
21
  },
21
22
  variants: {
22
23
  variant: {
23
24
  neutral: {
24
- message: (0, _satellitePrefixer["default"])(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100"])))
25
+ message: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["bg-grey-100"])))
25
26
  },
26
27
  subtle: {
27
- message: (0, _satellitePrefixer["default"])(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])([""])))
28
+ message: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])([""])))
28
29
  }
29
30
  },
30
31
  side: {
31
32
  left: {
32
- container: (0, _satellitePrefixer["default"])(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["rtl:justify-end"])))
33
+ container: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["justify-start"])))
33
34
  },
34
35
  right: {
35
- container: (0, _satellitePrefixer["default"])(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["ltr:justify-end ms-auto"])))
36
+ container: (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["justify-end ms-auto"])))
36
37
  }
37
38
  },
38
39
  leading: {
39
- "true": (0, _satellitePrefixer["default"])(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])([""])))
40
+ "true": (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])([""])))
40
41
  },
41
42
  actions: {
42
- "true": (0, _satellitePrefixer["default"])(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])([""])))
43
+ "true": (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])([""])))
43
44
  },
44
45
  autoHideActions: {
45
- "true": (0, _satellitePrefixer["default"])(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])([""])))
46
+ "true": (0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])([""])))
46
47
  }
47
48
  },
48
49
  compoundVariants: [{
49
50
  variant: "neutral",
50
51
  className: {
51
- message: (0, _satellitePrefixer["default"])(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["p-3 rounded-[8px]"]))),
52
- leading: (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["mt-3"])))
52
+ message: (0, _satellitePrefixer["default"])(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["p-3 rounded-[8px]"])))
53
53
  }
54
54
  }, {
55
55
  leading: true,
@@ -1,6 +1,6 @@
1
1
  import type { HTMLAttributes, ReactNode } from "react";
2
- import type { ButtonProps } from "../../../Actions";
3
- import type { ChatMessageProps } from "../../../Layout/Chat/ChatMessage";
2
+ import type { ButtonProps } from "../../Actions";
3
+ import type { ChatMessageProps } from "../../Chat/ChatMessage";
4
4
  export declare type ChatMessageErrorLocale = {
5
5
  error?: string;
6
6
  retry?: string;
@@ -30,6 +30,11 @@ export declare type ChatMessageErrorProps = Omit<HTMLAttributes<HTMLElement>, "c
30
30
  */
31
31
  locale?: ChatMessageErrorLocale;
32
32
  };
33
+ /**
34
+ * The `ChatMessageError` component provides a message to display when an error occurs.
35
+ *
36
+ * See the [ChatMessageError documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message-error) for more information.
37
+ */
33
38
  export declare const ChatMessageError: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children"> & Pick<ChatMessageProps<Record<string, any>>, "rtl"> & {
34
39
  /**
35
40
  * Content to render as the error message.
@@ -9,9 +9,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = require("react");
11
11
  var _ChatMessageError = require("./ChatMessageError.styles");
12
- var _Actions = require("./../../../Actions");
13
- var _Icons = require("./../../../Icons");
14
- var _Satellite = require("./../../../Satellite");
12
+ var _Actions = require("./../../Actions");
13
+ var _Icons = require("./../../Icons");
14
+ var _Satellite = require("./../../Satellite");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
16
  var _excluded = ["renderError", "actions", "renderFooter", "locale", "onReload", "rtl", "className"];
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -20,6 +20,11 @@ var DEFAULT_CHAT_MESSAGE_ERROR_LOCALE = {
20
20
  error: "Sorry, we are not able to generate a response at the moment. Please retry or contact support.",
21
21
  retry: "Retry"
22
22
  };
23
+ /**
24
+ * The `ChatMessageError` component provides a message to display when an error occurs.
25
+ *
26
+ * See the [ChatMessageError documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message-error) for more information.
27
+ */
23
28
  var ChatMessageError = exports.ChatMessageError = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
24
29
  var renderError = _ref.renderError,
25
30
  actions = _ref.actions,