@landtrustinc/design-system 1.2.5-beta.0 → 1.2.5-beta.1
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 +11 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
@@ -4935,8 +4935,6 @@ var panelContainer = import_react25.css`
|
|
|
4935
4935
|
@media (max-width: calc(${screens.sm} - 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;
|
|
@@ -4954,7 +4952,7 @@ var panelCard = (width2) => import_react25.css`
|
|
|
4954
4952
|
|
|
4955
4953
|
/* Width passed from props (desktop/tablet) */
|
|
4956
4954
|
width: ${typeof width2 === "number" ? `${width2}px` : width2};
|
|
4957
|
-
max-height:
|
|
4955
|
+
max-height: 85vh;
|
|
4958
4956
|
|
|
4959
4957
|
/* Scale animation on open */
|
|
4960
4958
|
transform-origin: bottom right;
|
|
@@ -4972,10 +4970,11 @@ var panelCard = (width2) => import_react25.css`
|
|
|
4972
4970
|
@media (max-width: calc(${screens.sm} - 1px)) {
|
|
4973
4971
|
width: 100vw;
|
|
4974
4972
|
height: 100vh;
|
|
4973
|
+
max-height: 100vh;
|
|
4975
4974
|
border-radius: 0;
|
|
4976
4975
|
padding: var(--spacing-4);
|
|
4977
4976
|
overflow: auto;
|
|
4978
|
-
|
|
4977
|
+
animation: none;
|
|
4979
4978
|
}
|
|
4980
4979
|
`;
|
|
4981
4980
|
var widgetTrigger = import_react25.css`
|
|
@@ -5033,7 +5032,8 @@ var WidgetRoot = ({
|
|
|
5033
5032
|
panelWidth,
|
|
5034
5033
|
className,
|
|
5035
5034
|
children,
|
|
5036
|
-
containerProps
|
|
5035
|
+
containerProps,
|
|
5036
|
+
closeOnClickOutside = true
|
|
5037
5037
|
}) => {
|
|
5038
5038
|
const [internalExpanded, setInternalExpanded] = (0, import_react26.useState)(defaultExpanded);
|
|
5039
5039
|
const isControlled = typeof expanded === "boolean";
|
|
@@ -5059,7 +5059,7 @@ var WidgetRoot = ({
|
|
|
5059
5059
|
[isExpanded, setExpanded]
|
|
5060
5060
|
);
|
|
5061
5061
|
(0, import_react26.useEffect)(() => {
|
|
5062
|
-
if (!isExpanded)
|
|
5062
|
+
if (!isExpanded || !closeOnClickOutside)
|
|
5063
5063
|
return;
|
|
5064
5064
|
const onDocClick = (e) => {
|
|
5065
5065
|
const target = e.target;
|
|
@@ -5071,7 +5071,7 @@ var WidgetRoot = ({
|
|
|
5071
5071
|
};
|
|
5072
5072
|
document.addEventListener("mousedown", onDocClick);
|
|
5073
5073
|
return () => document.removeEventListener("mousedown", onDocClick);
|
|
5074
|
-
}, [isExpanded, setExpanded]);
|
|
5074
|
+
}, [isExpanded, setExpanded, closeOnClickOutside]);
|
|
5075
5075
|
(0, import_react26.useEffect)(() => {
|
|
5076
5076
|
if (!isExpanded)
|
|
5077
5077
|
return;
|
|
@@ -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: [
|