@landtrustinc/design-system 1.2.5-beta.0 → 1.2.5-beta.2

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
@@ -1307,8 +1307,13 @@ type ChatWidgetProps = {
1307
1307
  * Number to display in notification badge on trigger button
1308
1308
  */
1309
1309
  notificationCount?: number;
1310
+ /**
1311
+ * Whether to close the widget when clicking outside
1312
+ * @default true
1313
+ */
1314
+ closeOnClickOutside?: boolean;
1310
1315
  };
1311
- declare const ChatWidget: ({ title, messages, onSubmit, placeholder, disabled, className, ariaLabel, panelWidth, expanded, defaultExpanded, onExpandedChange, isThinking, thinkingText, emptyState, containerProps, suggestedPrompts, onPromptClick, suggestedPromptsTitle, notificationCount, }: ChatWidgetProps) => _emotion_react_jsx_runtime.JSX.Element;
1316
+ 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;
1312
1317
 
1313
1318
  type DividerProps = React__default.HTMLAttributes<HTMLHRElement> & SpaceProps & {
1314
1319
  /**
@@ -2163,6 +2168,11 @@ type WidgetProps = {
2163
2168
  * Additional props for the container
2164
2169
  */
2165
2170
  containerProps?: BoxProps;
2171
+ /**
2172
+ * Whether to close the widget when clicking outside
2173
+ * @default true
2174
+ */
2175
+ closeOnClickOutside?: boolean;
2166
2176
  };
2167
2177
  type WidgetTriggerProps = {
2168
2178
  /**
package/dist/index.js CHANGED
@@ -4932,11 +4932,9 @@ var panelContainer = import_react25.css`
4932
4932
  bottom: calc(100% + var(--spacing-2));
4933
4933
  z-index: 1;
4934
4934
 
4935
- @media (max-width: calc(${screens.sm} - 1px)) {
4935
+ @media (max-width: calc(${screens.md} - 1px)) {
4936
4936
  position: fixed;
4937
4937
  inset: 0;
4938
- right: 0;
4939
- bottom: 0;
4940
4938
  display: flex;
4941
4939
  align-items: stretch;
4942
4940
  justify-content: stretch;
@@ -4948,13 +4946,11 @@ var panelCard = (width2) => import_react25.css`
4948
4946
  border: 1px solid var(--border-primary);
4949
4947
  border-radius: var(--radius-lg);
4950
4948
  padding: var(--spacing-4);
4951
- overflow: auto;
4952
4949
  box-shadow: 0 0 var(--shadow-blur-lg, 24px) var(--shadow-spread-xs, -4px)
4953
4950
  rgba(17, 17, 17, 0.1);
4954
4951
 
4955
4952
  /* Width passed from props (desktop/tablet) */
4956
4953
  width: ${typeof width2 === "number" ? `${width2}px` : width2};
4957
- max-height: 90vh;
4958
4954
 
4959
4955
  /* Scale animation on open */
4960
4956
  transform-origin: bottom right;
@@ -4969,13 +4965,14 @@ var panelCard = (width2) => import_react25.css`
4969
4965
  }
4970
4966
  }
4971
4967
 
4972
- @media (max-width: calc(${screens.sm} - 1px)) {
4968
+ @media (max-width: calc(${screens.md} - 1px)) {
4973
4969
  width: 100vw;
4974
4970
  height: 100vh;
4971
+ max-height: 100vh;
4975
4972
  border-radius: 0;
4976
4973
  padding: var(--spacing-4);
4977
4974
  overflow: auto;
4978
- transform-origin: center;
4975
+ animation: none;
4979
4976
  }
4980
4977
  `;
4981
4978
  var widgetTrigger = import_react25.css`
@@ -5033,7 +5030,8 @@ var WidgetRoot = ({
5033
5030
  panelWidth,
5034
5031
  className,
5035
5032
  children,
5036
- containerProps
5033
+ containerProps,
5034
+ closeOnClickOutside = true
5037
5035
  }) => {
5038
5036
  const [internalExpanded, setInternalExpanded] = (0, import_react26.useState)(defaultExpanded);
5039
5037
  const isControlled = typeof expanded === "boolean";
@@ -5059,7 +5057,7 @@ var WidgetRoot = ({
5059
5057
  [isExpanded, setExpanded]
5060
5058
  );
5061
5059
  (0, import_react26.useEffect)(() => {
5062
- if (!isExpanded)
5060
+ if (!isExpanded || !closeOnClickOutside)
5063
5061
  return;
5064
5062
  const onDocClick = (e) => {
5065
5063
  const target = e.target;
@@ -5071,7 +5069,7 @@ var WidgetRoot = ({
5071
5069
  };
5072
5070
  document.addEventListener("mousedown", onDocClick);
5073
5071
  return () => document.removeEventListener("mousedown", onDocClick);
5074
- }, [isExpanded, setExpanded]);
5072
+ }, [isExpanded, setExpanded, closeOnClickOutside]);
5075
5073
  (0, import_react26.useEffect)(() => {
5076
5074
  if (!isExpanded)
5077
5075
  return;
@@ -5136,9 +5134,11 @@ var containerStyles = import_react27.css`
5136
5134
  flex-direction: column;
5137
5135
  min-height: 0;
5138
5136
  height: 765px;
5137
+ max-height: 80vh;
5139
5138
 
5140
- @media (max-width: calc(${screens.sm} - 1px)) {
5139
+ @media (max-width: calc(${screens.md} - 1px)) {
5141
5140
  height: 100%;
5141
+ max-height: 100%;
5142
5142
  }
5143
5143
  `;
5144
5144
  var thinkingRowStyles = import_react27.css`
@@ -5336,7 +5336,8 @@ var ChatWidget = ({
5336
5336
  suggestedPrompts,
5337
5337
  onPromptClick,
5338
5338
  suggestedPromptsTitle = "Other Helpful Topics",
5339
- notificationCount
5339
+ notificationCount,
5340
+ closeOnClickOutside = true
5340
5341
  }) => {
5341
5342
  const [value, setValue] = (0, import_react30.useState)("");
5342
5343
  const scrollRef = (0, import_react30.useRef)(null);
@@ -5389,6 +5390,7 @@ var ChatWidget = ({
5389
5390
  panelWidth,
5390
5391
  className,
5391
5392
  containerProps,
5393
+ closeOnClickOutside,
5392
5394
  children: [
5393
5395
  /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Box_default, { mt: 2, children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(AskBuckButton_default, { badgeCount: notificationCount }) }),
5394
5396
  /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Widget_default.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(Box_default, { css: containerStyles, children: [