@landtrustinc/design-system 1.2.73 → 1.2.74

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.js CHANGED
@@ -7299,6 +7299,7 @@ var ChatWidget = ({
7299
7299
  enableScrollToBottomControl = true
7300
7300
  }) => {
7301
7301
  const [value, setValue] = (0, import_react44.useState)("");
7302
+ const textAreaRef = (0, import_react44.useRef)(null);
7302
7303
  const isControlled = typeof expanded === "boolean";
7303
7304
  const [internalExpanded, setInternalExpanded] = (0, import_react44.useState)(defaultExpanded);
7304
7305
  const isExpanded = isControlled ? expanded : internalExpanded;
@@ -7324,6 +7325,14 @@ var ChatWidget = ({
7324
7325
  },
7325
7326
  [isControlled, onExpandedChange, saveCurrentScrollPosition]
7326
7327
  );
7328
+ (0, import_react44.useEffect)(() => {
7329
+ if (isExpanded) {
7330
+ requestAnimationFrame(() => {
7331
+ var _a;
7332
+ return (_a = textAreaRef.current) == null ? void 0 : _a.focus();
7333
+ });
7334
+ }
7335
+ }, [isExpanded]);
7327
7336
  const messagesToRender = messages.length === 0 ? emptyState : messages;
7328
7337
  const shouldRenderSuggestedPrompts = messages.length === 0 && !!(suggestedPrompts == null ? void 0 : suggestedPrompts.length);
7329
7338
  const firstAIResponseIndex = messagesToRender.findIndex(
@@ -7492,6 +7501,7 @@ var ChatWidget = ({
7492
7501
  /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Box_default, { position: "sticky", bottom: 0, zIndex: 1, p: 0, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
7493
7502
  TextArea_default,
7494
7503
  {
7504
+ ref: textAreaRef,
7495
7505
  rows: 3,
7496
7506
  value,
7497
7507
  maxHeight: 250,