@landtrustinc/design-system 1.2.27-beta.1 → 1.2.27-beta.3

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
@@ -532,6 +532,11 @@ type AIResponseProps = {
532
532
  * Optional title for the AI response
533
533
  */
534
534
  title?: string;
535
+ /**
536
+ * Whether to show the title heading
537
+ * @default true
538
+ */
539
+ showTitle?: boolean;
535
540
  /**
536
541
  * Whether to show disclaimer text
537
542
  */
@@ -580,7 +585,7 @@ type AIResponseProps = {
580
585
  */
581
586
  enableCodeCopy?: boolean;
582
587
  };
583
- declare const AIResponse: ({ title, showDisclaimer, showHelpfulQuestion, className, children, onHelpfulYes, onHelpfulNo, variant, onErrorRetry, helpfulDebounceMs, markdown, enableCodeCopy, }: AIResponseProps) => _emotion_react_jsx_runtime.JSX.Element;
588
+ declare const AIResponse: ({ title, showTitle, showDisclaimer, showHelpfulQuestion, className, children, onHelpfulYes, onHelpfulNo, variant, onErrorRetry, helpfulDebounceMs, markdown, enableCodeCopy, }: AIResponseProps) => _emotion_react_jsx_runtime.JSX.Element;
584
589
 
585
590
  type ContactLandownerButtonProps = {
586
591
  /**
@@ -1336,7 +1341,15 @@ type ChatWidgetProps = {
1336
1341
  */
1337
1342
  closeOnClickOutside?: boolean;
1338
1343
  };
1339
- 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;
1344
+ type ChatWidgetRef = {
1345
+ /**
1346
+ * Scroll to a specific message by index
1347
+ * @param index - The index of the message in the messages array
1348
+ * @param position - Where to position the message in the viewport ('start' | 'center' | 'end')
1349
+ */
1350
+ scrollToMessageIndex: (index: number, position?: ScrollLogicalPosition) => void;
1351
+ };
1352
+ declare const ChatWidget: React__default.ForwardRefExoticComponent<ChatWidgetProps & React__default.RefAttributes<ChatWidgetRef>>;
1340
1353
 
1341
1354
  type DividerProps = React__default.HTMLAttributes<HTMLHRElement> & SpaceProps & {
1342
1355
  /**
@@ -2433,4 +2446,4 @@ declare const Widget: React__default.FC<WidgetProps> & {
2433
2446
  }>;
2434
2447
  };
2435
2448
 
2436
- 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 };
2449
+ 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 };
package/dist/index.js CHANGED
@@ -4864,6 +4864,7 @@ var TopMatchingReview = ({
4864
4864
  var import_jsx_runtime217 = require("@emotion/react/jsx-runtime");
4865
4865
  var AIResponse = ({
4866
4866
  title = `Here's what I found`,
4867
+ showTitle = true,
4867
4868
  showDisclaimer = true,
4868
4869
  showHelpfulQuestion = true,
4869
4870
  className,
@@ -4921,7 +4922,7 @@ var AIResponse = ({
4921
4922
  flexDirection: "column",
4922
4923
  gap: "var(--spacing-4)",
4923
4924
  children: [
4924
- variant !== "error" && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(Heading_default, { size: "2xs", fontWeight: "bold", color: "var(--text-primary)", children: title }),
4925
+ variant !== "error" && showTitle && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(Heading_default, { size: "2xs", fontWeight: "bold", color: "var(--text-primary)", children: title }),
4925
4926
  /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)("div", { css: getBannerStyles(variant), children: [
4926
4927
  variant === "error" ? /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(Text_default, { size: "md", color: "var(--text-primary)", children: children || "An error occurred while generating your summary. Please try again." }) : markdown && typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
4927
4928
  MarkdownContent_default,
@@ -5910,218 +5911,244 @@ var DEFAULT_EMPTY_STATE = [
5910
5911
  "default-empty"
5911
5912
  )
5912
5913
  ];
5913
- var ChatWidget = ({
5914
- title,
5915
- messages,
5916
- onSubmit,
5917
- placeholder = "Type your question",
5918
- disabled = false,
5919
- className,
5920
- ariaLabel = "Open Chat",
5921
- panelWidth = 480,
5922
- expanded,
5923
- defaultExpanded = false,
5924
- onExpandedChange,
5925
- isThinking = false,
5926
- thinkingText = "Thinking...",
5927
- emptyState = DEFAULT_EMPTY_STATE,
5928
- containerProps,
5929
- suggestedPrompts,
5930
- onPromptClick,
5931
- suggestedPromptsTitle = "Other Helpful Topics",
5932
- notificationCount,
5933
- closeOnClickOutside = true
5934
- }) => {
5935
- const [value, setValue] = (0, import_react30.useState)("");
5936
- const scrollRef = (0, import_react30.useRef)(null);
5937
- const savedScrollPosition = (0, import_react30.useRef)(0);
5938
- const previousMessagesLength = (0, import_react30.useRef)(messages.length);
5939
- const isControlled = typeof expanded === "boolean";
5940
- const [internalExpanded, setInternalExpanded] = (0, import_react30.useState)(defaultExpanded);
5941
- const isExpanded = isControlled ? expanded : internalExpanded;
5942
- const setExpanded = (0, import_react30.useCallback)(
5943
- (next) => {
5944
- if (!next && scrollRef.current) {
5945
- savedScrollPosition.current = scrollRef.current.scrollTop;
5946
- }
5947
- if (!isControlled)
5948
- setInternalExpanded(next);
5949
- onExpandedChange == null ? void 0 : onExpandedChange(next);
5950
- },
5951
- [isControlled, onExpandedChange]
5952
- );
5953
- (0, import_react30.useEffect)(() => {
5954
- const el = scrollRef.current;
5955
- if (!el || !isExpanded)
5956
- return;
5957
- requestAnimationFrame(() => {
5958
- if (savedScrollPosition.current > 0) {
5959
- el.scrollTop = savedScrollPosition.current;
5960
- }
5961
- });
5962
- }, [isExpanded]);
5963
- (0, import_react30.useEffect)(() => {
5964
- const el = scrollRef.current;
5965
- if (!el || !isExpanded)
5966
- return;
5967
- const messagesChanged = messages.length !== previousMessagesLength.current;
5968
- previousMessagesLength.current = messages.length;
5969
- if (messagesChanged || isThinking) {
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, position2 = "start") => {
5959
+ const messageEl = messageRefs.current[index];
5960
+ if (messageEl && scrollRef.current && isExpanded) {
5961
+ requestAnimationFrame(() => {
5962
+ messageEl.scrollIntoView({ block: position2, behavior: "smooth" });
5963
+ if (scrollRef.current) {
5964
+ savedScrollPosition.current = scrollRef.current.scrollTop;
5965
+ }
5966
+ });
5967
+ }
5968
+ }
5969
+ }),
5970
+ [isExpanded]
5971
+ );
5972
+ (0, import_react30.useEffect)(() => {
5973
+ const el = scrollRef.current;
5974
+ if (!el || !isExpanded)
5975
+ return;
5970
5976
  requestAnimationFrame(() => {
5971
- el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
5972
- savedScrollPosition.current = el.scrollHeight;
5977
+ if (savedScrollPosition.current > 0) {
5978
+ el.scrollTop = savedScrollPosition.current;
5979
+ }
5973
5980
  });
5974
- }
5975
- }, [messages, isThinking, isExpanded]);
5976
- const messagesToRender = messages.length === 0 ? emptyState : messages;
5977
- const renderedMessages = (0, import_react30.useMemo)(
5978
- () => messagesToRender.map((element, index) => {
5979
- var _a;
5980
- const key = (_a = element.key) != null ? _a : index;
5981
- if (element.type === AIResponse_default) {
5982
- return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: element }, key);
5983
- }
5984
- if (element.type === MessageBubble_default) {
5985
- return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: sentWrapperStyles, children: element }, key);
5986
- }
5987
- return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(import_react30.default.Fragment, { children: element }, key);
5988
- }),
5989
- [messagesToRender]
5990
- );
5991
- const handleSubmit = () => {
5992
- const trimmed = value.trim();
5993
- if (!trimmed)
5994
- return;
5995
- onSubmit(trimmed);
5996
- setValue("");
5997
- };
5998
- return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
5999
- Widget_default,
6000
- {
6001
- ariaLabel,
6002
- icon: "ConversationalSearchAi",
6003
- expanded: isExpanded,
6004
- onExpandedChange: setExpanded,
6005
- panelWidth,
6006
- className,
6007
- containerProps,
6008
- closeOnClickOutside,
6009
- children: [
6010
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(AskBuckButton_default, { badgeCount: notificationCount }) }),
6011
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Widget_default.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { css: containerStyles, children: [
6012
- /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { position: "sticky", top: 0, zIndex: 1, children: [
5981
+ }, [isExpanded]);
5982
+ const messagesToRender = messages.length === 0 ? emptyState : messages;
5983
+ (0, import_react30.useEffect)(() => {
5984
+ messageRefs.current = messageRefs.current.slice(0, messagesToRender.length);
5985
+ }, [messagesToRender.length]);
5986
+ const renderedMessages = (0, import_react30.useMemo)(
5987
+ () => messagesToRender.map((element, index) => {
5988
+ var _a;
5989
+ const key = (_a = element.key) != null ? _a : index;
5990
+ if (element.type === AIResponse_default) {
5991
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
5992
+ Box_default,
5993
+ {
5994
+ css: receivedWrapperStyles,
5995
+ ref: (el) => messageRefs.current[index] = el,
5996
+ children: element
5997
+ },
5998
+ key
5999
+ );
6000
+ }
6001
+ if (element.type === MessageBubble_default) {
6002
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6003
+ Box_default,
6004
+ {
6005
+ css: sentWrapperStyles,
6006
+ ref: (el) => messageRefs.current[index] = el,
6007
+ children: element
6008
+ },
6009
+ key
6010
+ );
6011
+ }
6012
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { ref: (el) => messageRefs.current[index] = el, children: element }, key);
6013
+ }),
6014
+ [messagesToRender]
6015
+ );
6016
+ const handleSubmit = () => {
6017
+ const trimmed = value.trim();
6018
+ if (!trimmed)
6019
+ return;
6020
+ onSubmit(trimmed);
6021
+ setValue("");
6022
+ };
6023
+ return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6024
+ Widget_default,
6025
+ {
6026
+ ariaLabel,
6027
+ icon: "ConversationalSearchAi",
6028
+ expanded: isExpanded,
6029
+ onExpandedChange: setExpanded,
6030
+ panelWidth,
6031
+ className,
6032
+ containerProps,
6033
+ closeOnClickOutside,
6034
+ children: [
6035
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(AskBuckButton_default, { badgeCount: notificationCount }) }),
6036
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Widget_default.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { css: containerStyles, children: [
6037
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { position: "sticky", top: 0, zIndex: 1, children: [
6038
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6039
+ Box_default,
6040
+ {
6041
+ display: "flex",
6042
+ alignItems: "center",
6043
+ justifyContent: "space-between",
6044
+ gap: "var(--spacing-4)",
6045
+ children: [
6046
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: [
6047
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: badge, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "ConversationalSearchAi", size: "large" }) }),
6048
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6049
+ Heading_default,
6050
+ {
6051
+ size: "2xs",
6052
+ fontWeight: "bold",
6053
+ color: "var(--text-primary)",
6054
+ children: title
6055
+ }
6056
+ )
6057
+ ] }),
6058
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6059
+ Button_default,
6060
+ {
6061
+ variant: "text",
6062
+ size: "xs",
6063
+ "aria-label": "Close widget",
6064
+ onClick: () => setExpanded(false),
6065
+ children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("span", { css: closeButtonContent, children: [
6066
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "Xmark", size: "medium" }),
6067
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { children: "Close" })
6068
+ ] })
6069
+ }
6070
+ )
6071
+ ]
6072
+ }
6073
+ ),
6074
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Divider_default, { mt: 4, mb: 0 })
6075
+ ] }),
6013
6076
  /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6014
6077
  Box_default,
6015
6078
  {
6079
+ ref: scrollRef,
6080
+ flex: "1 1 auto",
6081
+ minHeight: 0,
6082
+ overflowY: "auto",
6083
+ p: 0,
6084
+ pb: 4,
6016
6085
  display: "flex",
6017
- alignItems: "center",
6018
- justifyContent: "space-between",
6019
- gap: "var(--spacing-4)",
6086
+ flexDirection: "column",
6087
+ gap: "var(--spacing-2)",
6020
6088
  children: [
6021
- /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: [
6022
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: badge, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "ConversationalSearchAi", size: "large" }) }),
6023
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6024
- Heading_default,
6025
- {
6026
- size: "2xs",
6027
- fontWeight: "bold",
6028
- color: "var(--text-primary)",
6029
- children: title
6030
- }
6031
- )
6032
- ] }),
6033
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6034
- Button_default,
6089
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { display: "flex", flexDirection: "column", gap: "var(--spacing-2)", children: renderedMessages }),
6090
+ isThinking && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: thinkingRowStyles, children: [
6091
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Spinner_default2, { size: "medium" }),
6092
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: thinkingTextStyles, children: thinkingText })
6093
+ ] }) }),
6094
+ suggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6095
+ Box_default,
6035
6096
  {
6036
- variant: "text",
6037
- size: "xs",
6038
- "aria-label": "Close widget",
6039
- onClick: () => setExpanded(false),
6040
- children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("span", { css: closeButtonContent, children: [
6041
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon_default, { variant: "Xmark", size: "medium" }),
6042
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { children: "Close" })
6043
- ] })
6097
+ display: "flex",
6098
+ flexDirection: "column",
6099
+ gap: "var(--spacing-4)",
6100
+ children: [
6101
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Text_default, { size: "md", fontWeight: "bold", color: "var(--text-primary)", children: suggestedPromptsTitle }),
6102
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6103
+ Box_default,
6104
+ {
6105
+ display: "flex",
6106
+ flexWrap: "wrap",
6107
+ gap: "var(--spacing-4)",
6108
+ alignItems: "flex-start",
6109
+ children: suggestedPrompts.map((prompt, index) => /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6110
+ TagChip_default,
6111
+ {
6112
+ variant: "success",
6113
+ onClick: () => {
6114
+ var _a;
6115
+ return onPromptClick == null ? void 0 : onPromptClick((_a = prompt.value) != null ? _a : prompt.label);
6116
+ },
6117
+ style: { cursor: "pointer" },
6118
+ children: prompt.label
6119
+ },
6120
+ index
6121
+ ))
6122
+ }
6123
+ )
6124
+ ]
6044
6125
  }
6045
- )
6126
+ ) })
6046
6127
  ]
6047
6128
  }
6048
6129
  ),
6049
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Divider_default, { mt: 4, mb: 0 })
6050
- ] }),
6051
- /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6052
- Box_default,
6053
- {
6054
- ref: scrollRef,
6055
- flex: "1 1 auto",
6056
- minHeight: 0,
6057
- overflowY: "auto",
6058
- p: 0,
6059
- pb: 4,
6060
- display: "flex",
6061
- flexDirection: "column",
6062
- gap: "var(--spacing-2)",
6063
- children: [
6064
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { display: "flex", flexDirection: "column", gap: "var(--spacing-2)", children: renderedMessages }),
6065
- isThinking && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: thinkingRowStyles, children: [
6066
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Spinner_default2, { size: "medium" }),
6067
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("span", { css: thinkingTextStyles, children: thinkingText })
6068
- ] }) }),
6069
- suggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { css: receivedWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(
6070
- Box_default,
6071
- {
6072
- display: "flex",
6073
- flexDirection: "column",
6074
- gap: "var(--spacing-4)",
6075
- children: [
6076
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Text_default, { size: "md", fontWeight: "bold", color: "var(--text-primary)", children: suggestedPromptsTitle }),
6077
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6078
- Box_default,
6079
- {
6080
- display: "flex",
6081
- flexWrap: "wrap",
6082
- gap: "var(--spacing-4)",
6083
- alignItems: "flex-start",
6084
- children: suggestedPrompts.map((prompt, index) => /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6085
- TagChip_default,
6086
- {
6087
- variant: "success",
6088
- onClick: () => {
6089
- var _a;
6090
- return onPromptClick == null ? void 0 : onPromptClick((_a = prompt.value) != null ? _a : prompt.label);
6091
- },
6092
- style: { cursor: "pointer" },
6093
- children: prompt.label
6094
- },
6095
- index
6096
- ))
6097
- }
6098
- )
6099
- ]
6100
- }
6101
- ) })
6102
- ]
6103
- }
6104
- ),
6105
- /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { position: "sticky", bottom: 0, zIndex: 1, p: 0, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6106
- TextArea_default,
6107
- {
6108
- rows: 3,
6109
- value,
6110
- maxHeight: 250,
6111
- autoExpand: true,
6112
- onChange: (e) => setValue(e.target.value),
6113
- showSubmit: true,
6114
- onSubmit: handleSubmit,
6115
- disabled,
6116
- submitDisabled: !value.trim() || isThinking,
6117
- placeholder
6118
- }
6119
- ) })
6120
- ] }) })
6121
- ]
6122
- }
6123
- );
6124
- };
6130
+ /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Box_default, { position: "sticky", bottom: 0, zIndex: 1, p: 0, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
6131
+ TextArea_default,
6132
+ {
6133
+ rows: 3,
6134
+ value,
6135
+ maxHeight: 250,
6136
+ autoExpand: true,
6137
+ onChange: (e) => setValue(e.target.value),
6138
+ showSubmit: true,
6139
+ onSubmit: handleSubmit,
6140
+ disabled,
6141
+ submitDisabled: !value.trim() || isThinking,
6142
+ placeholder
6143
+ }
6144
+ ) })
6145
+ ] }) })
6146
+ ]
6147
+ }
6148
+ );
6149
+ }
6150
+ );
6151
+ ChatWidget.displayName = "ChatWidget";
6125
6152
  var ChatWidget_default = ChatWidget;
6126
6153
 
6127
6154
  // src/FeatureList/components/FeatureListItem.tsx