@landtrustinc/design-system 1.2.45 → 1.2.47-beta.0
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 +9 -1
- package/dist/index.js +63 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1371,6 +1371,14 @@ type MessageBubbleProps = {
|
|
|
1371
1371
|
* Optional timestamp to display
|
|
1372
1372
|
*/
|
|
1373
1373
|
timestamp?: string;
|
|
1374
|
+
/**
|
|
1375
|
+
* Optional avatar image URL
|
|
1376
|
+
*/
|
|
1377
|
+
avatarSrc?: string;
|
|
1378
|
+
/**
|
|
1379
|
+
* Optional author name to display
|
|
1380
|
+
*/
|
|
1381
|
+
author?: string;
|
|
1374
1382
|
/**
|
|
1375
1383
|
* Additional CSS class names
|
|
1376
1384
|
*/
|
|
@@ -1380,7 +1388,7 @@ type MessageBubbleProps = {
|
|
|
1380
1388
|
*/
|
|
1381
1389
|
children?: React__default.ReactNode;
|
|
1382
1390
|
};
|
|
1383
|
-
declare const MessageBubble: ({ variant, timestamp, className, children, }: MessageBubbleProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1391
|
+
declare const MessageBubble: ({ variant, timestamp, avatarSrc, author, className, children, }: MessageBubbleProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1384
1392
|
|
|
1385
1393
|
type ChatWidgetMessage = React__default.ReactElement<React__default.ComponentProps<typeof AIResponse>, typeof AIResponse> | React__default.ReactElement<React__default.ComponentProps<typeof MessageBubble>, typeof MessageBubble>;
|
|
1386
1394
|
type SuggestedPrompt = {
|
package/dist/index.js
CHANGED
|
@@ -6076,14 +6076,44 @@ var getRootStyles = (variant) => import_react29.css`
|
|
|
6076
6076
|
gap: var(--spacing-1);
|
|
6077
6077
|
align-items: ${variant === "sent" ? "flex-end" : "flex-start"};
|
|
6078
6078
|
`;
|
|
6079
|
+
var getOuterWrapperStyles = (variant) => import_react29.css`
|
|
6080
|
+
display: flex;
|
|
6081
|
+
flex-direction: ${variant === "sent" ? "row-reverse" : "row"};
|
|
6082
|
+
gap: var(--spacing-3);
|
|
6083
|
+
align-items: flex-start;
|
|
6084
|
+
width: 100%;
|
|
6085
|
+
`;
|
|
6086
|
+
var avatarWrapperStyles = import_react29.css`
|
|
6087
|
+
flex-shrink: 0;
|
|
6088
|
+
width: 43px;
|
|
6089
|
+
height: 43px;
|
|
6090
|
+
|
|
6091
|
+
img,
|
|
6092
|
+
div {
|
|
6093
|
+
width: 43px !important;
|
|
6094
|
+
height: 43px !important;
|
|
6095
|
+
}
|
|
6096
|
+
`;
|
|
6097
|
+
var contentWrapperStyles = import_react29.css`
|
|
6098
|
+
display: flex;
|
|
6099
|
+
flex-direction: column;
|
|
6100
|
+
gap: var(--spacing-1);
|
|
6101
|
+
flex: 1;
|
|
6102
|
+
min-width: 0;
|
|
6103
|
+
`;
|
|
6104
|
+
var getHeaderStyles = (variant) => import_react29.css`
|
|
6105
|
+
display: flex;
|
|
6106
|
+
align-items: center;
|
|
6107
|
+
gap: var(--spacing-2);
|
|
6108
|
+
flex-direction: ${variant === "sent" ? "row-reverse" : "row"};
|
|
6109
|
+
`;
|
|
6079
6110
|
var getBubbleStyles = (variant) => import_react29.css`
|
|
6080
6111
|
max-width: 100%;
|
|
6081
6112
|
width: 100%;
|
|
6082
6113
|
box-sizing: border-box;
|
|
6083
6114
|
display: flex;
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
justify-content: center;
|
|
6115
|
+
flex-direction: column;
|
|
6116
|
+
gap: var(--spacing-2);
|
|
6087
6117
|
padding: var(--spacing-4);
|
|
6088
6118
|
background-color: ${variant === "sent" ? "var(--color-neutral-900)" : "var(--surface-neutral)"};
|
|
6089
6119
|
color: ${variant === "sent" ? "var(--color-base-white)" : "var(--text-primary)"};
|
|
@@ -6093,6 +6123,9 @@ var getBubbleStyles = (variant) => import_react29.css`
|
|
|
6093
6123
|
border-bottom-left-radius: ${variant === "sent" ? "var(--radius-lg)" : "0"};
|
|
6094
6124
|
border-bottom-right-radius: ${variant === "sent" ? "0" : "var(--radius-lg)"};
|
|
6095
6125
|
`;
|
|
6126
|
+
var getTimestampStyles = (variant) => import_react29.css`
|
|
6127
|
+
text-align: ${variant === "sent" ? "right" : "left"};
|
|
6128
|
+
`;
|
|
6096
6129
|
var contentStyles = import_react29.css`
|
|
6097
6130
|
flex: 1 1 auto;
|
|
6098
6131
|
min-width: 1px;
|
|
@@ -6104,21 +6137,38 @@ var import_jsx_runtime226 = require("@emotion/react/jsx-runtime");
|
|
|
6104
6137
|
var MessageBubble = ({
|
|
6105
6138
|
variant = "sent",
|
|
6106
6139
|
timestamp,
|
|
6140
|
+
avatarSrc,
|
|
6141
|
+
author,
|
|
6107
6142
|
className,
|
|
6108
6143
|
children
|
|
6109
6144
|
}) => {
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6145
|
+
const hasAvatar = !!avatarSrc;
|
|
6146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", { className, css: getRootStyles(variant), children: /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: getOuterWrapperStyles(variant), children: [
|
|
6147
|
+
hasAvatar && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", { css: avatarWrapperStyles, children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6148
|
+
Avatar_default,
|
|
6113
6149
|
{
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6150
|
+
type: "image",
|
|
6151
|
+
src: avatarSrc,
|
|
6152
|
+
alt: author || "Avatar",
|
|
6153
|
+
size: "sm"
|
|
6118
6154
|
}
|
|
6119
|
-
),
|
|
6120
|
-
/* @__PURE__ */ (0, import_jsx_runtime226.
|
|
6121
|
-
|
|
6155
|
+
) }),
|
|
6156
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: contentWrapperStyles, children: [
|
|
6157
|
+
author && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", { css: getHeaderStyles(variant), children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Text_default, { size: "sm", fontWeight: "semibold", color: "var(--text-primary)", children: author }) }),
|
|
6158
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)("div", { css: getBubbleStyles(variant), children: [
|
|
6159
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)("div", { css: contentStyles, children }),
|
|
6160
|
+
timestamp && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
6161
|
+
Text_default,
|
|
6162
|
+
{
|
|
6163
|
+
size: "xs",
|
|
6164
|
+
color: "var(--text-secondary)",
|
|
6165
|
+
css: getTimestampStyles(variant),
|
|
6166
|
+
children: timestamp
|
|
6167
|
+
}
|
|
6168
|
+
)
|
|
6169
|
+
] })
|
|
6170
|
+
] })
|
|
6171
|
+
] }) });
|
|
6122
6172
|
};
|
|
6123
6173
|
var MessageBubble_default = MessageBubble;
|
|
6124
6174
|
|