@wallarm-org/design-system 3.2.0 → 3.3.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/components/AnimatedBackground/blur/BlurBackground.d.ts +6 -0
- package/dist/components/AnimatedBackground/blur/BlurBackground.js +176 -76
- package/dist/components/AnimatedBackground/blur/index.d.ts +1 -1
- package/dist/components/AnimatedBackground/index.d.ts +1 -1
- package/dist/components/ApprovalCard/ApprovalCard.d.ts +13 -0
- package/dist/components/ApprovalCard/ApprovalCard.js +249 -0
- package/dist/components/ApprovalCard/ApprovalCardActions.d.ts +6 -0
- package/dist/components/ApprovalCard/ApprovalCardActions.js +50 -0
- package/dist/components/ApprovalCard/ApprovalCardContent.d.ts +6 -0
- package/dist/components/ApprovalCard/ApprovalCardContent.js +50 -0
- package/dist/components/ApprovalCard/classes.d.ts +10 -0
- package/dist/components/ApprovalCard/classes.js +26 -0
- package/dist/components/ApprovalCard/index.d.ts +3 -0
- package/dist/components/ApprovalCard/index.js +3 -0
- package/dist/components/AssistantMessage/AssistantMessage.d.ts +12 -0
- package/dist/components/AssistantMessage/AssistantMessage.js +66 -0
- package/dist/components/AssistantMessage/AssistantMessageContent.d.ts +10 -0
- package/dist/components/AssistantMessage/AssistantMessageContent.js +50 -0
- package/dist/components/AssistantMessage/AssistantMessageError.d.ts +13 -0
- package/dist/components/AssistantMessage/AssistantMessageError.js +93 -0
- package/dist/components/AssistantMessage/AssistantMessageLoader.d.ts +13 -0
- package/dist/components/AssistantMessage/AssistantMessageLoader.js +88 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdown.d.ts +71 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdown.js +278 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownCodeBlock.d.ts +17 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownCodeBlock.js +94 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownInlineCode.d.ts +10 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownInlineCode.js +59 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownLink.d.ts +14 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownLink.js +65 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownTable.d.ts +7 -0
- package/dist/components/AssistantMessage/AssistantMessageMarkdownTable.js +70 -0
- package/dist/components/AssistantMessage/classes.d.ts +38 -0
- package/dist/components/AssistantMessage/classes.js +46 -0
- package/dist/components/AssistantMessage/index.d.ts +9 -0
- package/dist/components/AssistantMessage/index.js +9 -0
- package/dist/components/AssistantMessage/lib/markdown.d.ts +20 -0
- package/dist/components/AssistantMessage/lib/markdown.js +51 -0
- package/dist/components/ChainOfThought/ChainOfThought.d.ts +10 -0
- package/dist/components/ChainOfThought/ChainOfThought.js +66 -0
- package/dist/components/ChainOfThought/ChainOfThoughtStep.d.ts +31 -0
- package/dist/components/ChainOfThought/ChainOfThoughtStep.js +312 -0
- package/dist/components/ChainOfThought/classes.d.ts +20 -0
- package/dist/components/ChainOfThought/classes.js +84 -0
- package/dist/components/ChainOfThought/index.d.ts +2 -0
- package/dist/components/ChainOfThought/index.js +2 -0
- package/dist/components/Chat/Chat.d.ts +12 -0
- package/dist/components/Chat/Chat.js +90 -0
- package/dist/components/Chat/ChatBody.d.ts +12 -0
- package/dist/components/Chat/ChatBody.js +52 -0
- package/dist/components/Chat/ChatFooter.d.ts +7 -0
- package/dist/components/Chat/ChatFooter.js +50 -0
- package/dist/components/Chat/ChatGreeting.d.ts +8 -0
- package/dist/components/Chat/ChatGreeting.js +94 -0
- package/dist/components/Chat/ChatHeader.d.ts +6 -0
- package/dist/components/Chat/ChatHeader.js +50 -0
- package/dist/components/Chat/ChatHeaderActions.d.ts +7 -0
- package/dist/components/Chat/ChatHeaderActions.js +50 -0
- package/dist/components/Chat/ChatHeaderTitle.d.ts +12 -0
- package/dist/components/Chat/ChatHeaderTitle.js +99 -0
- package/dist/components/Chat/ChatSuggestion.d.ts +7 -0
- package/dist/components/Chat/ChatSuggestion.js +56 -0
- package/dist/components/Chat/ChatSuggestions.d.ts +14 -0
- package/dist/components/Chat/ChatSuggestions.js +111 -0
- package/dist/components/Chat/ChatSuggestionsContext.d.ts +7 -0
- package/dist/components/Chat/ChatSuggestionsContext.js +7 -0
- package/dist/components/Chat/ChatTrigger.d.ts +13 -0
- package/dist/components/Chat/ChatTrigger.js +101 -0
- package/dist/components/Chat/classes.d.ts +17 -0
- package/dist/components/Chat/classes.js +44 -0
- package/dist/components/Chat/index.d.ts +10 -0
- package/dist/components/Chat/index.js +10 -0
- package/dist/components/ChatInput/ChatInput.d.ts +30 -0
- package/dist/components/ChatInput/ChatInput.js +230 -0
- package/dist/components/ChatInput/ChatInputContext.d.ts +11 -0
- package/dist/components/ChatInput/ChatInputContext.js +8 -0
- package/dist/components/ChatInput/ChatInputSubmit.d.ts +10 -0
- package/dist/components/ChatInput/ChatInputSubmit.js +175 -0
- package/dist/components/ChatInput/ChatInputTextarea.d.ts +6 -0
- package/dist/components/ChatInput/ChatInputTextarea.js +155 -0
- package/dist/components/ChatInput/classes.d.ts +9 -0
- package/dist/components/ChatInput/classes.js +22 -0
- package/dist/components/ChatInput/index.d.ts +3 -0
- package/dist/components/ChatInput/index.js +3 -0
- package/dist/components/ChatPermissions/ChatPermissions.d.ts +12 -0
- package/dist/components/ChatPermissions/ChatPermissions.js +66 -0
- package/dist/components/ChatPermissions/ChatPermissionsContent.d.ts +7 -0
- package/dist/components/ChatPermissions/ChatPermissionsContent.js +73 -0
- package/dist/components/ChatPermissions/ChatPermissionsContext.d.ts +7 -0
- package/dist/components/ChatPermissions/ChatPermissionsContext.js +8 -0
- package/dist/components/ChatPermissions/ChatPermissionsItem.d.ts +17 -0
- package/dist/components/ChatPermissions/ChatPermissionsItem.js +115 -0
- package/dist/components/ChatPermissions/ChatPermissionsTrigger.d.ts +6 -0
- package/dist/components/ChatPermissions/ChatPermissionsTrigger.js +110 -0
- package/dist/components/ChatPermissions/classes.d.ts +3 -0
- package/dist/components/ChatPermissions/classes.js +5 -0
- package/dist/components/ChatPermissions/index.d.ts +4 -0
- package/dist/components/ChatPermissions/index.js +4 -0
- package/dist/components/Conversation/Conversation.d.ts +19 -0
- package/dist/components/Conversation/Conversation.js +102 -0
- package/dist/components/Conversation/ConversationContent.d.ts +11 -0
- package/dist/components/Conversation/ConversationContent.js +103 -0
- package/dist/components/Conversation/ConversationContext.d.ts +14 -0
- package/dist/components/Conversation/ConversationContext.js +8 -0
- package/dist/components/Conversation/ConversationEmptyState.d.ts +15 -0
- package/dist/components/Conversation/ConversationEmptyState.js +70 -0
- package/dist/components/Conversation/ConversationScrollButton.d.ts +13 -0
- package/dist/components/Conversation/ConversationScrollButton.js +138 -0
- package/dist/components/Conversation/classes.d.ts +13 -0
- package/dist/components/Conversation/classes.js +8 -0
- package/dist/components/Conversation/index.d.ts +4 -0
- package/dist/components/Conversation/index.js +4 -0
- package/dist/components/Conversation/useStickToBottom.d.ts +9 -0
- package/dist/components/Conversation/useStickToBottom.js +203 -0
- package/dist/components/MessageActions/MessageAction.d.ts +18 -0
- package/dist/components/MessageActions/MessageAction.js +109 -0
- package/dist/components/MessageActions/MessageActions.d.ts +12 -0
- package/dist/components/MessageActions/MessageActions.js +74 -0
- package/dist/components/MessageActions/MessageTimestamp.d.ts +7 -0
- package/dist/components/MessageActions/MessageTimestamp.js +50 -0
- package/dist/components/MessageActions/classes.d.ts +5 -0
- package/dist/components/MessageActions/classes.js +15 -0
- package/dist/components/MessageActions/index.d.ts +3 -0
- package/dist/components/MessageActions/index.js +3 -0
- package/dist/components/Popover/PopoverContent.d.ts +2 -1
- package/dist/components/Popover/PopoverContent.js +42 -39
- package/dist/components/UserMessage/UserMessage.d.ts +10 -0
- package/dist/components/UserMessage/UserMessage.js +66 -0
- package/dist/components/UserMessage/UserMessageBubble.d.ts +16 -0
- package/dist/components/UserMessage/UserMessageBubble.js +175 -0
- package/dist/components/UserMessage/UserMessageContext.d.ts +9 -0
- package/dist/components/UserMessage/UserMessageContext.js +4 -0
- package/dist/components/UserMessage/UserMessageShowMore.d.ts +15 -0
- package/dist/components/UserMessage/UserMessageShowMore.js +87 -0
- package/dist/components/UserMessage/classes.d.ts +11 -0
- package/dist/components/UserMessage/classes.js +32 -0
- package/dist/components/UserMessage/index.d.ts +3 -0
- package/dist/components/UserMessage/index.js +3 -0
- package/dist/components/WallyAssistant/WallyAssistant.d.ts +56 -0
- package/dist/components/WallyAssistant/WallyAssistant.js +541 -0
- package/dist/components/WallyAssistant/index.d.ts +10 -0
- package/dist/components/WallyAssistant/index.js +8 -0
- package/dist/components/WallyAssistant/model/deriveChatState.d.ts +33 -0
- package/dist/components/WallyAssistant/model/deriveChatState.js +54 -0
- package/dist/components/WallyAssistant/model/labels.d.ts +43 -0
- package/dist/components/WallyAssistant/model/labels.js +33 -0
- package/dist/components/WallyAssistant/model/model.d.ts +184 -0
- package/dist/components/WallyAssistant/model/model.js +0 -0
- package/dist/components/WallyAssistant/views/ApprovalCardView.d.ts +20 -0
- package/dist/components/WallyAssistant/views/ApprovalCardView.js +274 -0
- package/dist/components/WallyAssistant/views/ChainOfThoughtView.d.ts +18 -0
- package/dist/components/WallyAssistant/views/ChainOfThoughtView.js +301 -0
- package/dist/components/WallyAssistant/views/ChatMessageView.d.ts +15 -0
- package/dist/components/WallyAssistant/views/ChatMessageView.js +372 -0
- package/dist/components/WallyAssistant/views/ChatPartView.d.ts +16 -0
- package/dist/components/WallyAssistant/views/ChatPartView.js +171 -0
- package/dist/components/WallyAssistant/views/ChatViewContext.d.ts +98 -0
- package/dist/components/WallyAssistant/views/ChatViewContext.js +44 -0
- package/dist/components/WallyAssistant/views/ChatViewProvider.d.ts +18 -0
- package/dist/components/WallyAssistant/views/ChatViewProvider.js +96 -0
- package/dist/components/WallyAssistant/views/stepIcons.d.ts +8 -0
- package/dist/components/WallyAssistant/views/stepIcons.js +47 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/metadata/components.json +30786 -15960
- package/dist/theme/components/animated-background.css +6 -1
- package/dist/theme/index.css +1 -0
- package/dist/theme/utilities/shimmer-text.css +27 -0
- package/package.json +3 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
export type ChatBackground = 'strong' | 'subtle' | 'none';
|
|
4
|
+
export interface ChatProps extends HTMLAttributes<HTMLElement>, TestableProps {
|
|
5
|
+
ref?: Ref<HTMLElement>;
|
|
6
|
+
/**
|
|
7
|
+
* Decorative mesh behind the panel (Figma chat-bg 67:1254). `'strong'` is Main (12%, for an
|
|
8
|
+
* empty chat), `'subtle'` is Chat (5%, for a running conversation), `'none'` renders nothing.
|
|
9
|
+
*/
|
|
10
|
+
background?: ChatBackground;
|
|
11
|
+
}
|
|
12
|
+
export declare const Chat: FC<ChatProps>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { TestIdProvider } from "../../utils/testId.js";
|
|
5
|
+
import { BlurBackground } from "../AnimatedBackground/blur/index.js";
|
|
6
|
+
import { chatBackgroundVariants, chatVariants } from "./classes.js";
|
|
7
|
+
const Chat = (t0)=>{
|
|
8
|
+
const $ = c(21);
|
|
9
|
+
let children;
|
|
10
|
+
let className;
|
|
11
|
+
let props;
|
|
12
|
+
let ref;
|
|
13
|
+
let t1;
|
|
14
|
+
let testId;
|
|
15
|
+
if ($[0] !== t0) {
|
|
16
|
+
({ ref, background: t1, className, children, "data-testid": testId, ...props } = t0);
|
|
17
|
+
$[0] = t0;
|
|
18
|
+
$[1] = children;
|
|
19
|
+
$[2] = className;
|
|
20
|
+
$[3] = props;
|
|
21
|
+
$[4] = ref;
|
|
22
|
+
$[5] = t1;
|
|
23
|
+
$[6] = testId;
|
|
24
|
+
} else {
|
|
25
|
+
children = $[1];
|
|
26
|
+
className = $[2];
|
|
27
|
+
props = $[3];
|
|
28
|
+
ref = $[4];
|
|
29
|
+
t1 = $[5];
|
|
30
|
+
testId = $[6];
|
|
31
|
+
}
|
|
32
|
+
const background = void 0 === t1 ? "subtle" : t1;
|
|
33
|
+
let t2;
|
|
34
|
+
if ($[7] !== className) {
|
|
35
|
+
t2 = cn(chatVariants(), className);
|
|
36
|
+
$[7] = className;
|
|
37
|
+
$[8] = t2;
|
|
38
|
+
} else t2 = $[8];
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[9] !== background) {
|
|
41
|
+
t3 = "none" !== background && /*#__PURE__*/ jsx("div", {
|
|
42
|
+
"aria-hidden": true,
|
|
43
|
+
"data-slot": "chat-background",
|
|
44
|
+
className: chatBackgroundVariants({
|
|
45
|
+
background
|
|
46
|
+
}),
|
|
47
|
+
children: /*#__PURE__*/ jsx(BlurBackground, {
|
|
48
|
+
palette: "chat",
|
|
49
|
+
className: "size-full [--lg-frame-bg:transparent]"
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
$[9] = background;
|
|
53
|
+
$[10] = t3;
|
|
54
|
+
} else t3 = $[10];
|
|
55
|
+
let t4;
|
|
56
|
+
if ($[11] !== children || $[12] !== testId) {
|
|
57
|
+
t4 = /*#__PURE__*/ jsx(TestIdProvider, {
|
|
58
|
+
value: testId,
|
|
59
|
+
children: children
|
|
60
|
+
});
|
|
61
|
+
$[11] = children;
|
|
62
|
+
$[12] = testId;
|
|
63
|
+
$[13] = t4;
|
|
64
|
+
} else t4 = $[13];
|
|
65
|
+
let t5;
|
|
66
|
+
if ($[14] !== props || $[15] !== ref || $[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== testId) {
|
|
67
|
+
t5 = /*#__PURE__*/ jsxs("section", {
|
|
68
|
+
"aria-label": "Wally chat",
|
|
69
|
+
...props,
|
|
70
|
+
ref: ref,
|
|
71
|
+
"data-slot": "chat",
|
|
72
|
+
"data-testid": testId,
|
|
73
|
+
className: t2,
|
|
74
|
+
children: [
|
|
75
|
+
t3,
|
|
76
|
+
t4
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
$[14] = props;
|
|
80
|
+
$[15] = ref;
|
|
81
|
+
$[16] = t2;
|
|
82
|
+
$[17] = t3;
|
|
83
|
+
$[18] = t4;
|
|
84
|
+
$[19] = testId;
|
|
85
|
+
$[20] = t5;
|
|
86
|
+
} else t5 = $[20];
|
|
87
|
+
return t5;
|
|
88
|
+
};
|
|
89
|
+
Chat.displayName = "Chat";
|
|
90
|
+
export { Chat };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
/**
|
|
4
|
+
* The scrolling message log. Pass `aria-busy={isRunning}` while the assistant streams, and
|
|
5
|
+
* attach stick-to-bottom behaviour through `ref` (it lands on the scroll element).
|
|
6
|
+
*
|
|
7
|
+
* For stick-to-bottom and a scroll button use `Conversation`; `ConversationContent` renders ChatBody.
|
|
8
|
+
*/
|
|
9
|
+
export interface ChatBodyProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
10
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
|
+
}
|
|
12
|
+
export declare const ChatBody: FC<ChatBodyProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { chatBodyVariants } from "./classes.js";
|
|
6
|
+
const ChatBody = (t0)=>{
|
|
7
|
+
const $ = c(12);
|
|
8
|
+
let className;
|
|
9
|
+
let props;
|
|
10
|
+
let ref;
|
|
11
|
+
let testIdProp;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({ ref, className, "data-testid": testIdProp, ...props } = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
$[3] = ref;
|
|
18
|
+
$[4] = testIdProp;
|
|
19
|
+
} else {
|
|
20
|
+
className = $[1];
|
|
21
|
+
props = $[2];
|
|
22
|
+
ref = $[3];
|
|
23
|
+
testIdProp = $[4];
|
|
24
|
+
}
|
|
25
|
+
const testId = useTestId("body", testIdProp);
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[5] !== className) {
|
|
28
|
+
t1 = cn(chatBodyVariants(), className);
|
|
29
|
+
$[5] = className;
|
|
30
|
+
$[6] = t1;
|
|
31
|
+
} else t1 = $[6];
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[7] !== props || $[8] !== ref || $[9] !== t1 || $[10] !== testId) {
|
|
34
|
+
t2 = /*#__PURE__*/ jsx("div", {
|
|
35
|
+
role: "log",
|
|
36
|
+
"aria-label": "Chat messages",
|
|
37
|
+
...props,
|
|
38
|
+
ref: ref,
|
|
39
|
+
"data-slot": "chat-body",
|
|
40
|
+
"data-testid": testId,
|
|
41
|
+
className: t1
|
|
42
|
+
});
|
|
43
|
+
$[7] = props;
|
|
44
|
+
$[8] = ref;
|
|
45
|
+
$[9] = t1;
|
|
46
|
+
$[10] = testId;
|
|
47
|
+
$[11] = t2;
|
|
48
|
+
} else t2 = $[11];
|
|
49
|
+
return t2;
|
|
50
|
+
};
|
|
51
|
+
ChatBody.displayName = "ChatBody";
|
|
52
|
+
export { ChatBody };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
/** Bottom gutter for suggestions, a docked approval card and the input. */
|
|
4
|
+
export interface ChatFooterProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
5
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChatFooter: FC<ChatFooterProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { chatFooterVariants } from "./classes.js";
|
|
6
|
+
const ChatFooter = (t0)=>{
|
|
7
|
+
const $ = c(12);
|
|
8
|
+
let className;
|
|
9
|
+
let props;
|
|
10
|
+
let ref;
|
|
11
|
+
let testIdProp;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({ ref, className, "data-testid": testIdProp, ...props } = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
$[3] = ref;
|
|
18
|
+
$[4] = testIdProp;
|
|
19
|
+
} else {
|
|
20
|
+
className = $[1];
|
|
21
|
+
props = $[2];
|
|
22
|
+
ref = $[3];
|
|
23
|
+
testIdProp = $[4];
|
|
24
|
+
}
|
|
25
|
+
const testId = useTestId("footer", testIdProp);
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[5] !== className) {
|
|
28
|
+
t1 = cn(chatFooterVariants(), className);
|
|
29
|
+
$[5] = className;
|
|
30
|
+
$[6] = t1;
|
|
31
|
+
} else t1 = $[6];
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[7] !== props || $[8] !== ref || $[9] !== t1 || $[10] !== testId) {
|
|
34
|
+
t2 = /*#__PURE__*/ jsx("div", {
|
|
35
|
+
...props,
|
|
36
|
+
ref: ref,
|
|
37
|
+
"data-slot": "chat-footer",
|
|
38
|
+
"data-testid": testId,
|
|
39
|
+
className: t1
|
|
40
|
+
});
|
|
41
|
+
$[7] = props;
|
|
42
|
+
$[8] = ref;
|
|
43
|
+
$[9] = t1;
|
|
44
|
+
$[10] = testId;
|
|
45
|
+
$[11] = t2;
|
|
46
|
+
} else t2 = $[11];
|
|
47
|
+
return t2;
|
|
48
|
+
};
|
|
49
|
+
ChatFooter.displayName = "ChatFooter";
|
|
50
|
+
export { ChatFooter };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
export interface ChatGreetingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, TestableProps {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
/** Heading under the Wally mark, e.g. "How can I help you today?". */
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const ChatGreeting: FC<ChatGreetingProps>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { Text } from "../Text/index.js";
|
|
6
|
+
import { WallyIcon } from "../WallyIcon/index.js";
|
|
7
|
+
import { chatGreetingVariants } from "./classes.js";
|
|
8
|
+
const ChatGreeting = (t0)=>{
|
|
9
|
+
const $ = c(19);
|
|
10
|
+
let children;
|
|
11
|
+
let className;
|
|
12
|
+
let props;
|
|
13
|
+
let ref;
|
|
14
|
+
let testIdProp;
|
|
15
|
+
let title;
|
|
16
|
+
if ($[0] !== t0) {
|
|
17
|
+
({ ref, title, className, children, "data-testid": testIdProp, ...props } = t0);
|
|
18
|
+
$[0] = t0;
|
|
19
|
+
$[1] = children;
|
|
20
|
+
$[2] = className;
|
|
21
|
+
$[3] = props;
|
|
22
|
+
$[4] = ref;
|
|
23
|
+
$[5] = testIdProp;
|
|
24
|
+
$[6] = title;
|
|
25
|
+
} else {
|
|
26
|
+
children = $[1];
|
|
27
|
+
className = $[2];
|
|
28
|
+
props = $[3];
|
|
29
|
+
ref = $[4];
|
|
30
|
+
testIdProp = $[5];
|
|
31
|
+
title = $[6];
|
|
32
|
+
}
|
|
33
|
+
const testId = useTestId("greeting", testIdProp);
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[7] !== className) {
|
|
36
|
+
t1 = cn(chatGreetingVariants(), className);
|
|
37
|
+
$[7] = className;
|
|
38
|
+
$[8] = t1;
|
|
39
|
+
} else t1 = $[8];
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t2 = /*#__PURE__*/ jsx(WallyIcon, {
|
|
43
|
+
variant: "circle",
|
|
44
|
+
size: "xl",
|
|
45
|
+
"aria-hidden": true
|
|
46
|
+
});
|
|
47
|
+
$[9] = t2;
|
|
48
|
+
} else t2 = $[9];
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[10] !== title) {
|
|
51
|
+
t3 = /*#__PURE__*/ jsxs("div", {
|
|
52
|
+
className: "flex flex-col items-center gap-12",
|
|
53
|
+
children: [
|
|
54
|
+
t2,
|
|
55
|
+
/*#__PURE__*/ jsx(Text, {
|
|
56
|
+
asChild: true,
|
|
57
|
+
size: "xl",
|
|
58
|
+
weight: "medium",
|
|
59
|
+
color: "primary",
|
|
60
|
+
align: "center",
|
|
61
|
+
children: /*#__PURE__*/ jsx("h2", {
|
|
62
|
+
children: title
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
$[10] = title;
|
|
68
|
+
$[11] = t3;
|
|
69
|
+
} else t3 = $[11];
|
|
70
|
+
let t4;
|
|
71
|
+
if ($[12] !== children || $[13] !== props || $[14] !== ref || $[15] !== t1 || $[16] !== t3 || $[17] !== testId) {
|
|
72
|
+
t4 = /*#__PURE__*/ jsxs("div", {
|
|
73
|
+
...props,
|
|
74
|
+
ref: ref,
|
|
75
|
+
"data-slot": "chat-greeting",
|
|
76
|
+
"data-testid": testId,
|
|
77
|
+
className: t1,
|
|
78
|
+
children: [
|
|
79
|
+
t3,
|
|
80
|
+
children
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
$[12] = children;
|
|
84
|
+
$[13] = props;
|
|
85
|
+
$[14] = ref;
|
|
86
|
+
$[15] = t1;
|
|
87
|
+
$[16] = t3;
|
|
88
|
+
$[17] = testId;
|
|
89
|
+
$[18] = t4;
|
|
90
|
+
} else t4 = $[18];
|
|
91
|
+
return t4;
|
|
92
|
+
};
|
|
93
|
+
ChatGreeting.displayName = "ChatGreeting";
|
|
94
|
+
export { ChatGreeting };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
export interface ChatHeaderProps extends HTMLAttributes<HTMLElement>, TestableProps {
|
|
4
|
+
ref?: Ref<HTMLElement>;
|
|
5
|
+
}
|
|
6
|
+
export declare const ChatHeader: FC<ChatHeaderProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { chatHeaderVariants } from "./classes.js";
|
|
6
|
+
const ChatHeader = (t0)=>{
|
|
7
|
+
const $ = c(12);
|
|
8
|
+
let className;
|
|
9
|
+
let props;
|
|
10
|
+
let ref;
|
|
11
|
+
let testIdProp;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({ ref, className, "data-testid": testIdProp, ...props } = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
$[3] = ref;
|
|
18
|
+
$[4] = testIdProp;
|
|
19
|
+
} else {
|
|
20
|
+
className = $[1];
|
|
21
|
+
props = $[2];
|
|
22
|
+
ref = $[3];
|
|
23
|
+
testIdProp = $[4];
|
|
24
|
+
}
|
|
25
|
+
const testId = useTestId("header", testIdProp);
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[5] !== className) {
|
|
28
|
+
t1 = cn(chatHeaderVariants(), className);
|
|
29
|
+
$[5] = className;
|
|
30
|
+
$[6] = t1;
|
|
31
|
+
} else t1 = $[6];
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[7] !== props || $[8] !== ref || $[9] !== t1 || $[10] !== testId) {
|
|
34
|
+
t2 = /*#__PURE__*/ jsx("header", {
|
|
35
|
+
...props,
|
|
36
|
+
ref: ref,
|
|
37
|
+
"data-slot": "chat-header",
|
|
38
|
+
"data-testid": testId,
|
|
39
|
+
className: t1
|
|
40
|
+
});
|
|
41
|
+
$[7] = props;
|
|
42
|
+
$[8] = ref;
|
|
43
|
+
$[9] = t1;
|
|
44
|
+
$[10] = testId;
|
|
45
|
+
$[11] = t2;
|
|
46
|
+
} else t2 = $[11];
|
|
47
|
+
return t2;
|
|
48
|
+
};
|
|
49
|
+
ChatHeader.displayName = "ChatHeader";
|
|
50
|
+
export { ChatHeader };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
/** Trailing header slot (Figma 8:3078 / 44:1517): ghost icon buttons and vertical separators. */
|
|
4
|
+
export interface ChatHeaderActionsProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
5
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChatHeaderActions: FC<ChatHeaderActionsProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { chatHeaderActionsVariants } from "./classes.js";
|
|
6
|
+
const ChatHeaderActions = (t0)=>{
|
|
7
|
+
const $ = c(12);
|
|
8
|
+
let className;
|
|
9
|
+
let props;
|
|
10
|
+
let ref;
|
|
11
|
+
let testIdProp;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({ ref, className, "data-testid": testIdProp, ...props } = t0);
|
|
14
|
+
$[0] = t0;
|
|
15
|
+
$[1] = className;
|
|
16
|
+
$[2] = props;
|
|
17
|
+
$[3] = ref;
|
|
18
|
+
$[4] = testIdProp;
|
|
19
|
+
} else {
|
|
20
|
+
className = $[1];
|
|
21
|
+
props = $[2];
|
|
22
|
+
ref = $[3];
|
|
23
|
+
testIdProp = $[4];
|
|
24
|
+
}
|
|
25
|
+
const testId = useTestId("actions", testIdProp);
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[5] !== className) {
|
|
28
|
+
t1 = cn(chatHeaderActionsVariants(), className);
|
|
29
|
+
$[5] = className;
|
|
30
|
+
$[6] = t1;
|
|
31
|
+
} else t1 = $[6];
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[7] !== props || $[8] !== ref || $[9] !== t1 || $[10] !== testId) {
|
|
34
|
+
t2 = /*#__PURE__*/ jsx("div", {
|
|
35
|
+
...props,
|
|
36
|
+
ref: ref,
|
|
37
|
+
"data-slot": "chat-header-actions",
|
|
38
|
+
"data-testid": testId,
|
|
39
|
+
className: t1
|
|
40
|
+
});
|
|
41
|
+
$[7] = props;
|
|
42
|
+
$[8] = ref;
|
|
43
|
+
$[9] = t1;
|
|
44
|
+
$[10] = testId;
|
|
45
|
+
$[11] = t2;
|
|
46
|
+
} else t2 = $[11];
|
|
47
|
+
return t2;
|
|
48
|
+
};
|
|
49
|
+
ChatHeaderActions.displayName = "ChatHeaderActions";
|
|
50
|
+
export { ChatHeaderActions };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
/**
|
|
4
|
+
* Without children: the Figma Default title, "Ask Wally". With children (e.g. a thread `Select`):
|
|
5
|
+
* Figma Variant2, the Wally mark, a "/" joint, then the children.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChatHeaderTitleProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
|
+
/** The title shown when there are no children (e.g. a translation). Default: "Ask Wally". */
|
|
10
|
+
label?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const ChatHeaderTitle: FC<ChatHeaderTitleProps>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { WallyIcon } from "../WallyIcon/index.js";
|
|
6
|
+
import { chatHeaderTitleVariants } from "./classes.js";
|
|
7
|
+
const ChatHeaderTitle = (t0)=>{
|
|
8
|
+
const $ = c(19);
|
|
9
|
+
let children;
|
|
10
|
+
let className;
|
|
11
|
+
let label;
|
|
12
|
+
let props;
|
|
13
|
+
let ref;
|
|
14
|
+
let testIdProp;
|
|
15
|
+
if ($[0] !== t0) {
|
|
16
|
+
({ ref, className, children, label, "data-testid": testIdProp, ...props } = t0);
|
|
17
|
+
$[0] = t0;
|
|
18
|
+
$[1] = children;
|
|
19
|
+
$[2] = className;
|
|
20
|
+
$[3] = label;
|
|
21
|
+
$[4] = props;
|
|
22
|
+
$[5] = ref;
|
|
23
|
+
$[6] = testIdProp;
|
|
24
|
+
} else {
|
|
25
|
+
children = $[1];
|
|
26
|
+
className = $[2];
|
|
27
|
+
label = $[3];
|
|
28
|
+
props = $[4];
|
|
29
|
+
ref = $[5];
|
|
30
|
+
testIdProp = $[6];
|
|
31
|
+
}
|
|
32
|
+
const testId = useTestId("title", testIdProp);
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[7] !== className) {
|
|
35
|
+
t1 = cn(chatHeaderTitleVariants(), className);
|
|
36
|
+
$[7] = className;
|
|
37
|
+
$[8] = t1;
|
|
38
|
+
} else t1 = $[8];
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
+
t2 = /*#__PURE__*/ jsx(WallyIcon, {
|
|
42
|
+
variant: "simple",
|
|
43
|
+
size: "md",
|
|
44
|
+
"aria-hidden": true,
|
|
45
|
+
className: "shrink-0"
|
|
46
|
+
});
|
|
47
|
+
$[9] = t2;
|
|
48
|
+
} else t2 = $[9];
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[10] !== children || $[11] !== label) {
|
|
51
|
+
t3 = null == children ? /*#__PURE__*/ jsx("span", {
|
|
52
|
+
className: "ml-8 truncate text-sm text-text-primary",
|
|
53
|
+
children: label ?? /*#__PURE__*/ jsxs(Fragment, {
|
|
54
|
+
children: [
|
|
55
|
+
"Ask ",
|
|
56
|
+
/*#__PURE__*/ jsx("span", {
|
|
57
|
+
className: "font-mono font-medium text-text-brand",
|
|
58
|
+
children: "Wally"
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ jsx("span", {
|
|
65
|
+
"aria-hidden": true,
|
|
66
|
+
className: "pl-12 pr-4 text-sm font-medium text-text-secondary",
|
|
67
|
+
children: "/"
|
|
68
|
+
}),
|
|
69
|
+
children
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
$[10] = children;
|
|
73
|
+
$[11] = label;
|
|
74
|
+
$[12] = t3;
|
|
75
|
+
} else t3 = $[12];
|
|
76
|
+
let t4;
|
|
77
|
+
if ($[13] !== props || $[14] !== ref || $[15] !== t1 || $[16] !== t3 || $[17] !== testId) {
|
|
78
|
+
t4 = /*#__PURE__*/ jsxs("div", {
|
|
79
|
+
...props,
|
|
80
|
+
ref: ref,
|
|
81
|
+
"data-slot": "chat-header-title",
|
|
82
|
+
"data-testid": testId,
|
|
83
|
+
className: t1,
|
|
84
|
+
children: [
|
|
85
|
+
t2,
|
|
86
|
+
t3
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
$[13] = props;
|
|
90
|
+
$[14] = ref;
|
|
91
|
+
$[15] = t1;
|
|
92
|
+
$[16] = t3;
|
|
93
|
+
$[17] = testId;
|
|
94
|
+
$[18] = t4;
|
|
95
|
+
} else t4 = $[18];
|
|
96
|
+
return t4;
|
|
97
|
+
};
|
|
98
|
+
ChatHeaderTitle.displayName = "ChatHeaderTitle";
|
|
99
|
+
export { ChatHeaderTitle };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, FC, Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
/** A suggested prompt pill. Sized by its `ChatSuggestions` placement (Medium when standalone). */
|
|
4
|
+
export interface ChatSuggestionProps extends ButtonHTMLAttributes<HTMLButtonElement>, TestableProps {
|
|
5
|
+
ref?: Ref<HTMLButtonElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const ChatSuggestion: FC<ChatSuggestionProps>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { useChatSuggestionsContext } from "./ChatSuggestionsContext.js";
|
|
6
|
+
import { chatSuggestionVariants } from "./classes.js";
|
|
7
|
+
const ChatSuggestion = (t0)=>{
|
|
8
|
+
const $ = c(13);
|
|
9
|
+
let className;
|
|
10
|
+
let props;
|
|
11
|
+
let ref;
|
|
12
|
+
let testIdProp;
|
|
13
|
+
if ($[0] !== t0) {
|
|
14
|
+
({ ref, className, "data-testid": testIdProp, ...props } = t0);
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
$[1] = className;
|
|
17
|
+
$[2] = props;
|
|
18
|
+
$[3] = ref;
|
|
19
|
+
$[4] = testIdProp;
|
|
20
|
+
} else {
|
|
21
|
+
className = $[1];
|
|
22
|
+
props = $[2];
|
|
23
|
+
ref = $[3];
|
|
24
|
+
testIdProp = $[4];
|
|
25
|
+
}
|
|
26
|
+
const testId = useTestId("suggestion", testIdProp);
|
|
27
|
+
const { size } = useChatSuggestionsContext();
|
|
28
|
+
let t1;
|
|
29
|
+
if ($[5] !== className || $[6] !== size) {
|
|
30
|
+
t1 = cn(chatSuggestionVariants({
|
|
31
|
+
size
|
|
32
|
+
}), className);
|
|
33
|
+
$[5] = className;
|
|
34
|
+
$[6] = size;
|
|
35
|
+
$[7] = t1;
|
|
36
|
+
} else t1 = $[7];
|
|
37
|
+
let t2;
|
|
38
|
+
if ($[8] !== props || $[9] !== ref || $[10] !== t1 || $[11] !== testId) {
|
|
39
|
+
t2 = /*#__PURE__*/ jsx("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
...props,
|
|
42
|
+
ref: ref,
|
|
43
|
+
"data-slot": "chat-suggestion",
|
|
44
|
+
"data-testid": testId,
|
|
45
|
+
className: t1
|
|
46
|
+
});
|
|
47
|
+
$[8] = props;
|
|
48
|
+
$[9] = ref;
|
|
49
|
+
$[10] = t1;
|
|
50
|
+
$[11] = testId;
|
|
51
|
+
$[12] = t2;
|
|
52
|
+
} else t2 = $[12];
|
|
53
|
+
return t2;
|
|
54
|
+
};
|
|
55
|
+
ChatSuggestion.displayName = "ChatSuggestion";
|
|
56
|
+
export { ChatSuggestion };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FC, type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
3
|
+
export type ChatSuggestionsPlacement = 'footer' | 'greeting';
|
|
4
|
+
export interface ChatSuggestionsProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
|
|
5
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
|
+
/**
|
|
7
|
+
* `'footer'` (default, Figma 91:1167): right-aligned Medium pills above the input.
|
|
8
|
+
* `'greeting'` (Figma 44:1706): centered Large pills under the greeting.
|
|
9
|
+
*/
|
|
10
|
+
placement?: ChatSuggestionsPlacement;
|
|
11
|
+
/** Visible label (Figma "Suggestions"); also becomes the group's accessible name. */
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const ChatSuggestions: FC<ChatSuggestionsProps>;
|