@landtrustinc/design-system 1.2.27-beta.5 → 1.2.27-beta.7
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/index.d.ts +2 -9
- package/dist/index.js +200 -228
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1341,14 +1341,7 @@ type ChatWidgetProps = {
|
|
|
1341
1341
|
*/
|
|
1342
1342
|
closeOnClickOutside?: boolean;
|
|
1343
1343
|
};
|
|
1344
|
-
|
|
1345
|
-
/**
|
|
1346
|
-
* Scroll to a specific message by index, positioning it at the top of the scroll container
|
|
1347
|
-
* @param index - The index of the message in the messages array
|
|
1348
|
-
*/
|
|
1349
|
-
scrollToMessageIndex: (index: number) => void;
|
|
1350
|
-
};
|
|
1351
|
-
declare const ChatWidget: React__default.ForwardRefExoticComponent<ChatWidgetProps & React__default.RefAttributes<ChatWidgetRef>>;
|
|
1344
|
+
declare const ChatWidget: ({ title, messages, onSubmit, placeholder, disabled, className, ariaLabel, panelWidth, expanded, defaultExpanded, onExpandedChange, isThinking, thinkingText, emptyState, containerProps, suggestedPrompts, onPromptClick, suggestedPromptsTitle, notificationCount, closeOnClickOutside, }: ChatWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1352
1345
|
|
|
1353
1346
|
type DividerProps = React__default.HTMLAttributes<HTMLHRElement> & SpaceProps & {
|
|
1354
1347
|
/**
|
|
@@ -2445,4 +2438,4 @@ declare const Widget: React__default.FC<WidgetProps> & {
|
|
|
2445
2438
|
}>;
|
|
2446
2439
|
};
|
|
2447
2440
|
|
|
2448
|
-
export { AIResponse, type AIResponseProps, AvailabilityBadge, type AvailabilityBadgeProps, type AvailabilityBadgeVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarType, type BaseInputProps, Box, type BoxProps, Button, type ButtonProps, type ButtonVariants, type CarouselPositions, ChatWidget, type ChatWidgetMessage, type ChatWidgetProps,
|
|
2441
|
+
export { AIResponse, type AIResponseProps, AvailabilityBadge, type AvailabilityBadgeProps, type AvailabilityBadgeVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarType, type BaseInputProps, Box, type BoxProps, Button, type ButtonProps, type ButtonVariants, type CarouselPositions, ChatWidget, type ChatWidgetMessage, type ChatWidgetProps, Column, type ColumnProps, ContactLandownerButton, type ContactLandownerButtonProps, Container, Divider, type DividerProps, type DotsColors, type FeatureItem, FeatureList, FeatureListItem, type FeatureListItemProps, type FeatureListProps, type FeatureListSection, FieldNoteCard, type FieldNoteCardProps, FormField, type FormFieldProps, GlobalStyle, Grid, type GridBreakpoint, GridContainer, type GridContainerProps, type GridProps, Heading, type HeadingProps, HuntCard, type HuntCardProps, Icon, IconLabel, type IconLabelProps, type IconProps, type IconSize, IconSizeMap, type IconVariantTypes$1 as IconVariantTypes, InfoBox, type InfoBoxProps, Input, type InputProps, type InputSize, type InputVariant, LandownerProfile, type LandownerProfileProps, LayoutTokens, ListingChat, type ListingChatProps, Logo, type LogoProps, type LogoTheme, type LogoVariant, MarkdownContent, type MarkdownContentProps, MessageBubble, type MessageBubbleProps, type NavLink, Navigation, type NavigationProps, PackageCard, type PackageCardBadge, type PackageCardProps, PackageHeader, type PackageHeaderProps, type ResponsiveValue, ReviewCard, type ReviewCardProps, Reviews, type ReviewsProps, ReviewsShowcase, ScrollingCarousel, type ScrollingCarouselProps, ScrollingCarouselStep, type ScrollingCarouselStepProps, Select, type SelectOption, type SelectProps, Spinner, type SpinnerProps, StarRating, type StarRatingProps, type SuggestedPrompt, type TFontWeight, type THeadingSize, type TTextAlign, type TTextSize, type TTextWrap, TagChip, type TagChipProps, type TagChipVariant, Text, TextArea, type TextProps, type TextareaProps, ThemeTokens, TopMatchingFieldNote, type TopMatchingFieldNoteProps, TopMatchingReview, type TopMatchingReviewProps, UserCard, type UserCardProps, Widget, WidgetPanel, type WidgetPanelProps, type WidgetProps, WidgetTrigger, type WidgetTriggerProps, globalStyles, styles };
|
package/dist/index.js
CHANGED
|
@@ -5911,246 +5911,218 @@ var DEFAULT_EMPTY_STATE = [
|
|
|
5911
5911
|
"default-empty"
|
|
5912
5912
|
)
|
|
5913
5913
|
];
|
|
5914
|
-
var ChatWidget =
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
(next)
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
}),
|
|
5972
|
-
[isExpanded]
|
|
5973
|
-
);
|
|
5974
|
-
(0, import_react30.useEffect)(() => {
|
|
5975
|
-
const el = scrollRef.current;
|
|
5976
|
-
if (!el || !isExpanded)
|
|
5977
|
-
return;
|
|
5914
|
+
var ChatWidget = ({
|
|
5915
|
+
title,
|
|
5916
|
+
messages,
|
|
5917
|
+
onSubmit,
|
|
5918
|
+
placeholder = "Type your question",
|
|
5919
|
+
disabled = false,
|
|
5920
|
+
className,
|
|
5921
|
+
ariaLabel = "Open Chat",
|
|
5922
|
+
panelWidth = 480,
|
|
5923
|
+
expanded,
|
|
5924
|
+
defaultExpanded = false,
|
|
5925
|
+
onExpandedChange,
|
|
5926
|
+
isThinking = false,
|
|
5927
|
+
thinkingText = "Thinking...",
|
|
5928
|
+
emptyState = DEFAULT_EMPTY_STATE,
|
|
5929
|
+
containerProps,
|
|
5930
|
+
suggestedPrompts,
|
|
5931
|
+
onPromptClick,
|
|
5932
|
+
suggestedPromptsTitle = "Other Helpful Topics",
|
|
5933
|
+
notificationCount,
|
|
5934
|
+
closeOnClickOutside = true
|
|
5935
|
+
}) => {
|
|
5936
|
+
const [value, setValue] = (0, import_react30.useState)("");
|
|
5937
|
+
const scrollRef = (0, import_react30.useRef)(null);
|
|
5938
|
+
const savedScrollPosition = (0, import_react30.useRef)(0);
|
|
5939
|
+
const previousMessagesLength = (0, import_react30.useRef)(messages.length);
|
|
5940
|
+
const isControlled = typeof expanded === "boolean";
|
|
5941
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react30.useState)(defaultExpanded);
|
|
5942
|
+
const isExpanded = isControlled ? expanded : internalExpanded;
|
|
5943
|
+
const setExpanded = (0, import_react30.useCallback)(
|
|
5944
|
+
(next) => {
|
|
5945
|
+
if (!next && scrollRef.current) {
|
|
5946
|
+
savedScrollPosition.current = scrollRef.current.scrollTop;
|
|
5947
|
+
}
|
|
5948
|
+
if (!isControlled)
|
|
5949
|
+
setInternalExpanded(next);
|
|
5950
|
+
onExpandedChange == null ? void 0 : onExpandedChange(next);
|
|
5951
|
+
},
|
|
5952
|
+
[isControlled, onExpandedChange]
|
|
5953
|
+
);
|
|
5954
|
+
(0, import_react30.useEffect)(() => {
|
|
5955
|
+
const el = scrollRef.current;
|
|
5956
|
+
if (!el || !isExpanded)
|
|
5957
|
+
return;
|
|
5958
|
+
requestAnimationFrame(() => {
|
|
5959
|
+
if (savedScrollPosition.current > 0) {
|
|
5960
|
+
el.scrollTop = savedScrollPosition.current;
|
|
5961
|
+
}
|
|
5962
|
+
});
|
|
5963
|
+
}, [isExpanded]);
|
|
5964
|
+
(0, import_react30.useEffect)(() => {
|
|
5965
|
+
const el = scrollRef.current;
|
|
5966
|
+
if (!el || !isExpanded)
|
|
5967
|
+
return;
|
|
5968
|
+
const messagesChanged = messages.length !== previousMessagesLength.current;
|
|
5969
|
+
previousMessagesLength.current = messages.length;
|
|
5970
|
+
if (messagesChanged || isThinking) {
|
|
5978
5971
|
requestAnimationFrame(() => {
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
}
|
|
5972
|
+
el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
|
|
5973
|
+
savedScrollPosition.current = el.scrollHeight;
|
|
5982
5974
|
});
|
|
5983
|
-
}
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
(
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
onSubmit(trimmed);
|
|
6023
|
-
setValue("");
|
|
6024
|
-
};
|
|
6025
|
-
return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
6026
|
-
Widget_default,
|
|
6027
|
-
{
|
|
6028
|
-
ariaLabel,
|
|
6029
|
-
icon: "ConversationalSearchAi",
|
|
6030
|
-
expanded: isExpanded,
|
|
6031
|
-
onExpandedChange: setExpanded,
|
|
6032
|
-
panelWidth,
|
|
6033
|
-
className,
|
|
6034
|
-
containerProps,
|
|
6035
|
-
closeOnClickOutside,
|
|
6036
|
-
children: [
|
|
6037
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(AskBuckButton_default, { badgeCount: notificationCount }) }),
|
|
6038
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Widget_default.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { css: containerStyles, children: [
|
|
6039
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { position: "sticky", top: 0, zIndex: 1, children: [
|
|
6040
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
6041
|
-
Box_default,
|
|
6042
|
-
{
|
|
6043
|
-
display: "flex",
|
|
6044
|
-
alignItems: "center",
|
|
6045
|
-
justifyContent: "space-between",
|
|
6046
|
-
gap: "var(--spacing-4)",
|
|
6047
|
-
children: [
|
|
6048
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: [
|
|
6049
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: badge, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "ConversationalSearchAi", size: "large" }) }),
|
|
6050
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6051
|
-
Heading_default,
|
|
6052
|
-
{
|
|
6053
|
-
size: "2xs",
|
|
6054
|
-
fontWeight: "bold",
|
|
6055
|
-
color: "var(--text-primary)",
|
|
6056
|
-
children: title
|
|
6057
|
-
}
|
|
6058
|
-
)
|
|
6059
|
-
] }),
|
|
6060
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6061
|
-
Button_default,
|
|
6062
|
-
{
|
|
6063
|
-
variant: "text",
|
|
6064
|
-
size: "xs",
|
|
6065
|
-
"aria-label": "Close widget",
|
|
6066
|
-
onClick: () => setExpanded(false),
|
|
6067
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("span", { css: closeButtonContent, children: [
|
|
6068
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "Xmark", size: "medium" }),
|
|
6069
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { children: "Close" })
|
|
6070
|
-
] })
|
|
6071
|
-
}
|
|
6072
|
-
)
|
|
6073
|
-
]
|
|
6074
|
-
}
|
|
6075
|
-
),
|
|
6076
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Divider_default, { mt: 4, mb: 0 })
|
|
6077
|
-
] }),
|
|
5975
|
+
}
|
|
5976
|
+
}, [messages, isThinking, isExpanded]);
|
|
5977
|
+
const messagesToRender = messages.length === 0 ? emptyState : messages;
|
|
5978
|
+
const renderedMessages = (0, import_react30.useMemo)(
|
|
5979
|
+
() => messagesToRender.map((element, index) => {
|
|
5980
|
+
var _a;
|
|
5981
|
+
const key = (_a = element.key) != null ? _a : index;
|
|
5982
|
+
if (element.type === AIResponse_default) {
|
|
5983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: element }, key);
|
|
5984
|
+
}
|
|
5985
|
+
if (element.type === MessageBubble_default) {
|
|
5986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: sentWrapperStyles, children: element }, key);
|
|
5987
|
+
}
|
|
5988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(import_react30.default.Fragment, { children: element }, key);
|
|
5989
|
+
}),
|
|
5990
|
+
[messagesToRender]
|
|
5991
|
+
);
|
|
5992
|
+
const handleSubmit = () => {
|
|
5993
|
+
const trimmed = value.trim();
|
|
5994
|
+
if (!trimmed)
|
|
5995
|
+
return;
|
|
5996
|
+
onSubmit(trimmed);
|
|
5997
|
+
setValue("");
|
|
5998
|
+
};
|
|
5999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
6000
|
+
Widget_default,
|
|
6001
|
+
{
|
|
6002
|
+
ariaLabel,
|
|
6003
|
+
icon: "ConversationalSearchAi",
|
|
6004
|
+
expanded: isExpanded,
|
|
6005
|
+
onExpandedChange: setExpanded,
|
|
6006
|
+
panelWidth,
|
|
6007
|
+
className,
|
|
6008
|
+
containerProps,
|
|
6009
|
+
closeOnClickOutside,
|
|
6010
|
+
children: [
|
|
6011
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(AskBuckButton_default, { badgeCount: notificationCount }) }),
|
|
6012
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Widget_default.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { css: containerStyles, children: [
|
|
6013
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { position: "sticky", top: 0, zIndex: 1, children: [
|
|
6078
6014
|
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
6079
6015
|
Box_default,
|
|
6080
6016
|
{
|
|
6081
|
-
ref: scrollRef,
|
|
6082
|
-
flex: "1 1 auto",
|
|
6083
|
-
minHeight: 0,
|
|
6084
|
-
overflowY: "auto",
|
|
6085
|
-
p: 0,
|
|
6086
|
-
pb: 4,
|
|
6087
6017
|
display: "flex",
|
|
6088
|
-
|
|
6089
|
-
|
|
6018
|
+
alignItems: "center",
|
|
6019
|
+
justifyContent: "space-between",
|
|
6020
|
+
gap: "var(--spacing-4)",
|
|
6090
6021
|
children: [
|
|
6091
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.
|
|
6092
|
-
|
|
6093
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: [
|
|
6023
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: badge, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "ConversationalSearchAi", size: "large" }) }),
|
|
6024
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6025
|
+
Heading_default,
|
|
6026
|
+
{
|
|
6027
|
+
size: "2xs",
|
|
6028
|
+
fontWeight: "bold",
|
|
6029
|
+
color: "var(--text-primary)",
|
|
6030
|
+
children: title
|
|
6031
|
+
}
|
|
6032
|
+
)
|
|
6033
|
+
] }),
|
|
6034
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6035
|
+
Button_default,
|
|
6098
6036
|
{
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
display: "flex",
|
|
6108
|
-
flexWrap: "wrap",
|
|
6109
|
-
gap: "var(--spacing-4)",
|
|
6110
|
-
alignItems: "flex-start",
|
|
6111
|
-
children: suggestedPrompts.map((prompt, index) => /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6112
|
-
TagChip_default,
|
|
6113
|
-
{
|
|
6114
|
-
variant: "success",
|
|
6115
|
-
onClick: () => {
|
|
6116
|
-
var _a;
|
|
6117
|
-
return onPromptClick == null ? void 0 : onPromptClick((_a = prompt.value) != null ? _a : prompt.label);
|
|
6118
|
-
},
|
|
6119
|
-
style: { cursor: "pointer" },
|
|
6120
|
-
children: prompt.label
|
|
6121
|
-
},
|
|
6122
|
-
index
|
|
6123
|
-
))
|
|
6124
|
-
}
|
|
6125
|
-
)
|
|
6126
|
-
]
|
|
6037
|
+
variant: "text",
|
|
6038
|
+
size: "xs",
|
|
6039
|
+
"aria-label": "Close widget",
|
|
6040
|
+
onClick: () => setExpanded(false),
|
|
6041
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("span", { css: closeButtonContent, children: [
|
|
6042
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "Xmark", size: "medium" }),
|
|
6043
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { children: "Close" })
|
|
6044
|
+
] })
|
|
6127
6045
|
}
|
|
6128
|
-
)
|
|
6046
|
+
)
|
|
6129
6047
|
]
|
|
6130
6048
|
}
|
|
6131
6049
|
),
|
|
6132
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
)
|
|
6153
|
-
|
|
6050
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Divider_default, { mt: 4, mb: 0 })
|
|
6051
|
+
] }),
|
|
6052
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
6053
|
+
Box_default,
|
|
6054
|
+
{
|
|
6055
|
+
ref: scrollRef,
|
|
6056
|
+
flex: "1 1 auto",
|
|
6057
|
+
minHeight: 0,
|
|
6058
|
+
overflowY: "auto",
|
|
6059
|
+
p: 0,
|
|
6060
|
+
pb: 4,
|
|
6061
|
+
display: "flex",
|
|
6062
|
+
flexDirection: "column",
|
|
6063
|
+
gap: "var(--spacing-2)",
|
|
6064
|
+
children: [
|
|
6065
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { display: "flex", flexDirection: "column", gap: "var(--spacing-2)", children: renderedMessages }),
|
|
6066
|
+
isThinking && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: thinkingRowStyles, children: [
|
|
6067
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Spinner_default2, { size: "medium" }),
|
|
6068
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: thinkingTextStyles, children: thinkingText })
|
|
6069
|
+
] }) }),
|
|
6070
|
+
suggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
|
|
6071
|
+
Box_default,
|
|
6072
|
+
{
|
|
6073
|
+
display: "flex",
|
|
6074
|
+
flexDirection: "column",
|
|
6075
|
+
gap: "var(--spacing-4)",
|
|
6076
|
+
children: [
|
|
6077
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Text_default, { size: "md", fontWeight: "bold", color: "var(--text-primary)", children: suggestedPromptsTitle }),
|
|
6078
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6079
|
+
Box_default,
|
|
6080
|
+
{
|
|
6081
|
+
display: "flex",
|
|
6082
|
+
flexWrap: "wrap",
|
|
6083
|
+
gap: "var(--spacing-4)",
|
|
6084
|
+
alignItems: "flex-start",
|
|
6085
|
+
children: suggestedPrompts.map((prompt, index) => /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6086
|
+
TagChip_default,
|
|
6087
|
+
{
|
|
6088
|
+
variant: "success",
|
|
6089
|
+
onClick: () => {
|
|
6090
|
+
var _a;
|
|
6091
|
+
return onPromptClick == null ? void 0 : onPromptClick((_a = prompt.value) != null ? _a : prompt.label);
|
|
6092
|
+
},
|
|
6093
|
+
style: { cursor: "pointer" },
|
|
6094
|
+
children: prompt.label
|
|
6095
|
+
},
|
|
6096
|
+
index
|
|
6097
|
+
))
|
|
6098
|
+
}
|
|
6099
|
+
)
|
|
6100
|
+
]
|
|
6101
|
+
}
|
|
6102
|
+
) })
|
|
6103
|
+
]
|
|
6104
|
+
}
|
|
6105
|
+
),
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { position: "sticky", bottom: 0, zIndex: 1, p: 0, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6107
|
+
TextArea_default,
|
|
6108
|
+
{
|
|
6109
|
+
rows: 3,
|
|
6110
|
+
value,
|
|
6111
|
+
maxHeight: 250,
|
|
6112
|
+
autoExpand: true,
|
|
6113
|
+
onChange: (e) => setValue(e.target.value),
|
|
6114
|
+
showSubmit: true,
|
|
6115
|
+
onSubmit: handleSubmit,
|
|
6116
|
+
disabled,
|
|
6117
|
+
submitDisabled: !value.trim() || isThinking,
|
|
6118
|
+
placeholder
|
|
6119
|
+
}
|
|
6120
|
+
) })
|
|
6121
|
+
] }) })
|
|
6122
|
+
]
|
|
6123
|
+
}
|
|
6124
|
+
);
|
|
6125
|
+
};
|
|
6154
6126
|
var ChatWidget_default = ChatWidget;
|
|
6155
6127
|
|
|
6156
6128
|
// src/FeatureList/components/FeatureListItem.tsx
|