@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.
- package/dist/cjs/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +23 -4
- package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
- package/dist/{esm/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → cjs/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +12 -12
- package/dist/{esm/Layout → cjs}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
- package/dist/cjs/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
- package/dist/{esm/Layout → cjs}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +2 -2
- package/dist/cjs/Chat/ChatMessages/ChatMessages.d.ts +141 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +18 -7
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.d.ts +7 -1
- package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +6 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.d.ts +16 -2
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +32 -20
- package/dist/cjs/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +10 -3
- package/dist/cjs/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useFocusTyping.js +19 -14
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
- package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
- package/dist/cjs/Fields/Checkbox/Checkbox.d.ts +2 -2
- package/dist/cjs/Fields/Checkbox/Checkbox.js +2 -2
- package/dist/cjs/Fields/Dropzone/Dropzone.js +1 -1
- package/dist/cjs/Fields/Form/stories/Complex.js +123 -50
- package/dist/cjs/Fields/RadioGroup/RadioButton.js +9 -2
- package/dist/cjs/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
- package/dist/cjs/Fields/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/cjs/Fields/SelectableCard/SelectableCard.d.ts +35 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCard.js +105 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardContext.js +15 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
- package/dist/cjs/Fields/SelectableCard/SelectableCardGroup.js +55 -0
- package/dist/cjs/Fields/SelectableCard/index.d.ts +2 -0
- package/dist/cjs/Fields/SelectableCard/index.js +27 -0
- package/dist/cjs/Fields/Switch/Switch.js +1 -1
- package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
- package/dist/cjs/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
- package/dist/cjs/Fields/index.d.ts +1 -0
- package/dist/cjs/Fields/index.js +11 -0
- package/dist/cjs/Helpers/utilities/focusable.tailwind.js +1 -1
- package/dist/cjs/Layout/index.d.ts +0 -1
- package/dist/cjs/Layout/index.js +0 -11
- package/dist/cjs/Satellite/locale.d.ts +3 -3
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/styles/helpers/tv.d.ts +5 -1
- package/dist/cjs/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/esm/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +23 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.js +9 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.d.ts +23 -4
- package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/ChatContextAccordion.styles.js +3 -3
- package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.d.ts +80 -3
- package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.js +14 -5
- package/dist/{cjs/Layout/Chat/ChatMessageError/ChatMessageError.styles.d.ts → esm/Chat/ChatMessage/ChatMessage.styles.d.ts} +34 -40
- package/dist/esm/{Layout/Chat → Chat}/ChatMessage/ChatMessage.styles.js +12 -12
- package/dist/{cjs/Layout → esm}/Chat/ChatMessageError/ChatMessageError.d.ts +7 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.js +8 -3
- package/dist/esm/Chat/ChatMessageError/ChatMessageError.styles.d.ts +253 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/ChatMessageError.styles.js +2 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.d.ts +6 -3
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.js +9 -4
- package/dist/{cjs/Layout → esm}/Chat/ChatMessageLoader/ChatMessageLoader.styles.d.ts +89 -9
- package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/ChatMessageLoader.styles.js +2 -2
- package/dist/esm/Chat/ChatMessages/ChatMessages.d.ts +141 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.js +18 -7
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.d.ts +27 -1
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/ChatMessages.styles.js +2 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.d.ts +7 -1
- package/dist/esm/{Layout/Chat → Chat}/ChatMessages/useLastMessageHeight.js +6 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.d.ts +16 -2
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.js +33 -20
- package/dist/esm/Chat/ChatPrompt/ChatPrompt.styles.d.ts +63 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/ChatPrompt.styles.js +10 -3
- package/dist/esm/Chat/ChatPrompt/useFocusTyping.d.ts +30 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useFocusTyping.js +19 -14
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.d.ts +9 -0
- package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/useTypewriter.js +9 -0
- package/dist/esm/Fields/Checkbox/Checkbox.d.ts +2 -2
- package/dist/esm/Fields/Checkbox/Checkbox.js +2 -2
- package/dist/esm/Fields/Dropzone/Dropzone.js +1 -1
- package/dist/esm/Fields/Form/stories/Complex.js +123 -50
- package/dist/esm/Fields/RadioGroup/RadioButton.js +10 -3
- package/dist/esm/Fields/RadioGroup/RadioButton.tailwind.js +1 -1
- package/dist/esm/Fields/RadioGroup/RadioGroupItem.js +1 -1
- package/dist/esm/Fields/SelectableCard/SelectableCard.d.ts +35 -0
- package/dist/esm/Fields/SelectableCard/SelectableCard.js +100 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardContext.d.ts +13 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardContext.js +9 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardGroup.d.ts +13 -0
- package/dist/esm/Fields/SelectableCard/SelectableCardGroup.js +48 -0
- package/dist/esm/Fields/SelectableCard/index.d.ts +2 -0
- package/dist/esm/Fields/SelectableCard/index.js +2 -0
- package/dist/esm/Fields/Switch/Switch.js +1 -1
- package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.d.ts +12 -4
- package/dist/esm/Fields/TextAreaAutoSize/TextAreaAutoSize.styles.d.ts +13 -1
- package/dist/esm/Fields/index.d.ts +1 -0
- package/dist/esm/Fields/index.js +1 -0
- package/dist/esm/Helpers/utilities/focusable.tailwind.js +1 -1
- package/dist/esm/Layout/index.d.ts +0 -1
- package/dist/esm/Layout/index.js +0 -1
- package/dist/esm/Satellite/locale.d.ts +3 -3
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/styles/helpers/tv.d.ts +5 -1
- package/dist/esm/utils/isCssPropertySupported.d.ts +1 -1
- package/dist/satellite.min.css +1 -1
- package/package.json +3 -3
- package/dist/cjs/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
- package/dist/cjs/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
- package/dist/cjs/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
- package/dist/cjs/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
- package/dist/cjs/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
- package/dist/esm/Layout/Chat/ChatContextAccordion/ChatContextAccordion.d.ts +0 -8
- package/dist/esm/Layout/Chat/ChatMessage/ChatMessage.styles.d.ts +0 -100
- package/dist/esm/Layout/Chat/ChatMessages/ChatMessages.d.ts +0 -44
- package/dist/esm/Layout/Chat/ChatPrompt/ChatPrompt.styles.d.ts +0 -61
- package/dist/esm/Layout/Chat/ChatPrompt/useFocusTyping.d.ts +0 -12
- /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/index.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/index.js +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/types.d.ts +0 -0
- /package/dist/cjs/{Layout/Chat → Chat}/types.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatContextAccordion/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessage/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageError/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessageLoader/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatMessages/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/ChatPrompt/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/index.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/index.js +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/types.d.ts +0 -0
- /package/dist/esm/{Layout/Chat → Chat}/types.js +0 -0
@@ -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 "
|
5
|
-
import type { UserAvatarProps } from "
|
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
|
-
|
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;
|
@@ -6,8 +6,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
6
6
|
import { memo } from "react";
|
7
7
|
import { forwardRef } from "react";
|
8
8
|
import { chatMessageStyles } from "./ChatMessage.styles";
|
9
|
-
import { IconButtonWithFeedback } from "
|
10
|
-
import { UserAvatar } from "
|
9
|
+
import { IconButtonWithFeedback } from "./../../Actions";
|
10
|
+
import { UserAvatar } from "./../../Indicators";
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
12
12
|
var ChatMessageBase = function ChatMessageBase(_ref, ref) {
|
13
13
|
var content = _ref.content,
|
@@ -44,10 +44,10 @@ var ChatMessageBase = function ChatMessageBase(_ref, ref) {
|
|
44
44
|
className: styles.container(),
|
45
45
|
children: [(!!avatar || !!renderLeading) && /*#__PURE__*/_jsx("div", {
|
46
46
|
className: styles.leading(),
|
47
|
-
children: avatar
|
47
|
+
children: renderLeading || avatar && /*#__PURE__*/_jsx(UserAvatar, {
|
48
48
|
user: avatar,
|
49
49
|
size: avatarSize
|
50
|
-
})
|
50
|
+
})
|
51
51
|
}), /*#__PURE__*/_jsxs("div", {
|
52
52
|
className: styles.content(),
|
53
53
|
children: [/*#__PURE__*/_jsx("div", {
|
@@ -69,9 +69,18 @@ var ChatMessageBase = function ChatMessageBase(_ref, ref) {
|
|
69
69
|
tooltipHideDelay: 0
|
70
70
|
}), index);
|
71
71
|
}))
|
72
|
-
}), renderFooter
|
72
|
+
}), !!renderFooter && /*#__PURE__*/_jsx("div", {
|
73
|
+
className: styles.footer(),
|
74
|
+
children: renderFooter
|
75
|
+
})]
|
73
76
|
})]
|
74
77
|
})
|
75
78
|
}));
|
76
79
|
};
|
80
|
+
|
81
|
+
/**
|
82
|
+
* The `ChatMessage` component provides a message to display in the chat.
|
83
|
+
*
|
84
|
+
* See the [ChatMessage documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message) for more information.
|
85
|
+
*/
|
77
86
|
export var ChatMessage = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(ChatMessageBase));
|
@@ -1,44 +1,50 @@
|
|
1
|
-
export declare const
|
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:
|
10
|
-
|
3
|
+
neutral: {
|
4
|
+
message: string;
|
11
5
|
};
|
12
|
-
subtle:
|
13
|
-
|
6
|
+
subtle: {
|
7
|
+
message: string;
|
14
8
|
};
|
15
9
|
};
|
16
10
|
side: {
|
17
|
-
left:
|
18
|
-
|
11
|
+
left: {
|
12
|
+
container: string;
|
19
13
|
};
|
20
|
-
right:
|
21
|
-
|
14
|
+
right: {
|
15
|
+
container: string;
|
22
16
|
};
|
23
17
|
};
|
24
18
|
leading: {
|
25
|
-
true:
|
26
|
-
content?: import("tailwind-merge").ClassNameValue;
|
27
|
-
};
|
19
|
+
true: string;
|
28
20
|
};
|
29
21
|
actions: {
|
30
|
-
true:
|
31
|
-
content?: import("tailwind-merge").ClassNameValue;
|
32
|
-
};
|
22
|
+
true: string;
|
33
23
|
};
|
34
24
|
autoHideActions: {
|
35
|
-
true:
|
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
|
-
|
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>>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
3
|
-
import stl from "
|
4
|
-
import { tv } from "
|
3
|
+
import stl from "./../../styles/helpers/satellitePrefixer";
|
4
|
+
import { tv } from "./../../styles/helpers/tv";
|
5
5
|
export var chatMessageStyles = tv({
|
6
6
|
slots: {
|
7
7
|
base: stl(_templateObject || (_templateObject = _taggedTemplateLiteral(["relative w-full scroll-mt-4 group/message"]))),
|
@@ -9,40 +9,40 @@ export var chatMessageStyles = tv({
|
|
9
9
|
leading: stl(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["inline-flex items-center justify-center"]))),
|
10
10
|
content: stl(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["flex flex-col gap-3 group-data-[role=assistant]/message:grow overflow-y-hidden overflow-x-auto"]))),
|
11
11
|
message: stl(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["relative text-pretty typo-display-body"]))),
|
12
|
-
actions: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["flex items-center gap-1"])))
|
12
|
+
actions: stl(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["flex items-center gap-1"]))),
|
13
|
+
footer: stl(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral([""])))
|
13
14
|
},
|
14
15
|
variants: {
|
15
16
|
variant: {
|
16
17
|
neutral: {
|
17
|
-
message: stl(
|
18
|
+
message: stl(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["bg-grey-100"])))
|
18
19
|
},
|
19
20
|
subtle: {
|
20
|
-
message: stl(
|
21
|
+
message: stl(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral([""])))
|
21
22
|
}
|
22
23
|
},
|
23
24
|
side: {
|
24
25
|
left: {
|
25
|
-
container: stl(
|
26
|
+
container: stl(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["justify-start"])))
|
26
27
|
},
|
27
28
|
right: {
|
28
|
-
container: stl(
|
29
|
+
container: stl(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["justify-end ms-auto"])))
|
29
30
|
}
|
30
31
|
},
|
31
32
|
leading: {
|
32
|
-
"true": stl(
|
33
|
+
"true": stl(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral([""])))
|
33
34
|
},
|
34
35
|
actions: {
|
35
|
-
"true": stl(
|
36
|
+
"true": stl(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral([""])))
|
36
37
|
},
|
37
38
|
autoHideActions: {
|
38
|
-
"true": stl(
|
39
|
+
"true": stl(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral([""])))
|
39
40
|
}
|
40
41
|
},
|
41
42
|
compoundVariants: [{
|
42
43
|
variant: "neutral",
|
43
44
|
className: {
|
44
|
-
message: stl(
|
45
|
-
leading: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["mt-3"])))
|
45
|
+
message: stl(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["p-3 rounded-[8px]"])))
|
46
46
|
}
|
47
47
|
}, {
|
48
48
|
leading: true,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from "react";
|
2
|
-
import type { ButtonProps } from "
|
3
|
-
import type { ChatMessageProps } from "
|
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.
|
@@ -5,14 +5,19 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
5
5
|
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; }
|
6
6
|
import { forwardRef } from "react";
|
7
7
|
import { chatMessageErrorStyles } from "./ChatMessageError.styles";
|
8
|
-
import { Button } from "
|
9
|
-
import { RotateCwIcon } from "
|
10
|
-
import { useLocale } from "
|
8
|
+
import { Button } from "./../../Actions";
|
9
|
+
import { RotateCwIcon } from "./../../Icons";
|
10
|
+
import { useLocale } from "./../../Satellite";
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
12
12
|
var DEFAULT_CHAT_MESSAGE_ERROR_LOCALE = {
|
13
13
|
error: "Sorry, we are not able to generate a response at the moment. Please retry or contact support.",
|
14
14
|
retry: "Retry"
|
15
15
|
};
|
16
|
+
/**
|
17
|
+
* The `ChatMessageError` component provides a message to display when an error occurs.
|
18
|
+
*
|
19
|
+
* See the [ChatMessageError documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message-error) for more information.
|
20
|
+
*/
|
16
21
|
export var ChatMessageError = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
17
22
|
var renderError = _ref.renderError,
|
18
23
|
actions = _ref.actions,
|
@@ -0,0 +1,253 @@
|
|
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
|
+
} | {
|
8
|
+
variant: {
|
9
|
+
neutral: import("tailwind-merge").ClassNameValue | {
|
10
|
+
content?: import("tailwind-merge").ClassNameValue;
|
11
|
+
};
|
12
|
+
subtle: import("tailwind-merge").ClassNameValue | {
|
13
|
+
content?: import("tailwind-merge").ClassNameValue;
|
14
|
+
};
|
15
|
+
};
|
16
|
+
side: {
|
17
|
+
left: import("tailwind-merge").ClassNameValue | {
|
18
|
+
content?: import("tailwind-merge").ClassNameValue;
|
19
|
+
};
|
20
|
+
right: import("tailwind-merge").ClassNameValue | {
|
21
|
+
content?: import("tailwind-merge").ClassNameValue;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
leading: {
|
25
|
+
true: import("tailwind-merge").ClassNameValue | {
|
26
|
+
content?: import("tailwind-merge").ClassNameValue;
|
27
|
+
};
|
28
|
+
};
|
29
|
+
actions: {
|
30
|
+
true: import("tailwind-merge").ClassNameValue | {
|
31
|
+
content?: import("tailwind-merge").ClassNameValue;
|
32
|
+
};
|
33
|
+
};
|
34
|
+
autoHideActions: {
|
35
|
+
true: import("tailwind-merge").ClassNameValue | {
|
36
|
+
content?: import("tailwind-merge").ClassNameValue;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
}, {
|
40
|
+
content: string;
|
41
|
+
}, undefined, {
|
42
|
+
responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
|
43
|
+
variant?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
44
|
+
leading?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
45
|
+
side?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
46
|
+
actions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
47
|
+
autoHideActions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
48
|
+
} | undefined;
|
49
|
+
} & import("tailwind-variants/dist/config").TWMConfig & {
|
50
|
+
twMergeConfig: {
|
51
|
+
prefix: string;
|
52
|
+
};
|
53
|
+
}, {
|
54
|
+
variant: {
|
55
|
+
neutral: {
|
56
|
+
message: string;
|
57
|
+
};
|
58
|
+
subtle: {
|
59
|
+
message: string;
|
60
|
+
};
|
61
|
+
};
|
62
|
+
side: {
|
63
|
+
left: {
|
64
|
+
container: string;
|
65
|
+
};
|
66
|
+
right: {
|
67
|
+
container: string;
|
68
|
+
};
|
69
|
+
};
|
70
|
+
leading: {
|
71
|
+
true: string;
|
72
|
+
};
|
73
|
+
actions: {
|
74
|
+
true: string;
|
75
|
+
};
|
76
|
+
autoHideActions: {
|
77
|
+
true: string;
|
78
|
+
};
|
79
|
+
}, {
|
80
|
+
base: string;
|
81
|
+
container: string;
|
82
|
+
leading: string;
|
83
|
+
content: string;
|
84
|
+
message: string;
|
85
|
+
actions: string;
|
86
|
+
footer: string;
|
87
|
+
}, import("tailwind-variants").TVReturnType<{
|
88
|
+
variant: {
|
89
|
+
neutral: {
|
90
|
+
message: string;
|
91
|
+
};
|
92
|
+
subtle: {
|
93
|
+
message: string;
|
94
|
+
};
|
95
|
+
};
|
96
|
+
side: {
|
97
|
+
left: {
|
98
|
+
container: string;
|
99
|
+
};
|
100
|
+
right: {
|
101
|
+
container: string;
|
102
|
+
};
|
103
|
+
};
|
104
|
+
leading: {
|
105
|
+
true: string;
|
106
|
+
};
|
107
|
+
actions: {
|
108
|
+
true: string;
|
109
|
+
};
|
110
|
+
autoHideActions: {
|
111
|
+
true: string;
|
112
|
+
};
|
113
|
+
}, {
|
114
|
+
base: string;
|
115
|
+
container: string;
|
116
|
+
leading: string;
|
117
|
+
content: string;
|
118
|
+
message: string;
|
119
|
+
actions: string;
|
120
|
+
footer: string;
|
121
|
+
}, undefined, {
|
122
|
+
responsiveVariants?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | {
|
123
|
+
variant?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
124
|
+
leading?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
125
|
+
side?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
126
|
+
actions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
127
|
+
autoHideActions?: boolean | ("sm" | "md" | "lg" | "xl" | "2xl")[] | undefined;
|
128
|
+
} | undefined;
|
129
|
+
} & import("tailwind-variants/dist/config").TWMConfig & {
|
130
|
+
twMergeConfig: {
|
131
|
+
prefix: string;
|
132
|
+
};
|
133
|
+
}, {
|
134
|
+
variant: {
|
135
|
+
neutral: {
|
136
|
+
message: string;
|
137
|
+
};
|
138
|
+
subtle: {
|
139
|
+
message: string;
|
140
|
+
};
|
141
|
+
};
|
142
|
+
side: {
|
143
|
+
left: {
|
144
|
+
container: string;
|
145
|
+
};
|
146
|
+
right: {
|
147
|
+
container: string;
|
148
|
+
};
|
149
|
+
};
|
150
|
+
leading: {
|
151
|
+
true: string;
|
152
|
+
};
|
153
|
+
actions: {
|
154
|
+
true: string;
|
155
|
+
};
|
156
|
+
autoHideActions: {
|
157
|
+
true: string;
|
158
|
+
};
|
159
|
+
}, {
|
160
|
+
base: string;
|
161
|
+
container: string;
|
162
|
+
leading: string;
|
163
|
+
content: string;
|
164
|
+
message: string;
|
165
|
+
actions: string;
|
166
|
+
footer: string;
|
167
|
+
}, import("tailwind-variants").TVReturnType<{
|
168
|
+
variant: {
|
169
|
+
neutral: {
|
170
|
+
message: string;
|
171
|
+
};
|
172
|
+
subtle: {
|
173
|
+
message: string;
|
174
|
+
};
|
175
|
+
};
|
176
|
+
side: {
|
177
|
+
left: {
|
178
|
+
container: string;
|
179
|
+
};
|
180
|
+
right: {
|
181
|
+
container: string;
|
182
|
+
};
|
183
|
+
};
|
184
|
+
leading: {
|
185
|
+
true: string;
|
186
|
+
};
|
187
|
+
actions: {
|
188
|
+
true: string;
|
189
|
+
};
|
190
|
+
autoHideActions: {
|
191
|
+
true: string;
|
192
|
+
};
|
193
|
+
}, {
|
194
|
+
base: string;
|
195
|
+
container: string;
|
196
|
+
leading: string;
|
197
|
+
content: string;
|
198
|
+
message: string;
|
199
|
+
actions: string;
|
200
|
+
footer: string;
|
201
|
+
}, undefined, import("tailwind-variants/dist/config").TVConfig<{
|
202
|
+
variant: {
|
203
|
+
neutral: {
|
204
|
+
message: string;
|
205
|
+
};
|
206
|
+
subtle: {
|
207
|
+
message: string;
|
208
|
+
};
|
209
|
+
};
|
210
|
+
side: {
|
211
|
+
left: {
|
212
|
+
container: string;
|
213
|
+
};
|
214
|
+
right: {
|
215
|
+
container: string;
|
216
|
+
};
|
217
|
+
};
|
218
|
+
leading: {
|
219
|
+
true: string;
|
220
|
+
};
|
221
|
+
actions: {
|
222
|
+
true: string;
|
223
|
+
};
|
224
|
+
autoHideActions: {
|
225
|
+
true: string;
|
226
|
+
};
|
227
|
+
}, {
|
228
|
+
variant: {
|
229
|
+
neutral: {
|
230
|
+
message: string;
|
231
|
+
};
|
232
|
+
subtle: {
|
233
|
+
message: string;
|
234
|
+
};
|
235
|
+
};
|
236
|
+
side: {
|
237
|
+
left: {
|
238
|
+
container: string;
|
239
|
+
};
|
240
|
+
right: {
|
241
|
+
container: string;
|
242
|
+
};
|
243
|
+
};
|
244
|
+
leading: {
|
245
|
+
true: string;
|
246
|
+
};
|
247
|
+
actions: {
|
248
|
+
true: string;
|
249
|
+
};
|
250
|
+
autoHideActions: {
|
251
|
+
true: string;
|
252
|
+
};
|
253
|
+
}>, unknown, unknown, undefined>>>;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
2
2
|
var _templateObject;
|
3
3
|
import { chatMessageStyles } from "./../ChatMessage/ChatMessage.styles";
|
4
|
-
import stl from "
|
5
|
-
import { tv } from "
|
4
|
+
import stl from "./../../styles/helpers/satellitePrefixer";
|
5
|
+
import { tv } from "./../../styles/helpers/tv";
|
6
6
|
export var chatMessageErrorStyles = tv({
|
7
7
|
extend: chatMessageStyles,
|
8
8
|
slots: {
|
@@ -1,18 +1,21 @@
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from "react";
|
2
|
-
import type { ChatMessageProps } from "
|
2
|
+
import type { ChatMessageProps } from "../../Chat/ChatMessage";
|
3
3
|
export declare type ChatMessageLoaderProps = Omit<HTMLAttributes<HTMLElement>, "children"> & Pick<ChatMessageProps, "rtl"> & {
|
4
4
|
/**
|
5
5
|
* Message to display in the loader.
|
6
6
|
* If not provided, no message will be shown.
|
7
|
-
* @default undefined
|
8
7
|
*/
|
9
8
|
message?: ReactNode;
|
10
9
|
};
|
10
|
+
/**
|
11
|
+
* The `ChatMessageLoader` component provides a message to display when a response is being generated.
|
12
|
+
*
|
13
|
+
* See the [ChatMessageLoader documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-message-loader) for more information.
|
14
|
+
*/
|
11
15
|
export declare const ChatMessageLoader: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children"> & Pick<ChatMessageProps<Record<string, any>>, "rtl"> & {
|
12
16
|
/**
|
13
17
|
* Message to display in the loader.
|
14
18
|
* If not provided, no message will be shown.
|
15
|
-
* @default undefined
|
16
19
|
*/
|
17
20
|
message?: ReactNode;
|
18
21
|
} & import("react").RefAttributes<HTMLElement>>;
|