@algolia/satellite 2.3.0-rc.5 → 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 (160) 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/Checkbox/Checkbox.d.ts +2 -2
  32. package/dist/cjs/Fields/Checkbox/Checkbox.js +2 -2
  33. package/dist/cjs/Fields/Dropzone/Dropzone.js +1 -1
  34. package/dist/cjs/Fields/Form/stories/Complex.js +123 -50
  35. package/dist/cjs/Fields/RadioGroup/RadioButton.js +9 -2
  36. package/dist/cjs/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
  37. package/dist/cjs/Fields/RadioGroup/RadioGroupItem.js +1 -1
  38. package/dist/cjs/Fields/SelectableCard/SelectableCard.d.ts +35 -0
  39. package/dist/cjs/Fields/SelectableCard/SelectableCard.js +105 -0
  40. package/dist/cjs/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
  41. package/dist/cjs/Fields/SelectableCard/SelectableCardContext.js +15 -0
  42. package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
  43. package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.js +55 -0
  44. package/dist/cjs/Fields/SelectableCard/index.d.ts +2 -0
  45. package/dist/cjs/Fields/SelectableCard/index.js +27 -0
  46. package/dist/cjs/Fields/Switch/Switch.js +1 -1
  47. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
  48. package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
  49. package/dist/cjs/Fields/index.d.ts +1 -0
  50. package/dist/cjs/Fields/index.js +11 -0
  51. package/dist/cjs/Helpers/utilities/focusable.tailwind.js +1 -1
  52. package/dist/cjs/Layout/index.d.ts +0 -1
  53. package/dist/cjs/Layout/index.js +0 -11
  54. package/dist/cjs/Satellite/locale.d.ts +3 -3
  55. package/dist/cjs/index.d.ts +1 -0
  56. package/dist/cjs/index.js +12 -0
  57. package/dist/cjs/styles/helpers/tv.d.ts +5 -1
  58. package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
  59. package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
  60. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
  61. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +23 -4
  62. package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
  63. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
  64. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
  65. package/dist/{cjs/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → esm/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
  66. package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +12 -12
  67. package/dist/{cjs/Layout → esm}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
  68. package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
  69. package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
  70. package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
  71. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
  72. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
  73. package/dist/{cjs/Layout → esm}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
  74. package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +2 -2
  75. package/dist/esm/Chat/ChatMessages/ChatMessages.d.ts +141 -0
  76. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +18 -7
  77. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
  78. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
  79. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.d.ts +7 -1
  80. package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +6 -0
  81. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.d.ts +16 -2
  82. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +33 -20
  83. package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
  84. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +10 -3
  85. package/dist/esm/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
  86. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useFocusTyping.js +19 -14
  87. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
  88. package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
  89. package/dist/esm/Fields/Checkbox/Checkbox.d.ts +2 -2
  90. package/dist/esm/Fields/Checkbox/Checkbox.js +2 -2
  91. package/dist/esm/Fields/Dropzone/Dropzone.js +1 -1
  92. package/dist/esm/Fields/Form/stories/Complex.js +123 -50
  93. package/dist/esm/Fields/RadioGroup/RadioButton.js +10 -3
  94. package/dist/esm/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
  95. package/dist/esm/Fields/RadioGroup/RadioGroupItem.js +1 -1
  96. package/dist/esm/Fields/SelectableCard/SelectableCard.d.ts +35 -0
  97. package/dist/esm/Fields/SelectableCard/SelectableCard.js +100 -0
  98. package/dist/esm/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
  99. package/dist/esm/Fields/SelectableCard/SelectableCardContext.js +9 -0
  100. package/dist/esm/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
  101. package/dist/esm/Fields/SelectableCard/SelectableCardGroup.js +48 -0
  102. package/dist/esm/Fields/SelectableCard/index.d.ts +2 -0
  103. package/dist/esm/Fields/SelectableCard/index.js +2 -0
  104. package/dist/esm/Fields/Switch/Switch.js +1 -1
  105. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
  106. package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
  107. package/dist/esm/Fields/index.d.ts +1 -0
  108. package/dist/esm/Fields/index.js +1 -0
  109. package/dist/esm/Helpers/utilities/focusable.tailwind.js +1 -1
  110. package/dist/esm/Layout/index.d.ts +0 -1
  111. package/dist/esm/Layout/index.js +0 -1
  112. package/dist/esm/Satellite/locale.d.ts +3 -3
  113. package/dist/esm/index.d.ts +1 -0
  114. package/dist/esm/index.js +1 -0
  115. package/dist/esm/styles/helpers/tv.d.ts +5 -1
  116. package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
  117. package/dist/satellite.min.css +1 -1
  118. package/package.json +3 -3
  119. package/dist/cjs/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
  120. package/dist/cjs/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
  121. package/dist/cjs/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
  122. package/dist/cjs/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
  123. package/dist/cjs/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
  124. package/dist/esm/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
  125. package/dist/esm/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
  126. package/dist/esm/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
  127. package/dist/esm/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
  128. package/dist/esm/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
  129. /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
  130. /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
  131. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
  132. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
  133. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
  134. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
  135. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
  136. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
  137. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
  138. /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
  139. /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
  140. /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
  141. /package/dist/cjs/{Layout/Chat → Chat}/index.d.ts +0 -0
  142. /package/dist/cjs/{Layout/Chat → Chat}/index.js +0 -0
  143. /package/dist/cjs/{Layout/Chat → Chat}/types.d.ts +0 -0
  144. /package/dist/cjs/{Layout/Chat → Chat}/types.js +0 -0
  145. /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
  146. /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
  147. /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
  148. /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
  149. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
  150. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
  151. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
  152. /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
  153. /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
  154. /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
  155. /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
  156. /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
  157. /package/dist/esm/{Layout/Chat → Chat}/index.d.ts +0 -0
  158. /package/dist/esm/{Layout/Chat → Chat}/index.js +0 -0
  159. /package/dist/esm/{Layout/Chat → Chat}/types.d.ts +0 -0
  160. /package/dist/esm/{Layout/Chat → Chat}/types.js +0 -0
@@ -7,10 +7,15 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
7
7
  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) { _defineProperty(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; }
8
8
  import { forwardRef } from "react";
9
9
  import { chatMessageLoaderStyles } from "./ChatMessageLoader.styles";
10
- import { ShimmerText } from "./../../../Helpers/ShimmerText/ShimmerText";
11
- import { ProgressSpinner, Skeleton } from "./../../../Indicators";
12
- import stl from "./../../../styles/helpers/satellitePrefixer";
10
+ import { ShimmerText } from "./../../Helpers/ShimmerText/ShimmerText";
11
+ import { ProgressSpinner, Skeleton } from "./../../Indicators";
12
+ import stl from "./../../styles/helpers/satellitePrefixer";
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ /**
15
+ * The `ChatMessageLoader` component provides a message to display when a response is being generated.
16
+ *
17
+ * See the [ChatMessageLoader documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message-loader) for more information.
18
+ */
14
19
  export var ChatMessageLoader = /*#__PURE__*/forwardRef(function (_ref, ref) {
15
20
  var message = _ref.message,
16
21
  rtl = _ref.rtl,
@@ -36,7 +41,7 @@ export var ChatMessageLoader = /*#__PURE__*/forwardRef(function (_ref, ref) {
36
41
  className: styles.content(),
37
42
  children: /*#__PURE__*/_jsxs("div", {
38
43
  className: styles.message(),
39
- children: [/*#__PURE__*/_jsx(ShimmerText, {
44
+ children: [!!message && /*#__PURE__*/_jsx(ShimmerText, {
40
45
  children: message
41
46
  }), /*#__PURE__*/_jsxs("div", {
42
47
  className: styles.skeletonWrapper(),
@@ -2,62 +2,62 @@ export declare const chatMessageLoaderStyles: import("tailwind-variants").TVRetu
2
2
  [key: string]: {
3
3
  [key: string]: import("tailwind-merge").ClassNameValue | {
4
4
  content?: import("tailwind-merge").ClassNameValue;
5
+ skeleton?: import("tailwind-merge").ClassNameValue;
5
6
  message?: import("tailwind-merge").ClassNameValue;
6
7
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
7
- skeleton?: import("tailwind-merge").ClassNameValue;
8
8
  };
9
9
  };
10
10
  } | {
11
11
  variant: {
12
12
  neutral: import("tailwind-merge").ClassNameValue | {
13
13
  content?: import("tailwind-merge").ClassNameValue;
14
+ skeleton?: import("tailwind-merge").ClassNameValue;
14
15
  message?: import("tailwind-merge").ClassNameValue;
15
16
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
16
- skeleton?: import("tailwind-merge").ClassNameValue;
17
17
  };
18
18
  subtle: import("tailwind-merge").ClassNameValue | {
19
19
  content?: import("tailwind-merge").ClassNameValue;
20
+ skeleton?: import("tailwind-merge").ClassNameValue;
20
21
  message?: import("tailwind-merge").ClassNameValue;
21
22
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
22
- skeleton?: import("tailwind-merge").ClassNameValue;
23
23
  };
24
24
  };
25
25
  side: {
26
26
  left: import("tailwind-merge").ClassNameValue | {
27
27
  content?: import("tailwind-merge").ClassNameValue;
28
+ skeleton?: import("tailwind-merge").ClassNameValue;
28
29
  message?: import("tailwind-merge").ClassNameValue;
29
30
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
30
- skeleton?: import("tailwind-merge").ClassNameValue;
31
31
  };
32
32
  right: import("tailwind-merge").ClassNameValue | {
33
33
  content?: import("tailwind-merge").ClassNameValue;
34
+ skeleton?: import("tailwind-merge").ClassNameValue;
34
35
  message?: import("tailwind-merge").ClassNameValue;
35
36
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
36
- skeleton?: import("tailwind-merge").ClassNameValue;
37
37
  };
38
38
  };
39
39
  leading: {
40
40
  true: import("tailwind-merge").ClassNameValue | {
41
41
  content?: import("tailwind-merge").ClassNameValue;
42
+ skeleton?: import("tailwind-merge").ClassNameValue;
42
43
  message?: import("tailwind-merge").ClassNameValue;
43
44
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
44
- skeleton?: import("tailwind-merge").ClassNameValue;
45
45
  };
46
46
  };
47
47
  actions: {
48
48
  true: import("tailwind-merge").ClassNameValue | {
49
49
  content?: import("tailwind-merge").ClassNameValue;
50
+ skeleton?: import("tailwind-merge").ClassNameValue;
50
51
  message?: import("tailwind-merge").ClassNameValue;
51
52
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
52
- skeleton?: import("tailwind-merge").ClassNameValue;
53
53
  };
54
54
  };
55
55
  autoHideActions: {
56
56
  true: import("tailwind-merge").ClassNameValue | {
57
57
  content?: import("tailwind-merge").ClassNameValue;
58
+ skeleton?: import("tailwind-merge").ClassNameValue;
58
59
  message?: import("tailwind-merge").ClassNameValue;
59
60
  skeletonWrapper?: import("tailwind-merge").ClassNameValue;
60
- skeleton?: import("tailwind-merge").ClassNameValue;
61
61
  };
62
62
  };
63
63
  }, {
@@ -66,6 +66,18 @@ export declare const chatMessageLoaderStyles: import("tailwind-variants").TVRetu
66
66
  skeletonWrapper: string;
67
67
  skeleton: string;
68
68
  }, undefined, {
69
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
70
+ variant?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
71
+ leading?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
72
+ side?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
73
+ actions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
74
+ autoHideActions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
75
+ } | undefined;
76
+ } & import("tailwind-variants/dist/config").TWMConfig & {
77
+ twMergeConfig: {
78
+ prefix: string;
79
+ };
80
+ }, {
69
81
  variant: {
70
82
  neutral: {
71
83
  message: string;
@@ -98,6 +110,7 @@ export declare const chatMessageLoaderStyles: import("tailwind-variants").TVRetu
98
110
  content: string;
99
111
  message: string;
100
112
  actions: string;
113
+ footer: string;
101
114
  }, import("tailwind-variants").TVReturnType<{
102
115
  variant: {
103
116
  neutral: {
@@ -131,7 +144,20 @@ export declare const chatMessageLoaderStyles: import("tailwind-variants").TVRetu
131
144
  content: string;
132
145
  message: string;
133
146
  actions: string;
147
+ footer: string;
134
148
  }, undefined, {
149
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
150
+ variant?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
151
+ leading?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
152
+ side?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
153
+ actions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
154
+ autoHideActions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
155
+ } | undefined;
156
+ } & import("tailwind-variants/dist/config").TWMConfig & {
157
+ twMergeConfig: {
158
+ prefix: string;
159
+ };
160
+ }, {
135
161
  variant: {
136
162
  neutral: {
137
163
  message: string;
@@ -164,6 +190,7 @@ export declare const chatMessageLoaderStyles: import("tailwind-variants").TVRetu
164
190
  content: string;
165
191
  message: string;
166
192
  actions: string;
193
+ footer: string;
167
194
  }, import("tailwind-variants").TVReturnType<{
168
195
  variant: {
169
196
  neutral: {
@@ -197,4 +224,57 @@ export declare const chatMessageLoaderStyles: import("tailwind-variants").TVRetu
197
224
  content: string;
198
225
  message: string;
199
226
  actions: string;
200
- }, undefined, unknown, unknown, undefined>>>;
227
+ footer: string;
228
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
229
+ variant: {
230
+ neutral: {
231
+ message: string;
232
+ };
233
+ subtle: {
234
+ message: string;
235
+ };
236
+ };
237
+ side: {
238
+ left: {
239
+ container: string;
240
+ };
241
+ right: {
242
+ container: string;
243
+ };
244
+ };
245
+ leading: {
246
+ true: string;
247
+ };
248
+ actions: {
249
+ true: string;
250
+ };
251
+ autoHideActions: {
252
+ true: string;
253
+ };
254
+ }, {
255
+ variant: {
256
+ neutral: {
257
+ message: string;
258
+ };
259
+ subtle: {
260
+ message: string;
261
+ };
262
+ };
263
+ side: {
264
+ left: {
265
+ container: string;
266
+ };
267
+ right: {
268
+ container: string;
269
+ };
270
+ };
271
+ leading: {
272
+ true: string;
273
+ };
274
+ actions: {
275
+ true: string;
276
+ };
277
+ autoHideActions: {
278
+ true: string;
279
+ };
280
+ }>, unknown, unknown, undefined>>>;
@@ -1,8 +1,8 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
3
  import { chatMessageStyles } from "./../ChatMessage/ChatMessage.styles";
4
- import stl from "./../../../styles/helpers/satellitePrefixer";
5
- import { tv } from "./../../../styles/helpers/tv";
4
+ import stl from "./../../styles/helpers/satellitePrefixer";
5
+ import { tv } from "./../../styles/helpers/tv";
6
6
  export var chatMessageLoaderStyles = tv({
7
7
  extend: chatMessageStyles,
8
8
  slots: {
@@ -0,0 +1,141 @@
1
+ import type { HTMLAttributes, ReactElement, ReactNode, Ref } from "react";
2
+ import type { ChatMessageProps } from "../../Chat/ChatMessage";
3
+ import type { ChatMessageErrorProps } from "../../Chat/ChatMessageError";
4
+ import type { ChatMessageLoaderProps } from "../../Chat/ChatMessageLoader";
5
+ import type { ChatMessageBase, ChatStatus } from "../../Chat/types";
6
+ export declare type ChatMessageLocale = {
7
+ scrollToBottomText?: string;
8
+ };
9
+ declare type ChatMessageWithoutContent<Message extends ChatMessageBase> = Omit<ChatMessageProps<Message>, "content">;
10
+ export declare type ChatMessagesProps<Message extends ChatMessageBase = ChatMessageBase> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
11
+ /**
12
+ * The messages to display in the chat.
13
+ */
14
+ messages: Message[];
15
+ /**
16
+ * The props for the user message.
17
+ */
18
+ userMessageProps?: ChatMessageWithoutContent<Message> | ((message: Message) => ChatMessageWithoutContent<Message>);
19
+ /**
20
+ * The props for the assistant message.
21
+ */
22
+ assistantMessageProps?: ChatMessageWithoutContent<Message> | ((message: Message) => ChatMessageWithoutContent<Message>);
23
+ /**
24
+ * The props for the loader message.
25
+ */
26
+ loaderProps?: ChatMessageLoaderProps;
27
+ /**
28
+ * The props for the error message.
29
+ */
30
+ errorProps?: Omit<ChatMessageErrorProps, "onReload">;
31
+ /**
32
+ * The function to render the message.
33
+ */
34
+ renderMessage?: (message: Message) => ReactNode;
35
+ /**
36
+ * The function to render the loader message.
37
+ */
38
+ renderLoader?: ReactNode;
39
+ /**
40
+ * The function to render the error message.
41
+ */
42
+ renderError?: ReactNode;
43
+ /**
44
+ * The status of the chat.
45
+ */
46
+ status?: ChatStatus;
47
+ /**
48
+ * The function to reload the chat.
49
+ */
50
+ onReload?: () => void;
51
+ /**
52
+ * Whether to hide the scroll to bottom button.
53
+ */
54
+ hideScrollToBottom?: boolean;
55
+ /**
56
+ * The class name for the scroll container.
57
+ */
58
+ scrollClassName?: string;
59
+ /**
60
+ * The class name for the content container.
61
+ */
62
+ contentClassName?: string;
63
+ /**
64
+ * The locale for the chat messages.
65
+ */
66
+ locale?: ChatMessageLocale;
67
+ /**
68
+ * Whether to enable right-to-left text direction.
69
+ */
70
+ rtl?: boolean;
71
+ };
72
+ /**
73
+ * The `ChatMessages` component provides a list of messages to display in the chat.
74
+ *
75
+ * See the [ChatMessages documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-messages) for more information.
76
+ */
77
+ export declare const ChatMessages: <Message extends ChatMessageBase = ChatMessageBase>(props: Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
78
+ /**
79
+ * The messages to display in the chat.
80
+ */
81
+ messages: Message[];
82
+ /**
83
+ * The props for the user message.
84
+ */
85
+ userMessageProps?: ChatMessageWithoutContent<Message> | ((message: Message) => ChatMessageWithoutContent<Message>) | undefined;
86
+ /**
87
+ * The props for the assistant message.
88
+ */
89
+ assistantMessageProps?: ChatMessageWithoutContent<Message> | ((message: Message) => ChatMessageWithoutContent<Message>) | undefined;
90
+ /**
91
+ * The props for the loader message.
92
+ */
93
+ loaderProps?: ChatMessageLoaderProps | undefined;
94
+ /**
95
+ * The props for the error message.
96
+ */
97
+ errorProps?: Omit<ChatMessageErrorProps, "onReload"> | undefined;
98
+ /**
99
+ * The function to render the message.
100
+ */
101
+ renderMessage?: ((message: Message) => ReactNode) | undefined;
102
+ /**
103
+ * The function to render the loader message.
104
+ */
105
+ renderLoader?: ReactNode;
106
+ /**
107
+ * The function to render the error message.
108
+ */
109
+ renderError?: ReactNode;
110
+ /**
111
+ * The status of the chat.
112
+ */
113
+ status?: ChatStatus | undefined;
114
+ /**
115
+ * The function to reload the chat.
116
+ */
117
+ onReload?: (() => void) | undefined;
118
+ /**
119
+ * Whether to hide the scroll to bottom button.
120
+ */
121
+ hideScrollToBottom?: boolean | undefined;
122
+ /**
123
+ * The class name for the scroll container.
124
+ */
125
+ scrollClassName?: string | undefined;
126
+ /**
127
+ * The class name for the content container.
128
+ */
129
+ contentClassName?: string | undefined;
130
+ /**
131
+ * The locale for the chat messages.
132
+ */
133
+ locale?: ChatMessageLocale | undefined;
134
+ /**
135
+ * Whether to enable right-to-left text direction.
136
+ */
137
+ rtl?: boolean | undefined;
138
+ } & {
139
+ ref?: Ref<HTMLDivElement> | undefined;
140
+ }) => ReactElement | null;
141
+ export {};
@@ -2,19 +2,19 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["messages", "userMessageProps", "assistantMessageProps", "loaderProps", "errorProps", "renderMessage", "renderLoader", "renderError", "status", "onReload", "hideScrollToBottom", "className", "scrollClassName", "contentClassName", "locale"];
5
+ var _excluded = ["messages", "userMessageProps", "assistantMessageProps", "loaderProps", "errorProps", "renderMessage", "renderLoader", "renderError", "status", "onReload", "hideScrollToBottom", "className", "scrollClassName", "contentClassName", "locale", "rtl"];
6
6
  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; }
7
7
  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) { _defineProperty(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; }
8
8
  import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
9
9
  import { useStickToBottom } from "use-stick-to-bottom";
10
10
  import { chatMessagesStyles } from "./ChatMessages.styles";
11
11
  import { useLastMessageHeight } from "./useLastMessageHeight";
12
- import { IconButton } from "./../../../Actions";
13
- import { ChevronDownIcon } from "./../../../Icons";
12
+ import { IconButton } from "./../../Actions";
14
13
  import { ChatMessage } from "./../ChatMessage";
15
14
  import { ChatMessageError } from "./../ChatMessageError";
16
15
  import { ChatMessageLoader } from "./../ChatMessageLoader";
17
- import { useLocale } from "./../../../Satellite";
16
+ import { ChevronDownIcon } from "./../../Icons";
17
+ import { useLocale } from "./../../Satellite";
18
18
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  var DEFAULT_CHAT_MESSAGE_LOCALE = {
20
20
  scrollToBottomText: "Scroll to bottom"
@@ -42,6 +42,8 @@ var ChatMessagesBase = function ChatMessagesBase(_ref, forwardedRef) {
42
42
  scrollClassName = _ref.scrollClassName,
43
43
  contentClassName = _ref.contentClassName,
44
44
  propsLocale = _ref.locale,
45
+ _ref$rtl = _ref.rtl,
46
+ rtl = _ref$rtl === void 0 ? false : _ref$rtl,
45
47
  props = _objectWithoutProperties(_ref, _excluded);
46
48
  var contextLocale = useLocale("chatMessage");
47
49
  var locale = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CHAT_MESSAGE_LOCALE), contextLocale), propsLocale);
@@ -74,7 +76,7 @@ var ChatMessagesBase = function ChatMessagesBase(_ref, forwardedRef) {
74
76
  propsResult = resolveProps(assistantMessageProps, message);
75
77
 
76
78
  // If the last assistant message is streaming, we don't want to render actions or footer
77
- if (status === "streaming" && lastMessageId === message.id) {
79
+ if ((status === "streaming" || message.content.length === 0) && lastMessageId === message.id) {
78
80
  propsResult = _objectSpread(_objectSpread({}, propsResult), {}, {
79
81
  renderFooter: undefined,
80
82
  renderActions: undefined,
@@ -114,9 +116,11 @@ var ChatMessagesBase = function ChatMessagesBase(_ref, forwardedRef) {
114
116
  children: [messages.map(function (message) {
115
117
  var isAssistant = message.role === "assistant";
116
118
  var isLastUserMessage = (lastUserMessage === null || lastUserMessage === void 0 ? void 0 : lastUserMessage.id) === message.id;
119
+ var side = isAssistant ? "left" : "right";
117
120
  return /*#__PURE__*/_jsx(ChatMessage, _objectSpread(_objectSpread({
121
+ rtl: rtl,
118
122
  ref: isLastUserMessage ? lastUserMessageRef : undefined,
119
- side: isAssistant ? "left" : "right",
123
+ side: side,
120
124
  variant: isAssistant ? "subtle" : "neutral"
121
125
  }, getMessageProps(message)), {}, {
122
126
  content: renderMessage ? renderMessage(message) : message.content,
@@ -138,8 +142,15 @@ var ChatMessagesBase = function ChatMessagesBase(_ref, forwardedRef) {
138
142
  className: styles.scrollToBottom({
139
143
  isAtBottom: isAtBottom
140
144
  }),
141
- tooltipHideDelay: 0
145
+ tooltipHideDelay: 0,
146
+ tabIndex: isAtBottom ? -1 : 0
142
147
  })]
143
148
  }));
144
149
  };
150
+
151
+ /**
152
+ * The `ChatMessages` component provides a list of messages to display in the chat.
153
+ *
154
+ * See the [ChatMessages documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-messages) for more information.
155
+ */
145
156
  export var ChatMessages = /*#__PURE__*/forwardRef(ChatMessagesBase);
@@ -13,6 +13,14 @@ export declare const chatMessagesStyles: import("tailwind-variants").TVReturnTyp
13
13
  content: string;
14
14
  scrollToBottom: string;
15
15
  }, undefined, {
16
+ responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
17
+ isAtBottom?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
18
+ } | undefined;
19
+ } & import("tailwind-variants/dist/config").TWMConfig & {
20
+ twMergeConfig: {
21
+ prefix: string;
22
+ };
23
+ }, {
16
24
  isAtBottom: {
17
25
  true: {
18
26
  scrollToBottom: string;
@@ -40,4 +48,22 @@ export declare const chatMessagesStyles: import("tailwind-variants").TVReturnTyp
40
48
  scroll: string;
41
49
  content: string;
42
50
  scrollToBottom: string;
43
- }, undefined, unknown, unknown, undefined>>;
51
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
52
+ isAtBottom: {
53
+ true: {
54
+ scrollToBottom: string;
55
+ };
56
+ false: {
57
+ scrollToBottom: string;
58
+ };
59
+ };
60
+ }, {
61
+ isAtBottom: {
62
+ true: {
63
+ scrollToBottom: string;
64
+ };
65
+ false: {
66
+ scrollToBottom: string;
67
+ };
68
+ };
69
+ }>, unknown, unknown, undefined>>;
@@ -1,7 +1,7 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
3
- import stl from "./../../../styles/helpers/satellitePrefixer";
4
- import { tv } from "./../../../styles/helpers/tv";
3
+ import stl from "./../../styles/helpers/satellitePrefixer";
4
+ import { tv } from "./../../styles/helpers/tv";
5
5
  export var chatMessagesStyles = tv({
6
6
  slots: {
7
7
  base: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["relative flex flex-col overflow-hidden h-full"]))),
@@ -1,8 +1,14 @@
1
1
  import type { RefObject } from "react";
2
- import type { ChatMessageBase } from "../../../Layout/Chat/types";
2
+ import type { ChatMessageBase } from "../../Chat/types";
3
3
  /**
4
4
  * React hook to compute the “fill” height below the last user message,
5
5
  * based on the scroll container’s height, the last user‐message element’s height,
6
6
  * and any CSS gap/padding offsets.
7
+ *
8
+ * @param scrollRef - The ref to the scroll container.
9
+ * @param lastUserMessageRef - The ref to the last user message.
10
+ * @param messages - The messages to display in the chat.
11
+ * @param lastMessageSubmitted - Whether the last message has been submitted.
12
+ * @param spacingOffset - The spacing offset.
7
13
  */
8
14
  export declare function useLastMessageHeight(scrollRef: RefObject<HTMLElement>, lastUserMessageRef: RefObject<HTMLDivElement | null>, messages: ChatMessageBase[], lastMessageSubmitted: boolean, spacingOffset?: number): number;
@@ -5,6 +5,12 @@ import { useLayoutEffect, useState } from "react";
5
5
  * React hook to compute the “fill” height below the last user message,
6
6
  * based on the scroll container’s height, the last user‐message element’s height,
7
7
  * and any CSS gap/padding offsets.
8
+ *
9
+ * @param scrollRef - The ref to the scroll container.
10
+ * @param lastUserMessageRef - The ref to the last user message.
11
+ * @param messages - The messages to display in the chat.
12
+ * @param lastMessageSubmitted - Whether the last message has been submitted.
13
+ * @param spacingOffset - The spacing offset.
8
14
  */
9
15
  export function useLastMessageHeight(scrollRef, lastUserMessageRef, messages, lastMessageSubmitted) {
10
16
  var spacingOffset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
@@ -1,11 +1,12 @@
1
1
  import type { FormEvent, KeyboardEvent, ReactNode } from "react";
2
- import type { TextAreaAutoSizeProps } from "../../../Fields/TextAreaAutoSize/TextAreaAutoSize";
3
- import type { ChatStatus } from "../../../Layout/Chat/types";
2
+ import type { ChatStatus } from "../../Chat/types";
3
+ import type { TextAreaAutoSizeProps } from "../../Fields/TextAreaAutoSize/TextAreaAutoSize";
4
4
  export declare type ChatPromptLocale = {
5
5
  textareaLabel?: string;
6
6
  emptyMessageTooltip?: string;
7
7
  stopResponseTooltip?: string;
8
8
  sendMessageTooltip?: string;
9
+ disabledTooltip?: string;
9
10
  };
10
11
  export declare type ChatPromptProps = Omit<TextAreaAutoSizeProps, "onSubmit"> & {
11
12
  /**
@@ -34,6 +35,10 @@ export declare type ChatPromptProps = Omit<TextAreaAutoSizeProps, "onSubmit"> &
34
35
  * Whether to automatically focus the textarea when the user starts typing.
35
36
  */
36
37
  autoFocusOnTyping?: boolean;
38
+ /**
39
+ * Whether to enable right-to-left (RTL) layout support.
40
+ */
41
+ rtl?: boolean;
37
42
  /**
38
43
  * Optional locale.
39
44
  */
@@ -48,6 +53,11 @@ export declare type ChatPromptProps = Omit<TextAreaAutoSizeProps, "onSubmit"> &
48
53
  */
49
54
  onStop?: () => void;
50
55
  };
56
+ /**
57
+ * The `ChatPrompt` component provides a textarea for users to type messages and a button to submit them.
58
+ *
59
+ * See the [ChatPrompt documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-prompt) for more information.
60
+ */
51
61
  export declare const ChatPrompt: import("react").ForwardRefExoticComponent<Omit<TextAreaAutoSizeProps, "onSubmit"> & {
52
62
  /**
53
63
  * Content to render above the textarea (e.g., a title or instructions).
@@ -75,6 +85,10 @@ export declare const ChatPrompt: import("react").ForwardRefExoticComponent<Omit<
75
85
  * Whether to automatically focus the textarea when the user starts typing.
76
86
  */
77
87
  autoFocusOnTyping?: boolean | undefined;
88
+ /**
89
+ * Whether to enable right-to-left (RTL) layout support.
90
+ */
91
+ rtl?: boolean | undefined;
78
92
  /**
79
93
  * Optional locale.
80
94
  */