@studiolxd/brand 48.1.0 → 49.0.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/CHANGELOG.md +169 -0
- package/dist/_shared/untrustedtext.js +27 -26
- package/dist/_types/atoms/TypingIndicator/TypingIndicator.d.ts +29 -2
- package/dist/_types/messages/BrandMessages.d.ts +25 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/AssistantMessage/AssistantMessage.d.ts +15 -1
- package/dist/_types/molecules/ConversationList/ConversationList.d.ts +42 -8
- package/dist/_types/molecules/MessageComposer/MessageComposer.d.ts +24 -1
- package/dist/_types/organisms/AnnotationThread/AnnotationThread.d.ts +52 -7
- package/dist/_types/organisms/ConversationThread/ConversationThread.d.ts +26 -3
- package/dist/_types/templates/ChatShell/ChatShell.d.ts +22 -4
- package/dist/_types/templates/ConnectorAuth/ConnectorAuthShell.d.ts +6 -1
- package/dist/_types/templates/ConnectorAuth/ConnectorConsentPage.d.ts +52 -18
- package/dist/_types/templates/ConnectorAuth/ConnectorExternalSignInPage.d.ts +57 -17
- package/dist/_types/templates/ConnectorAuth/ConnectorRejectionPage.d.ts +59 -15
- package/dist/_types/templates/ConnectorAuth/ConnectorRequestSummary.d.ts +43 -12
- package/dist/_types/templates/ConnectorAuth/ConnectorSignInPage.d.ts +46 -12
- package/dist/_types/templates/ConnectorAuth/UntrustedText.d.ts +31 -4
- package/dist/annotation-thread.js +49 -46
- package/dist/assistant-message.js +12 -9
- package/dist/brand.css +21 -10
- package/dist/chat-shell.js +50 -49
- package/dist/connector-consent-page.js +58 -68
- package/dist/connector-external-sign-in-page.js +22 -28
- package/dist/connector-rejection-page.js +31 -62
- package/dist/connector-request-summary.js +22 -20
- package/dist/connector-sign-in-page.js +21 -25
- package/dist/conversation-list.js +56 -55
- package/dist/conversation-thread.js +33 -31
- package/dist/link.css +1 -1
- package/dist/message-composer.js +38 -37
- package/dist/typing-indicator.js +12 -9
- package/package.json +1 -1
|
@@ -1,95 +1,96 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './conversation-list.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Icon as t } from "./icon.js";
|
|
5
|
+
import { Button as n } from "./button.js";
|
|
6
|
+
import { Skeleton as r } from "./skeleton.js";
|
|
7
|
+
import { Tooltip as i } from "./tooltip.js";
|
|
8
|
+
import { Alert as a } from "./alert.js";
|
|
9
|
+
import { EmptyState as o } from "./empty-state.js";
|
|
10
|
+
import { forwardRef as s, useState as c } from "react";
|
|
11
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
12
|
//#region src/stories/molecules/ConversationList/ConversationList.tsx
|
|
12
|
-
function
|
|
13
|
+
function d(e) {
|
|
13
14
|
return e.scrollWidth > e.clientWidth + 1;
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
-
let [
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
ref:
|
|
19
|
-
className: `conversation-list${
|
|
20
|
-
...
|
|
21
|
-
children: [/* @__PURE__ */
|
|
16
|
+
var f = s(function({ conversations: s, activeId: f, onNew: p, onSelect: m, onDelete: h, newLabel: g, navLabel: _, deleteLabel: v, isLoading: y = !1, loadingCount: b = 4, error: x, emptyMessage: S, errorTitle: C, className: w, ...T }, E) {
|
|
17
|
+
let [D, O] = c(null), k = e("conversationList"), A = x === void 0 ? y ? "loading" : s.length === 0 ? "empty" : "list" : "error";
|
|
18
|
+
return /* @__PURE__ */ u("div", {
|
|
19
|
+
ref: E,
|
|
20
|
+
className: `conversation-list${w ? ` ${w}` : ""}`,
|
|
21
|
+
...T,
|
|
22
|
+
children: [/* @__PURE__ */ l("div", {
|
|
22
23
|
className: "conversation-list__header",
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
+
children: /* @__PURE__ */ l(n, {
|
|
24
25
|
variant: "outline",
|
|
25
26
|
block: !0,
|
|
26
|
-
onClick:
|
|
27
|
-
children:
|
|
27
|
+
onClick: p,
|
|
28
|
+
children: k("new", g)
|
|
28
29
|
})
|
|
29
|
-
}), /* @__PURE__ */
|
|
30
|
-
"aria-label":
|
|
30
|
+
}), /* @__PURE__ */ u("nav", {
|
|
31
|
+
"aria-label": k("nav", _),
|
|
31
32
|
className: "conversation-list__nav",
|
|
32
|
-
"aria-busy":
|
|
33
|
+
"aria-busy": y || void 0,
|
|
33
34
|
children: [
|
|
34
|
-
|
|
35
|
+
A === "error" && /* @__PURE__ */ l(a, {
|
|
35
36
|
variant: "error",
|
|
36
|
-
title:
|
|
37
|
-
description:
|
|
37
|
+
title: k("error", C),
|
|
38
|
+
description: x,
|
|
38
39
|
className: "conversation-list__state"
|
|
39
40
|
}),
|
|
40
|
-
|
|
41
|
+
A === "loading" && /* @__PURE__ */ l("div", {
|
|
41
42
|
className: "conversation-list__loading",
|
|
42
|
-
children: Array.from({ length:
|
|
43
|
+
children: Array.from({ length: b }, (e, t) => /* @__PURE__ */ l(r, {}, t))
|
|
43
44
|
}),
|
|
44
|
-
|
|
45
|
+
A === "empty" && /* @__PURE__ */ l(o, {
|
|
45
46
|
size: "sm",
|
|
46
|
-
title:
|
|
47
|
+
title: k("empty", S),
|
|
47
48
|
className: "conversation-list__state"
|
|
48
49
|
}),
|
|
49
|
-
|
|
50
|
+
A === "list" && /* @__PURE__ */ l("ul", {
|
|
50
51
|
className: "conversation-list__items",
|
|
51
52
|
role: "list",
|
|
52
|
-
children:
|
|
53
|
-
let
|
|
54
|
-
return /* @__PURE__ */
|
|
53
|
+
children: s.map((e) => {
|
|
54
|
+
let r = e.id === f;
|
|
55
|
+
return /* @__PURE__ */ u("li", {
|
|
55
56
|
className: "conversation-list__item",
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
label:
|
|
57
|
+
children: [/* @__PURE__ */ l(i, {
|
|
58
|
+
label: e.label,
|
|
58
59
|
describe: !1,
|
|
59
|
-
open:
|
|
60
|
+
open: D === e.id,
|
|
60
61
|
onOpenChange: (e) => {
|
|
61
|
-
e ||
|
|
62
|
+
e || O(null);
|
|
62
63
|
},
|
|
63
|
-
onPointerEnter: (
|
|
64
|
-
|
|
64
|
+
onPointerEnter: (t) => {
|
|
65
|
+
d(t.currentTarget) && O(e.id);
|
|
65
66
|
},
|
|
66
|
-
onPointerLeave: () =>
|
|
67
|
-
onFocus: (
|
|
68
|
-
|
|
67
|
+
onPointerLeave: () => O(null),
|
|
68
|
+
onFocus: (t) => {
|
|
69
|
+
d(t.currentTarget) && O(e.id);
|
|
69
70
|
},
|
|
70
|
-
onBlur: () =>
|
|
71
|
-
children: /* @__PURE__ */
|
|
71
|
+
onBlur: () => O(null),
|
|
72
|
+
children: /* @__PURE__ */ l("button", {
|
|
72
73
|
type: "button",
|
|
73
|
-
className: `conversation-list__label${
|
|
74
|
-
"aria-current":
|
|
75
|
-
onClick: () =>
|
|
76
|
-
children:
|
|
74
|
+
className: `conversation-list__label${r ? " conversation-list__label--active" : ""}`,
|
|
75
|
+
"aria-current": r ? "page" : void 0,
|
|
76
|
+
onClick: () => m(e.id),
|
|
77
|
+
children: e.label
|
|
77
78
|
})
|
|
78
|
-
}), /* @__PURE__ */
|
|
79
|
+
}), /* @__PURE__ */ l(n, {
|
|
79
80
|
variant: "ghost",
|
|
80
81
|
size: "sm",
|
|
81
82
|
iconOnly: !0,
|
|
82
|
-
"aria-label":
|
|
83
|
+
"aria-label": k("delete", v)(e.label),
|
|
83
84
|
className: "conversation-list__delete",
|
|
84
|
-
onClick: (
|
|
85
|
-
|
|
85
|
+
onClick: (t) => {
|
|
86
|
+
t.stopPropagation(), h(e.id);
|
|
86
87
|
},
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ l(t, {
|
|
88
89
|
name: "close",
|
|
89
90
|
size: "sm"
|
|
90
91
|
})
|
|
91
92
|
})]
|
|
92
|
-
},
|
|
93
|
+
}, e.id);
|
|
93
94
|
})
|
|
94
95
|
})
|
|
95
96
|
]
|
|
@@ -97,4 +98,4 @@ var d = o(function({ conversations: o, activeId: d, onNew: f, onSelect: p, onDel
|
|
|
97
98
|
});
|
|
98
99
|
});
|
|
99
100
|
//#endregion
|
|
100
|
-
export {
|
|
101
|
+
export { f as ConversationList };
|
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './conversation-thread.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { UserMessage as t } from "./user-message.js";
|
|
5
|
+
import { AssistantMessage as n } from "./assistant-message.js";
|
|
6
|
+
import { forwardRef as r, useEffect as i, useRef as a } from "react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
8
|
//#region src/stories/organisms/ConversationThread/ConversationThread.tsx
|
|
8
|
-
function
|
|
9
|
+
function c() {
|
|
9
10
|
return typeof window > "u" || typeof window.matchMedia != "function" || window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
|
|
10
11
|
}
|
|
11
|
-
var
|
|
12
|
-
let
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
}, [
|
|
16
|
-
ref:
|
|
17
|
-
className: `conversation-thread${
|
|
12
|
+
var l = r(function({ messages: r = [], children: l, streamingName: u, streamingLabel: d, ariaLabel: f, locale: p, timestampFormat: m, className: h, ...g }, _) {
|
|
13
|
+
let v = a(null), y = e("conversationThread");
|
|
14
|
+
return i(() => {
|
|
15
|
+
v.current?.scrollIntoView({ behavior: c() });
|
|
16
|
+
}, [r, l]), /* @__PURE__ */ s("div", {
|
|
17
|
+
ref: _,
|
|
18
|
+
className: `conversation-thread${h ? ` ${h}` : ""}`,
|
|
18
19
|
role: "log",
|
|
19
|
-
"aria-label":
|
|
20
|
-
"data-content":
|
|
21
|
-
...
|
|
22
|
-
children: [
|
|
23
|
-
timestamp:
|
|
24
|
-
locale:
|
|
25
|
-
timestampFormat:
|
|
26
|
-
children:
|
|
27
|
-
},
|
|
28
|
-
model:
|
|
29
|
-
timestamp:
|
|
30
|
-
locale:
|
|
31
|
-
timestampFormat:
|
|
32
|
-
isStreaming:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
"aria-label": y("label", f),
|
|
21
|
+
"data-content": l == null ? "messages" : "children",
|
|
22
|
+
...g,
|
|
23
|
+
children: [l ?? r.map((e) => e.role === "user" ? /* @__PURE__ */ o(t, {
|
|
24
|
+
timestamp: e.timestamp,
|
|
25
|
+
locale: p,
|
|
26
|
+
timestampFormat: m,
|
|
27
|
+
children: e.content
|
|
28
|
+
}, e.id) : /* @__PURE__ */ o(n, {
|
|
29
|
+
model: e.model,
|
|
30
|
+
timestamp: e.timestamp,
|
|
31
|
+
locale: p,
|
|
32
|
+
timestampFormat: m,
|
|
33
|
+
isStreaming: e.isStreaming,
|
|
34
|
+
streamingName: u,
|
|
35
|
+
streamingLabel: d,
|
|
36
|
+
children: e.content
|
|
37
|
+
}, e.id)), /* @__PURE__ */ o("div", {
|
|
38
|
+
ref: v,
|
|
37
39
|
"aria-hidden": "true"
|
|
38
40
|
})]
|
|
39
41
|
});
|
|
40
42
|
});
|
|
41
43
|
//#endregion
|
|
42
|
-
export {
|
|
44
|
+
export { l as ConversationThread };
|
package/dist/link.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where(button.link){appearance:none;font:inherit;text-align:inherit;color:inherit;background:0 0;border:0;margin:0;padding:0}a:where(:not(.button)),:where(.link){color:var(--link-color);box-shadow:inset 0 calc(-1 * var(--link-underline-width)) 0 0 currentColor;cursor:var(--link-cursor);
|
|
1
|
+
:where(button.link){appearance:none;font:inherit;text-align:inherit;color:inherit;background:0 0;border:0;margin:0;padding:0}a:where(:not(.button)),:where(.link){color:var(--link-color);box-shadow:inset 0 calc(-1 * var(--link-underline-width)) 0 0 currentColor;cursor:var(--link-cursor);padding-block-end:var(--link-underline-offset);text-decoration:none}:where(.link){inline-size:fit-content}a:where(:not(.button)):hover,:where(.link):hover{color:var(--link-hover-color);box-shadow:inset 0 calc(-1 * var(--link-hover-underline-width)) 0 0 currentColor}a:focus-visible,:where(.link):focus-visible{outline:var(--link-focus-ring-width) solid var(--link-focus-ring-color);outline-offset:var(--link-focus-ring-offset)}.link--with-icon{align-items:center;gap:var(--link-icon-gap);display:inline-flex}.link__icon{flex-shrink:0}.link--ink{color:var(--link-ink-color);box-shadow:inset 0 calc(-1 * var(--link-ink-underline-width)) 0 0 currentColor}.link--ink:hover{color:var(--link-ink-color);box-shadow:inset 0 calc(-1 * var(--link-ink-hover-underline-width)) 0 0 currentColor}.link--accent-1{color:var(--link-accent-1-color);box-shadow:inset 0 calc(-1 * var(--link-accent-1-underline-width)) 0 0 currentColor}.link--accent-1:hover{color:var(--link-accent-1-hover-color);box-shadow:inset 0 calc(-1 * var(--link-accent-1-hover-underline-width)) 0 0 currentColor}
|
package/dist/message-composer.js
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './message-composer.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Button as t } from "./button.js";
|
|
5
|
+
import { Textarea as n } from "./textarea.js";
|
|
6
|
+
import { forwardRef as r, useId as i } from "react";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
8
|
//#region src/stories/molecules/MessageComposer/MessageComposer.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
function
|
|
11
|
-
|
|
9
|
+
var s = r(function({ value: r, onChange: s, onSend: c, placeholder: l, disabled: u, sendLabel: d, helperText: f, actions: p, inputId: m, inputLabel: h, inputLabelledBy: g, rows: _ = 2, className: v, ...y }, b) {
|
|
10
|
+
let x = e("messageComposer"), S = `${i()}-helper`;
|
|
11
|
+
function C() {
|
|
12
|
+
r.trim() && c();
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
14
|
+
function w(e) {
|
|
15
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), C());
|
|
15
16
|
}
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
ref:
|
|
17
|
+
return /* @__PURE__ */ o("div", {
|
|
18
|
+
ref: b,
|
|
18
19
|
className: [
|
|
19
20
|
"message-composer",
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
u ? "message-composer--disabled" : "",
|
|
22
|
+
v ?? ""
|
|
22
23
|
].filter(Boolean).join(" "),
|
|
23
|
-
...
|
|
24
|
-
children: [/* @__PURE__ */
|
|
24
|
+
...y,
|
|
25
|
+
children: [/* @__PURE__ */ o("div", {
|
|
25
26
|
className: "message-composer__box",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ a(n, {
|
|
27
28
|
bare: !0,
|
|
28
29
|
className: "message-composer__input",
|
|
29
|
-
id:
|
|
30
|
-
"aria-label":
|
|
31
|
-
"aria-labelledby":
|
|
32
|
-
"aria-describedby":
|
|
33
|
-
placeholder:
|
|
34
|
-
value:
|
|
35
|
-
disabled:
|
|
36
|
-
rows:
|
|
37
|
-
onChange: (e) =>
|
|
38
|
-
onKeyDown:
|
|
39
|
-
}), /* @__PURE__ */
|
|
30
|
+
id: m,
|
|
31
|
+
"aria-label": h,
|
|
32
|
+
"aria-labelledby": g,
|
|
33
|
+
"aria-describedby": f ? S : void 0,
|
|
34
|
+
placeholder: x("placeholder", l),
|
|
35
|
+
value: r,
|
|
36
|
+
disabled: u,
|
|
37
|
+
rows: _,
|
|
38
|
+
onChange: (e) => s(e.target.value),
|
|
39
|
+
onKeyDown: w
|
|
40
|
+
}), /* @__PURE__ */ o("div", {
|
|
40
41
|
className: "message-composer__actions",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ a(t, {
|
|
42
43
|
variant: "primary",
|
|
43
44
|
size: "md",
|
|
44
|
-
disabled:
|
|
45
|
-
onClick:
|
|
46
|
-
children:
|
|
47
|
-
}),
|
|
45
|
+
disabled: u || !r.trim(),
|
|
46
|
+
onClick: C,
|
|
47
|
+
children: x("send", d)
|
|
48
|
+
}), p]
|
|
48
49
|
})]
|
|
49
|
-
}),
|
|
50
|
+
}), f && /* @__PURE__ */ a("p", {
|
|
50
51
|
className: "message-composer__helper",
|
|
51
|
-
id:
|
|
52
|
-
children:
|
|
52
|
+
id: S,
|
|
53
|
+
children: f
|
|
53
54
|
})]
|
|
54
55
|
});
|
|
55
56
|
});
|
|
56
57
|
//#endregion
|
|
57
|
-
export {
|
|
58
|
+
export { s as MessageComposer };
|
package/dist/typing-indicator.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import './typing-indicator.css';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { VisuallyHidden as t } from "./visually-hidden.js";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
6
|
//#region src/stories/atoms/TypingIndicator/TypingIndicator.tsx
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
+
function i({ name: i, label: a }) {
|
|
8
|
+
let o = e("typingIndicator");
|
|
9
|
+
return /* @__PURE__ */ r("span", {
|
|
7
10
|
className: "typing-indicator",
|
|
8
11
|
role: "status",
|
|
9
12
|
children: [
|
|
10
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ n("span", {
|
|
11
14
|
className: "typing-indicator__dot",
|
|
12
15
|
"aria-hidden": "true"
|
|
13
16
|
}),
|
|
14
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ n("span", {
|
|
15
18
|
className: "typing-indicator__dot",
|
|
16
19
|
"aria-hidden": "true"
|
|
17
20
|
}),
|
|
18
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ n("span", {
|
|
19
22
|
className: "typing-indicator__dot",
|
|
20
23
|
"aria-hidden": "true"
|
|
21
24
|
}),
|
|
22
|
-
/* @__PURE__ */ t
|
|
25
|
+
/* @__PURE__ */ n(t, { children: a ?? o("typing")(i) })
|
|
23
26
|
]
|
|
24
27
|
});
|
|
25
28
|
}
|
|
26
29
|
//#endregion
|
|
27
|
-
export {
|
|
30
|
+
export { i as TypingIndicator };
|