@landtrustinc/design-system 1.2.27-beta.5 → 1.2.27-beta.6

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 CHANGED
@@ -1341,14 +1341,7 @@ type ChatWidgetProps = {
1341
1341
  */
1342
1342
  closeOnClickOutside?: boolean;
1343
1343
  };
1344
- type ChatWidgetRef = {
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, type ChatWidgetRef, 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 };
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,248 @@ var DEFAULT_EMPTY_STATE = [
5911
5911
  "default-empty"
5912
5912
  )
5913
5913
  ];
5914
- var ChatWidget = import_react30.default.forwardRef(
5915
- ({
5916
- title,
5917
- messages,
5918
- onSubmit,
5919
- placeholder = "Type your question",
5920
- disabled = false,
5921
- className,
5922
- ariaLabel = "Open Chat",
5923
- panelWidth = 480,
5924
- expanded,
5925
- defaultExpanded = false,
5926
- onExpandedChange,
5927
- isThinking = false,
5928
- thinkingText = "Thinking...",
5929
- emptyState = DEFAULT_EMPTY_STATE,
5930
- containerProps,
5931
- suggestedPrompts,
5932
- onPromptClick,
5933
- suggestedPromptsTitle = "Other Helpful Topics",
5934
- notificationCount,
5935
- closeOnClickOutside = true
5936
- }, ref) => {
5937
- const [value, setValue] = (0, import_react30.useState)("");
5938
- const scrollRef = (0, import_react30.useRef)(null);
5939
- const savedScrollPosition = (0, import_react30.useRef)(0);
5940
- const messageRefs = (0, import_react30.useRef)([]);
5941
- const isControlled = typeof expanded === "boolean";
5942
- const [internalExpanded, setInternalExpanded] = (0, import_react30.useState)(defaultExpanded);
5943
- const isExpanded = isControlled ? expanded : internalExpanded;
5944
- const setExpanded = (0, import_react30.useCallback)(
5945
- (next) => {
5946
- if (!next && scrollRef.current) {
5947
- savedScrollPosition.current = scrollRef.current.scrollTop;
5948
- }
5949
- if (!isControlled)
5950
- setInternalExpanded(next);
5951
- onExpandedChange == null ? void 0 : onExpandedChange(next);
5952
- },
5953
- [isControlled, onExpandedChange]
5954
- );
5955
- (0, import_react30.useImperativeHandle)(
5956
- ref,
5957
- () => ({
5958
- scrollToMessageIndex: (index) => {
5959
- const messageEl = messageRefs.current[index];
5960
- const container = scrollRef.current;
5961
- if (messageEl && container && isExpanded) {
5962
- requestAnimationFrame(() => {
5963
- const containerRect = container.getBoundingClientRect();
5964
- const messageRect = messageEl.getBoundingClientRect();
5965
- const scrollAmount = container.scrollTop + (messageRect.top - containerRect.top);
5966
- container.scrollTop = scrollAmount;
5967
- savedScrollPosition.current = scrollAmount;
5968
- });
5969
- }
5970
- }
5971
- }),
5972
- [isExpanded]
5973
- );
5974
- (0, import_react30.useEffect)(() => {
5975
- const el = scrollRef.current;
5976
- if (!el || !isExpanded)
5977
- return;
5978
- requestAnimationFrame(() => {
5979
- if (savedScrollPosition.current > 0) {
5980
- el.scrollTop = savedScrollPosition.current;
5981
- }
5982
- });
5983
- }, [isExpanded]);
5984
- const messagesToRender = messages.length === 0 ? emptyState : messages;
5985
- (0, import_react30.useEffect)(() => {
5986
- messageRefs.current = messageRefs.current.slice(0, messagesToRender.length);
5987
- }, [messagesToRender.length]);
5988
- const renderedMessages = (0, import_react30.useMemo)(
5989
- () => messagesToRender.map((element, index) => {
5990
- var _a;
5991
- const key = (_a = element.key) != null ? _a : index;
5992
- if (element.type === AIResponse_default) {
5993
- return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
5994
- Box_default,
5995
- {
5996
- css: receivedWrapperStyles,
5997
- ref: (el) => messageRefs.current[index] = el,
5998
- children: element
5999
- },
6000
- key
6001
- );
6002
- }
6003
- if (element.type === MessageBubble_default) {
6004
- return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6005
- Box_default,
6006
- {
6007
- css: sentWrapperStyles,
6008
- ref: (el) => messageRefs.current[index] = el,
6009
- children: element
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 lastUserMessageRef = (0, import_react30.useRef)(null);
5941
+ const isControlled = typeof expanded === "boolean";
5942
+ const [internalExpanded, setInternalExpanded] = (0, import_react30.useState)(defaultExpanded);
5943
+ const isExpanded = isControlled ? expanded : internalExpanded;
5944
+ const setExpanded = (0, import_react30.useCallback)(
5945
+ (next) => {
5946
+ if (!next && scrollRef.current) {
5947
+ savedScrollPosition.current = scrollRef.current.scrollTop;
5948
+ }
5949
+ if (!isControlled)
5950
+ setInternalExpanded(next);
5951
+ onExpandedChange == null ? void 0 : onExpandedChange(next);
5952
+ },
5953
+ [isControlled, onExpandedChange]
5954
+ );
5955
+ (0, import_react30.useEffect)(() => {
5956
+ const el = scrollRef.current;
5957
+ if (!el || !isExpanded)
5958
+ return;
5959
+ requestAnimationFrame(() => {
5960
+ if (savedScrollPosition.current > 0) {
5961
+ el.scrollTop = savedScrollPosition.current;
5962
+ }
5963
+ });
5964
+ }, [isExpanded]);
5965
+ (0, import_react30.useEffect)(() => {
5966
+ if (!isExpanded)
5967
+ return;
5968
+ const messagesChanged = messages.length !== previousMessagesLength.current;
5969
+ previousMessagesLength.current = messages.length;
5970
+ if (messagesChanged && messages.length > 0) {
5971
+ const lastMessage = messages[messages.length - 1];
5972
+ const lastMessageElement = lastMessage;
5973
+ const isUserMessage = lastMessageElement.type === MessageBubble_default;
5974
+ if (isUserMessage && lastUserMessageRef.current) {
5975
+ requestAnimationFrame(() => {
5976
+ var _a;
5977
+ (_a = lastUserMessageRef.current) == null ? void 0 : _a.scrollIntoView({
5978
+ behavior: "smooth",
5979
+ block: "start"
5980
+ });
5981
+ });
5982
+ }
5983
+ }
5984
+ }, [messages, isExpanded]);
5985
+ const messagesToRender = messages.length === 0 ? emptyState : messages;
5986
+ const lastUserMessageIndex = (0, import_react30.useMemo)(() => {
5987
+ for (let i = messagesToRender.length - 1; i >= 0; i--) {
5988
+ const message = messagesToRender[i];
5989
+ if (message && message.type === MessageBubble_default) {
5990
+ return i;
5991
+ }
5992
+ }
5993
+ return -1;
5994
+ }, [messagesToRender]);
5995
+ const renderedMessages = (0, import_react30.useMemo)(
5996
+ () => messagesToRender.map((element, index) => {
5997
+ var _a;
5998
+ const key = (_a = element.key) != null ? _a : index;
5999
+ const isLastUserMessage = index === lastUserMessageIndex;
6000
+ if (element.type === AIResponse_default) {
6001
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: element }, key);
6002
+ }
6003
+ if (element.type === MessageBubble_default) {
6004
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6005
+ Box_default,
6006
+ {
6007
+ css: sentWrapperStyles,
6008
+ ref: isLastUserMessage ? lastUserMessageRef : null,
6009
+ style: {
6010
+ scrollMarginTop: "16px"
6011
+ // Add padding above when scrolled to
6010
6012
  },
6011
- key
6012
- );
6013
- }
6014
- return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { ref: (el) => messageRefs.current[index] = el, children: element }, key);
6015
- }),
6016
- [messagesToRender]
6017
- );
6018
- const handleSubmit = () => {
6019
- const trimmed = value.trim();
6020
- if (!trimmed)
6021
- return;
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
- ] }),
6013
+ children: element
6014
+ },
6015
+ key
6016
+ );
6017
+ }
6018
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(import_react30.default.Fragment, { children: element }, key);
6019
+ }),
6020
+ [messagesToRender, lastUserMessageIndex]
6021
+ );
6022
+ const handleSubmit = () => {
6023
+ const trimmed = value.trim();
6024
+ if (!trimmed)
6025
+ return;
6026
+ onSubmit(trimmed);
6027
+ setValue("");
6028
+ };
6029
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6030
+ Widget_default,
6031
+ {
6032
+ ariaLabel,
6033
+ icon: "ConversationalSearchAi",
6034
+ expanded: isExpanded,
6035
+ onExpandedChange: setExpanded,
6036
+ panelWidth,
6037
+ className,
6038
+ containerProps,
6039
+ closeOnClickOutside,
6040
+ children: [
6041
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(AskBuckButton_default, { badgeCount: notificationCount }) }),
6042
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Widget_default.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { css: containerStyles, children: [
6043
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { position: "sticky", top: 0, zIndex: 1, children: [
6078
6044
  /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6079
6045
  Box_default,
6080
6046
  {
6081
- ref: scrollRef,
6082
- flex: "1 1 auto",
6083
- minHeight: 0,
6084
- overflowY: "auto",
6085
- p: 0,
6086
- pb: 4,
6087
6047
  display: "flex",
6088
- flexDirection: "column",
6089
- gap: "var(--spacing-2)",
6048
+ alignItems: "center",
6049
+ justifyContent: "space-between",
6050
+ gap: "var(--spacing-4)",
6090
6051
  children: [
6091
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { display: "flex", flexDirection: "column", gap: "var(--spacing-2)", children: renderedMessages }),
6092
- isThinking && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: thinkingRowStyles, children: [
6093
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Spinner_default2, { size: "medium" }),
6094
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: thinkingTextStyles, children: thinkingText })
6095
- ] }) }),
6096
- suggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6097
- Box_default,
6052
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: [
6053
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: badge, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "ConversationalSearchAi", size: "large" }) }),
6054
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6055
+ Heading_default,
6056
+ {
6057
+ size: "2xs",
6058
+ fontWeight: "bold",
6059
+ color: "var(--text-primary)",
6060
+ children: title
6061
+ }
6062
+ )
6063
+ ] }),
6064
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6065
+ Button_default,
6098
6066
  {
6099
- display: "flex",
6100
- flexDirection: "column",
6101
- gap: "var(--spacing-4)",
6102
- children: [
6103
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Text_default, { size: "md", fontWeight: "bold", color: "var(--text-primary)", children: suggestedPromptsTitle }),
6104
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6105
- Box_default,
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
- ]
6067
+ variant: "text",
6068
+ size: "xs",
6069
+ "aria-label": "Close widget",
6070
+ onClick: () => setExpanded(false),
6071
+ children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("span", { css: closeButtonContent, children: [
6072
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "Xmark", size: "medium" }),
6073
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { children: "Close" })
6074
+ ] })
6127
6075
  }
6128
- ) })
6076
+ )
6129
6077
  ]
6130
6078
  }
6131
6079
  ),
6132
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { position: "sticky", bottom: 0, zIndex: 1, p: 0, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6133
- TextArea_default,
6134
- {
6135
- rows: 3,
6136
- value,
6137
- maxHeight: 250,
6138
- autoExpand: true,
6139
- onChange: (e) => setValue(e.target.value),
6140
- showSubmit: true,
6141
- onSubmit: handleSubmit,
6142
- disabled,
6143
- submitDisabled: !value.trim() || isThinking,
6144
- placeholder
6145
- }
6146
- ) })
6147
- ] }) })
6148
- ]
6149
- }
6150
- );
6151
- }
6152
- );
6153
- ChatWidget.displayName = "ChatWidget";
6080
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Divider_default, { mt: 4, mb: 0 })
6081
+ ] }),
6082
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6083
+ Box_default,
6084
+ {
6085
+ ref: scrollRef,
6086
+ flex: "1 1 auto",
6087
+ minHeight: 0,
6088
+ overflowY: "auto",
6089
+ p: 0,
6090
+ pb: 4,
6091
+ display: "flex",
6092
+ flexDirection: "column",
6093
+ gap: "var(--spacing-2)",
6094
+ children: [
6095
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { display: "flex", flexDirection: "column", gap: "var(--spacing-2)", children: renderedMessages }),
6096
+ isThinking && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: thinkingRowStyles, children: [
6097
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Spinner_default2, { size: "medium" }),
6098
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: thinkingTextStyles, children: thinkingText })
6099
+ ] }) }),
6100
+ suggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6101
+ Box_default,
6102
+ {
6103
+ display: "flex",
6104
+ flexDirection: "column",
6105
+ gap: "var(--spacing-4)",
6106
+ children: [
6107
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Text_default, { size: "md", fontWeight: "bold", color: "var(--text-primary)", children: suggestedPromptsTitle }),
6108
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6109
+ Box_default,
6110
+ {
6111
+ display: "flex",
6112
+ flexWrap: "wrap",
6113
+ gap: "var(--spacing-4)",
6114
+ alignItems: "flex-start",
6115
+ children: suggestedPrompts.map((prompt, index) => /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6116
+ TagChip_default,
6117
+ {
6118
+ variant: "success",
6119
+ onClick: () => {
6120
+ var _a;
6121
+ return onPromptClick == null ? void 0 : onPromptClick((_a = prompt.value) != null ? _a : prompt.label);
6122
+ },
6123
+ style: { cursor: "pointer" },
6124
+ children: prompt.label
6125
+ },
6126
+ index
6127
+ ))
6128
+ }
6129
+ )
6130
+ ]
6131
+ }
6132
+ ) })
6133
+ ]
6134
+ }
6135
+ ),
6136
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { position: "sticky", bottom: 0, zIndex: 1, p: 0, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6137
+ TextArea_default,
6138
+ {
6139
+ rows: 3,
6140
+ value,
6141
+ maxHeight: 250,
6142
+ autoExpand: true,
6143
+ onChange: (e) => setValue(e.target.value),
6144
+ showSubmit: true,
6145
+ onSubmit: handleSubmit,
6146
+ disabled,
6147
+ submitDisabled: !value.trim() || isThinking,
6148
+ placeholder
6149
+ }
6150
+ ) })
6151
+ ] }) })
6152
+ ]
6153
+ }
6154
+ );
6155
+ };
6154
6156
  var ChatWidget_default = ChatWidget;
6155
6157
 
6156
6158
  // src/FeatureList/components/FeatureListItem.tsx