@landtrustinc/design-system 1.2.73 → 1.2.75
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 +5 -1
- package/dist/index.js +33 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1511,6 +1511,10 @@ type ChatWidgetProps = {
|
|
|
1511
1511
|
* Title displayed in the chat widget header
|
|
1512
1512
|
*/
|
|
1513
1513
|
title: string;
|
|
1514
|
+
/**
|
|
1515
|
+
* Optional tooltip copy rendered behind an info icon next to the title
|
|
1516
|
+
*/
|
|
1517
|
+
titleTooltipContent?: ReactNode;
|
|
1514
1518
|
/**
|
|
1515
1519
|
* Array of messages to display
|
|
1516
1520
|
*/
|
|
@@ -1601,7 +1605,7 @@ type ChatWidgetProps = {
|
|
|
1601
1605
|
*/
|
|
1602
1606
|
enableScrollToBottomControl?: boolean;
|
|
1603
1607
|
};
|
|
1604
|
-
declare const ChatWidget: ({ title, messages, onSubmit, placeholder, disabled, className, ariaLabel, panelWidth, expanded, defaultExpanded, onExpandedChange, isThinking, thinkingText, thinkingContent, emptyState, containerProps, suggestedPrompts, onPromptClick, suggestedPromptsTitle, notificationCount, closeOnClickOutside, enableScrollToBottomControl, }: ChatWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1608
|
+
declare const ChatWidget: ({ title, titleTooltipContent, messages, onSubmit, placeholder, disabled, className, ariaLabel, panelWidth, expanded, defaultExpanded, onExpandedChange, isThinking, thinkingText, thinkingContent, emptyState, containerProps, suggestedPrompts, onPromptClick, suggestedPromptsTitle, notificationCount, closeOnClickOutside, enableScrollToBottomControl, }: ChatWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1605
1609
|
|
|
1606
1610
|
type CtaCardBase = {
|
|
1607
1611
|
/**
|
package/dist/index.js
CHANGED
|
@@ -3452,11 +3452,12 @@ var tooltipContentStyles = import_react3.css`
|
|
|
3452
3452
|
padding: var(--spacing-2) var(--spacing-3);
|
|
3453
3453
|
border-radius: var(--spacing-1);
|
|
3454
3454
|
font-size: var(--font-size-sm);
|
|
3455
|
-
white-space: nowrap;
|
|
3456
3455
|
z-index: 1000;
|
|
3457
3456
|
pointer-events: none;
|
|
3458
3457
|
opacity: 0;
|
|
3459
3458
|
transition: opacity 0.2s ease-in-out;
|
|
3459
|
+
max-width: 320px;
|
|
3460
|
+
text-wrap: pretty;
|
|
3460
3461
|
|
|
3461
3462
|
&[data-visible='true'] {
|
|
3462
3463
|
opacity: 1;
|
|
@@ -7276,6 +7277,7 @@ var DEFAULT_EMPTY_STATE = [
|
|
|
7276
7277
|
];
|
|
7277
7278
|
var ChatWidget = ({
|
|
7278
7279
|
title,
|
|
7280
|
+
titleTooltipContent,
|
|
7279
7281
|
messages,
|
|
7280
7282
|
onSubmit,
|
|
7281
7283
|
placeholder = "Type your question",
|
|
@@ -7299,6 +7301,7 @@ var ChatWidget = ({
|
|
|
7299
7301
|
enableScrollToBottomControl = true
|
|
7300
7302
|
}) => {
|
|
7301
7303
|
const [value, setValue] = (0, import_react44.useState)("");
|
|
7304
|
+
const textAreaRef = (0, import_react44.useRef)(null);
|
|
7302
7305
|
const isControlled = typeof expanded === "boolean";
|
|
7303
7306
|
const [internalExpanded, setInternalExpanded] = (0, import_react44.useState)(defaultExpanded);
|
|
7304
7307
|
const isExpanded = isControlled ? expanded : internalExpanded;
|
|
@@ -7324,6 +7327,14 @@ var ChatWidget = ({
|
|
|
7324
7327
|
},
|
|
7325
7328
|
[isControlled, onExpandedChange, saveCurrentScrollPosition]
|
|
7326
7329
|
);
|
|
7330
|
+
(0, import_react44.useEffect)(() => {
|
|
7331
|
+
if (isExpanded) {
|
|
7332
|
+
requestAnimationFrame(() => {
|
|
7333
|
+
var _a;
|
|
7334
|
+
return (_a = textAreaRef.current) == null ? void 0 : _a.focus();
|
|
7335
|
+
});
|
|
7336
|
+
}
|
|
7337
|
+
}, [isExpanded]);
|
|
7327
7338
|
const messagesToRender = messages.length === 0 ? emptyState : messages;
|
|
7328
7339
|
const shouldRenderSuggestedPrompts = messages.length === 0 && !!(suggestedPrompts == null ? void 0 : suggestedPrompts.length);
|
|
7329
7340
|
const firstAIResponseIndex = messagesToRender.findIndex(
|
|
@@ -7378,15 +7389,26 @@ var ChatWidget = ({
|
|
|
7378
7389
|
justifyContent: "space-between",
|
|
7379
7390
|
gap: "var(--spacing-4)",
|
|
7380
7391
|
children: [
|
|
7381
|
-
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: /* @__PURE__ */ (0, import_jsx_runtime236.
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7392
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(Box_default, { display: "flex", alignItems: "center", gap: "var(--spacing-4)", children: [
|
|
7393
|
+
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
7394
|
+
Heading_default,
|
|
7395
|
+
{
|
|
7396
|
+
size: "2xs",
|
|
7397
|
+
fontWeight: "bold",
|
|
7398
|
+
color: "var(--text-primary)",
|
|
7399
|
+
children: title
|
|
7400
|
+
}
|
|
7401
|
+
),
|
|
7402
|
+
titleTooltipContent && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Tooltip_default, { content: titleTooltipContent, position: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
7403
|
+
Box_default,
|
|
7404
|
+
{
|
|
7405
|
+
display: "flex",
|
|
7406
|
+
alignItems: "center",
|
|
7407
|
+
"aria-label": "Show title information",
|
|
7408
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Icon_default, { variant: "CircleInfo", size: "medium" })
|
|
7409
|
+
}
|
|
7410
|
+
) })
|
|
7411
|
+
] }) }),
|
|
7390
7412
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
7391
7413
|
Button_default,
|
|
7392
7414
|
{
|
|
@@ -7492,6 +7514,7 @@ var ChatWidget = ({
|
|
|
7492
7514
|
/* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Box_default, { position: "sticky", bottom: 0, zIndex: 1, p: 0, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
7493
7515
|
TextArea_default,
|
|
7494
7516
|
{
|
|
7517
|
+
ref: textAreaRef,
|
|
7495
7518
|
rows: 3,
|
|
7496
7519
|
value,
|
|
7497
7520
|
maxHeight: 250,
|