@copilotkit/react-ui 0.15.0-alpha.0 → 0.15.0-alpha.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/.turbo/turbo-build.log +196 -209
- package/CHANGELOG.md +27 -1
- package/dist/chunk-3M4HWSE7.mjs +61 -0
- package/dist/chunk-3M4HWSE7.mjs.map +1 -0
- package/dist/chunk-47SYBLI2.mjs +110 -0
- package/dist/chunk-47SYBLI2.mjs.map +1 -0
- package/dist/chunk-5O2MCJZ2.mjs +21 -0
- package/dist/chunk-5O2MCJZ2.mjs.map +1 -0
- package/dist/chunk-7YXG7D47.mjs +191 -0
- package/dist/chunk-7YXG7D47.mjs.map +1 -0
- package/dist/chunk-CKJXXQ2W.mjs +26 -0
- package/dist/chunk-CKJXXQ2W.mjs.map +1 -0
- package/dist/{chunk-6LAZQHEB.mjs → chunk-DPRH4HX3.mjs} +18 -43
- package/dist/chunk-DPRH4HX3.mjs.map +1 -0
- package/dist/chunk-GWGHQNRI.mjs +54 -0
- package/dist/chunk-GWGHQNRI.mjs.map +1 -0
- package/dist/chunk-JD7BAH7U.mjs +3 -0
- package/dist/chunk-KBGIPFXA.mjs +14 -0
- package/dist/chunk-KBGIPFXA.mjs.map +1 -0
- package/dist/chunk-NNVWLSYK.mjs +72 -0
- package/dist/chunk-NNVWLSYK.mjs.map +1 -0
- package/dist/chunk-NYLOXKYT.mjs +51 -0
- package/dist/chunk-NYLOXKYT.mjs.map +1 -0
- package/dist/chunk-OF66AL5Z.mjs +56 -0
- package/dist/chunk-OF66AL5Z.mjs.map +1 -0
- package/dist/chunk-P4GBO6MW.mjs +3 -0
- package/dist/chunk-UWPFPWAW.mjs +14 -0
- package/dist/chunk-UWPFPWAW.mjs.map +1 -0
- package/dist/chunk-WB3YULQ4.mjs +3 -0
- package/dist/chunk-WM6BS77F.mjs +53 -0
- package/dist/chunk-WM6BS77F.mjs.map +1 -0
- package/dist/chunk-Z34F3WLK.mjs +14 -0
- package/dist/chunk-Z34F3WLK.mjs.map +1 -0
- package/dist/components/chat/Button.d.ts +6 -0
- package/dist/components/chat/Button.js +38 -0
- package/dist/components/chat/Button.js.map +1 -0
- package/dist/components/chat/Button.mjs +6 -0
- package/dist/components/chat/Chat.d.ts +96 -0
- package/dist/components/chat/Chat.js +800 -0
- package/dist/components/chat/Chat.js.map +1 -0
- package/dist/components/chat/Chat.mjs +16 -0
- package/dist/components/chat/ChatContext.d.ts +105 -0
- package/dist/components/chat/ChatContext.js +220 -0
- package/dist/components/chat/ChatContext.js.map +1 -0
- package/dist/components/chat/ChatContext.mjs +5 -0
- package/dist/components/chat/CodeBlock.js +221 -0
- package/dist/components/chat/CodeBlock.js.map +1 -0
- package/dist/components/chat/CodeBlock.mjs +6 -0
- package/dist/components/chat/Header.d.ts +6 -0
- package/dist/components/chat/Header.js +31 -0
- package/dist/components/chat/Header.js.map +1 -0
- package/dist/components/chat/Header.mjs +6 -0
- package/dist/components/chat/Icons.d.ts +15 -0
- package/dist/components/chat/Icons.js +233 -0
- package/dist/components/chat/Icons.js.map +1 -0
- package/dist/components/chat/Icons.mjs +4 -0
- package/dist/components/chat/Input.d.ts +6 -0
- package/dist/components/chat/Input.js +111 -0
- package/dist/components/chat/Input.js.map +1 -0
- package/dist/components/chat/Input.mjs +7 -0
- package/dist/components/chat/Markdown.d.ts +6 -0
- package/dist/components/chat/Markdown.js +269 -0
- package/dist/components/chat/Markdown.js.map +1 -0
- package/dist/components/chat/Markdown.mjs +7 -0
- package/dist/components/chat/Messages.d.ts +6 -0
- package/dist/components/chat/Messages.js +331 -0
- package/dist/components/chat/Messages.js.map +1 -0
- package/dist/components/chat/Messages.mjs +9 -0
- package/dist/components/chat/Popup.d.ts +10 -0
- package/dist/components/chat/Popup.js +806 -0
- package/dist/components/chat/Popup.js.map +1 -0
- package/dist/components/chat/Popup.mjs +17 -0
- package/dist/components/chat/Response.d.ts +6 -0
- package/dist/components/chat/Response.js +31 -0
- package/dist/components/chat/Response.js.map +1 -0
- package/dist/components/chat/Response.mjs +6 -0
- package/dist/components/chat/Sidebar.d.ts +13 -0
- package/dist/components/chat/Sidebar.js +817 -0
- package/dist/components/chat/Sidebar.js.map +1 -0
- package/dist/components/chat/Sidebar.mjs +17 -0
- package/dist/components/chat/Textarea.d.ts +13 -0
- package/dist/components/chat/Textarea.js +55 -0
- package/dist/components/chat/Textarea.js.map +1 -0
- package/dist/components/chat/Textarea.mjs +4 -0
- package/dist/components/chat/Window.d.ts +6 -0
- package/dist/components/chat/Window.js +116 -0
- package/dist/components/chat/Window.js.map +1 -0
- package/dist/components/chat/Window.mjs +4 -0
- package/dist/components/chat/index.d.ts +8 -0
- package/dist/components/chat/index.js +824 -0
- package/dist/components/chat/index.js.map +1 -0
- package/dist/components/chat/index.mjs +20 -0
- package/dist/components/chat/props.d.ts +33 -0
- package/dist/components/chat/props.js +4 -0
- package/dist/components/chat/props.mjs +3 -0
- package/dist/components/index.d.ts +6 -7
- package/dist/components/index.js +824 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +17 -22
- package/dist/context/index.js +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/use-copy-to-clipboard.js +47 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/index.css +565 -917
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.js +824 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +18 -23
- package/dist/lib/utils.js +64 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.mjs +38 -2
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.js +10 -0
- package/dist/lib/utils.test.js.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.js +4 -0
- package/dist/types/types.js.map +1 -0
- package/package.json +8 -7
- package/src/components/chat/Button.tsx +23 -0
- package/src/components/chat/Chat.tsx +186 -0
- package/src/components/chat/ChatContext.tsx +176 -0
- package/src/components/{chat-components/ui/codeblock.tsx → chat/CodeBlock.tsx} +21 -33
- package/src/components/chat/Header.tsx +15 -0
- package/src/components/chat/Icons.tsx +179 -0
- package/src/components/chat/Input.tsx +51 -0
- package/src/components/chat/Markdown.tsx +68 -0
- package/src/components/chat/Messages.tsx +113 -0
- package/src/components/chat/Popup.tsx +9 -0
- package/src/components/chat/Response.tsx +12 -0
- package/src/components/chat/Sidebar.tsx +28 -0
- package/src/components/chat/Textarea.tsx +61 -0
- package/src/components/chat/Window.tsx +141 -0
- package/src/components/chat/index.tsx +3 -0
- package/src/components/chat/props.ts +36 -0
- package/src/components/index.ts +1 -7
- package/src/css/animations.css +35 -0
- package/src/css/button.css +54 -0
- package/src/css/colors.css +61 -0
- package/src/css/header.css +43 -0
- package/src/css/input.css +79 -0
- package/src/css/markdown.css +123 -0
- package/src/css/messages.css +57 -0
- package/src/css/popup.css +22 -0
- package/src/css/response.css +29 -0
- package/src/css/sidebar.css +34 -0
- package/src/css/window.css +58 -0
- package/src/styles.css +12 -0
- package/src/types/types.ts +1 -1
- package/tsup.config.ts +1 -2
- package/dist/chunk-2KAF7NKC.mjs +0 -484
- package/dist/chunk-2KAF7NKC.mjs.map +0 -1
- package/dist/chunk-5KEDV5VC.mjs +0 -27
- package/dist/chunk-5KEDV5VC.mjs.map +0 -1
- package/dist/chunk-6LAZQHEB.mjs.map +0 -1
- package/dist/chunk-CF3BK4OX.mjs +0 -53
- package/dist/chunk-CF3BK4OX.mjs.map +0 -1
- package/dist/chunk-CNQX2VY3.mjs +0 -66
- package/dist/chunk-CNQX2VY3.mjs.map +0 -1
- package/dist/chunk-GCOPYGHH.mjs +0 -27
- package/dist/chunk-GCOPYGHH.mjs.map +0 -1
- package/dist/chunk-IJLMKBSZ.mjs +0 -25
- package/dist/chunk-IJLMKBSZ.mjs.map +0 -1
- package/dist/chunk-INCNMGJ7.mjs +0 -72
- package/dist/chunk-INCNMGJ7.mjs.map +0 -1
- package/dist/chunk-M3CZWJI3.mjs +0 -44
- package/dist/chunk-M3CZWJI3.mjs.map +0 -1
- package/dist/chunk-MC6KTH4X.mjs +0 -12
- package/dist/chunk-MC6KTH4X.mjs.map +0 -1
- package/dist/chunk-NMT7XT2R.mjs +0 -39
- package/dist/chunk-NMT7XT2R.mjs.map +0 -1
- package/dist/chunk-OHWEJUCS.mjs +0 -18
- package/dist/chunk-OHWEJUCS.mjs.map +0 -1
- package/dist/chunk-OOBQC5H6.mjs +0 -34
- package/dist/chunk-OOBQC5H6.mjs.map +0 -1
- package/dist/chunk-Q6YO7LDK.mjs +0 -40
- package/dist/chunk-Q6YO7LDK.mjs.map +0 -1
- package/dist/chunk-RPTRCFSO.mjs +0 -42
- package/dist/chunk-RPTRCFSO.mjs.map +0 -1
- package/dist/chunk-SEH5PQVW.mjs +0 -52
- package/dist/chunk-SEH5PQVW.mjs.map +0 -1
- package/dist/chunk-SHOTWRKC.mjs +0 -18
- package/dist/chunk-SHOTWRKC.mjs.map +0 -1
- package/dist/chunk-SRBUGQTM.mjs +0 -109
- package/dist/chunk-SRBUGQTM.mjs.map +0 -1
- package/dist/chunk-TEYIQHMK.mjs +0 -12
- package/dist/chunk-TEYIQHMK.mjs.map +0 -1
- package/dist/chunk-U6NJWGTV.mjs +0 -3
- package/dist/chunk-VGX2W5ZB.mjs +0 -28
- package/dist/chunk-VGX2W5ZB.mjs.map +0 -1
- package/dist/chunk-WLTEQ2FW.mjs +0 -80
- package/dist/chunk-WLTEQ2FW.mjs.map +0 -1
- package/dist/chunk-ZYC5YVDO.mjs +0 -21
- package/dist/chunk-ZYC5YVDO.mjs.map +0 -1
- package/dist/components/chat-components/chat-list.d.ts +0 -8
- package/dist/components/chat-components/chat-list.mjs +0 -13
- package/dist/components/chat-components/chat-message-actions.d.ts +0 -8
- package/dist/components/chat-components/chat-message-actions.mjs +0 -8
- package/dist/components/chat-components/chat-message.d.ts +0 -8
- package/dist/components/chat-components/chat-message.mjs +0 -11
- package/dist/components/chat-components/chat-panel.d.ts +0 -8
- package/dist/components/chat-components/chat-panel.mjs +0 -10
- package/dist/components/chat-components/chat-scroll-anchor.d.ts +0 -6
- package/dist/components/chat-components/chat-scroll-anchor.mjs +0 -5
- package/dist/components/chat-components/clear-history.d.ts +0 -9
- package/dist/components/chat-components/clear-history.mjs +0 -56
- package/dist/components/chat-components/clear-history.mjs.map +0 -1
- package/dist/components/chat-components/copilot-chat.d.ts +0 -12
- package/dist/components/chat-components/copilot-chat.mjs +0 -22
- package/dist/components/chat-components/default-empty-screen.d.ts +0 -8
- package/dist/components/chat-components/default-empty-screen.mjs +0 -8
- package/dist/components/chat-components/external-link.d.ts +0 -6
- package/dist/components/chat-components/external-link.mjs +0 -4
- package/dist/components/chat-components/markdown.d.ts +0 -6
- package/dist/components/chat-components/markdown.mjs +0 -4
- package/dist/components/chat-components/prompt-form.d.ts +0 -9
- package/dist/components/chat-components/prompt-form.mjs +0 -9
- package/dist/components/chat-components/theme-toggle.d.ts +0 -3
- package/dist/components/chat-components/theme-toggle.mjs +0 -32
- package/dist/components/chat-components/theme-toggle.mjs.map +0 -1
- package/dist/components/chat-components/toaster.d.ts +0 -1
- package/dist/components/chat-components/toaster.mjs +0 -4
- package/dist/components/chat-components/toaster.mjs.map +0 -1
- package/dist/components/chat-components/ui/alert-dialog.d.ts +0 -20
- package/dist/components/chat-components/ui/alert-dialog.mjs +0 -6
- package/dist/components/chat-components/ui/badge.d.ts +0 -12
- package/dist/components/chat-components/ui/badge.mjs +0 -29
- package/dist/components/chat-components/ui/badge.mjs.map +0 -1
- package/dist/components/chat-components/ui/button.d.ts +0 -14
- package/dist/components/chat-components/ui/button.mjs +0 -5
- package/dist/components/chat-components/ui/codeblock.mjs +0 -8
- package/dist/components/chat-components/ui/dialog.d.ts +0 -18
- package/dist/components/chat-components/ui/dialog.mjs +0 -94
- package/dist/components/chat-components/ui/dialog.mjs.map +0 -1
- package/dist/components/chat-components/ui/dropdown-menu.d.ts +0 -24
- package/dist/components/chat-components/ui/dropdown-menu.mjs +0 -87
- package/dist/components/chat-components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/chat-components/ui/icons.d.ts +0 -33
- package/dist/components/chat-components/ui/icons.mjs +0 -5
- package/dist/components/chat-components/ui/input.d.ts +0 -7
- package/dist/components/chat-components/ui/input.mjs +0 -26
- package/dist/components/chat-components/ui/input.mjs.map +0 -1
- package/dist/components/chat-components/ui/label.d.ts +0 -8
- package/dist/components/chat-components/ui/label.mjs +0 -19
- package/dist/components/chat-components/ui/label.mjs.map +0 -1
- package/dist/components/chat-components/ui/select.d.ts +0 -13
- package/dist/components/chat-components/ui/select.mjs +0 -101
- package/dist/components/chat-components/ui/select.mjs.map +0 -1
- package/dist/components/chat-components/ui/separator.d.ts +0 -6
- package/dist/components/chat-components/ui/separator.mjs +0 -5
- package/dist/components/chat-components/ui/sheet.d.ts +0 -19
- package/dist/components/chat-components/ui/sheet.mjs +0 -93
- package/dist/components/chat-components/ui/sheet.mjs.map +0 -1
- package/dist/components/chat-components/ui/switch.d.ts +0 -6
- package/dist/components/chat-components/ui/switch.mjs +0 -33
- package/dist/components/chat-components/ui/switch.mjs.map +0 -1
- package/dist/components/chat-components/ui/textarea.d.ts +0 -7
- package/dist/components/chat-components/ui/textarea.mjs +0 -25
- package/dist/components/chat-components/ui/textarea.mjs.map +0 -1
- package/dist/components/chat-components/ui/tooltip.d.ts +0 -9
- package/dist/components/chat-components/ui/tooltip.mjs +0 -5
- package/dist/components/sidebar/copilot-sidebar-ui-provider.d.ts +0 -9
- package/dist/components/sidebar/copilot-sidebar-ui-provider.mjs +0 -25
- package/dist/components/sidebar/copilot-sidebar.d.ts +0 -7
- package/dist/components/sidebar/copilot-sidebar.mjs +0 -23
- package/dist/components/sidebar/sidebar-context.d.ts +0 -9
- package/dist/components/sidebar/sidebar-context.mjs +0 -4
- package/dist/hooks/use-at-bottom.d.ts +0 -3
- package/dist/hooks/use-at-bottom.mjs +0 -4
- package/dist/hooks/use-enter-submit.d.ts +0 -8
- package/dist/hooks/use-enter-submit.mjs +0 -4
- package/src/components/chat-components/chat-list.tsx +0 -28
- package/src/components/chat-components/chat-message-actions.tsx +0 -36
- package/src/components/chat-components/chat-message.tsx +0 -70
- package/src/components/chat-components/chat-panel.tsx +0 -64
- package/src/components/chat-components/chat-scroll-anchor.tsx +0 -29
- package/src/components/chat-components/clear-history.tsx +0 -72
- package/src/components/chat-components/copilot-chat.tsx +0 -57
- package/src/components/chat-components/default-empty-screen.tsx +0 -57
- package/src/components/chat-components/external-link.tsx +0 -17
- package/src/components/chat-components/markdown.tsx +0 -8
- package/src/components/chat-components/prompt-form.tsx +0 -85
- package/src/components/chat-components/theme-toggle.tsx +0 -31
- package/src/components/chat-components/toaster.tsx +0 -3
- package/src/components/chat-components/ui/alert-dialog.tsx +0 -126
- package/src/components/chat-components/ui/badge.tsx +0 -33
- package/src/components/chat-components/ui/button.tsx +0 -49
- package/src/components/chat-components/ui/dialog.tsx +0 -106
- package/src/components/chat-components/ui/dropdown-menu.tsx +0 -117
- package/src/components/chat-components/ui/icons.tsx +0 -484
- package/src/components/chat-components/ui/input.tsx +0 -24
- package/src/components/chat-components/ui/label.tsx +0 -21
- package/src/components/chat-components/ui/select.tsx +0 -119
- package/src/components/chat-components/ui/separator.tsx +0 -26
- package/src/components/chat-components/ui/sheet.tsx +0 -106
- package/src/components/chat-components/ui/switch.tsx +0 -29
- package/src/components/chat-components/ui/textarea.tsx +0 -23
- package/src/components/chat-components/ui/tooltip.tsx +0 -30
- package/src/components/sidebar/copilot-sidebar-ui-provider.tsx +0 -77
- package/src/components/sidebar/copilot-sidebar.tsx +0 -39
- package/src/components/sidebar/sidebar-context.tsx +0 -11
- package/src/hooks/use-at-bottom.tsx +0 -20
- package/src/hooks/use-enter-submit.tsx +0 -17
- /package/dist/{chunk-U6NJWGTV.mjs.map → chunk-JD7BAH7U.mjs.map} +0 -0
- /package/dist/{components/chat-components/chat-list.mjs.map → chunk-P4GBO6MW.mjs.map} +0 -0
- /package/dist/{components/chat-components/chat-message-actions.mjs.map → chunk-WB3YULQ4.mjs.map} +0 -0
- /package/dist/components/{chat-components/chat-message.mjs.map → chat/Button.mjs.map} +0 -0
- /package/dist/components/{chat-components/chat-panel.mjs.map → chat/Chat.mjs.map} +0 -0
- /package/dist/components/{chat-components/chat-scroll-anchor.mjs.map → chat/ChatContext.mjs.map} +0 -0
- /package/dist/components/{chat-components/ui/codeblock.d.ts → chat/CodeBlock.d.ts} +0 -0
- /package/dist/components/{chat-components/copilot-chat.mjs.map → chat/CodeBlock.mjs.map} +0 -0
- /package/dist/components/{chat-components/default-empty-screen.mjs.map → chat/Header.mjs.map} +0 -0
- /package/dist/components/{chat-components/external-link.mjs.map → chat/Icons.mjs.map} +0 -0
- /package/dist/components/{chat-components/markdown.mjs.map → chat/Input.mjs.map} +0 -0
- /package/dist/components/{chat-components/prompt-form.mjs.map → chat/Markdown.mjs.map} +0 -0
- /package/dist/components/{chat-components/ui/alert-dialog.mjs.map → chat/Messages.mjs.map} +0 -0
- /package/dist/components/{chat-components/ui/button.mjs.map → chat/Popup.mjs.map} +0 -0
- /package/dist/components/{chat-components/ui/codeblock.mjs.map → chat/Response.mjs.map} +0 -0
- /package/dist/components/{chat-components/ui/icons.mjs.map → chat/Sidebar.mjs.map} +0 -0
- /package/dist/components/{chat-components/ui/separator.mjs.map → chat/Textarea.mjs.map} +0 -0
- /package/dist/components/{chat-components/ui/tooltip.mjs.map → chat/Window.mjs.map} +0 -0
- /package/dist/components/{sidebar/copilot-sidebar-ui-provider.mjs.map → chat/index.mjs.map} +0 -0
- /package/dist/components/{sidebar/copilot-sidebar.mjs.map → chat/props.js.map} +0 -0
- /package/dist/components/{sidebar/sidebar-context.mjs.map → chat/props.mjs.map} +0 -0
- /package/dist/{hooks/use-at-bottom.mjs.map → context/index.js.map} +0 -0
- /package/dist/hooks/{use-enter-submit.mjs.map → index.js.map} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useChatContext } from "./ChatContext";
|
|
2
|
+
import { ResponseButtonProps } from "./props";
|
|
3
|
+
|
|
4
|
+
export const ResponseButton = ({ onClick, inProgress }: ResponseButtonProps) => {
|
|
5
|
+
const context = useChatContext();
|
|
6
|
+
return (
|
|
7
|
+
<button onClick={onClick} className="copilotKitResponseButton">
|
|
8
|
+
<span>{inProgress ? context.icons.stopIcon : context.icons.regenerateIcon}</span>
|
|
9
|
+
{inProgress ? context.labels.stopGenerating : context.labels.regenerateResponse}
|
|
10
|
+
</button>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { CopilotChat, CopilotChatProps } from "./Chat";
|
|
3
|
+
|
|
4
|
+
interface CopilotSidebarProps extends CopilotChatProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const CopilotSidebar = (props: CopilotSidebarProps) => {
|
|
9
|
+
props = {
|
|
10
|
+
...props,
|
|
11
|
+
className: props.className ? props.className + " copilotKitSidebar" : "copilotKitSidebar",
|
|
12
|
+
};
|
|
13
|
+
const [expandedClassName, setExpandedClassName] = useState(
|
|
14
|
+
props.defaultOpen ? "sidebarExpanded" : "",
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const onSetOpen = (open: boolean) => {
|
|
18
|
+
props.onSetOpen?.(open);
|
|
19
|
+
setExpandedClassName(open ? "sidebarExpanded" : "");
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div className={`copilotKitSidebarContentWrapper ${expandedClassName}`}>
|
|
24
|
+
{props.children}
|
|
25
|
+
<CopilotChat {...props} {...{ onSetOpen }} />
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect, forwardRef, useImperativeHandle } from "react";
|
|
2
|
+
|
|
3
|
+
interface AutoResizingTextareaProps {
|
|
4
|
+
maxRows?: number;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
value: string;
|
|
7
|
+
onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
8
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const AutoResizingTextarea = forwardRef<HTMLTextAreaElement, AutoResizingTextareaProps>(
|
|
13
|
+
({ maxRows = 1, placeholder, value, onChange, onKeyDown, autoFocus }, ref) => {
|
|
14
|
+
const internalTextareaRef = useRef<HTMLTextAreaElement>(null);
|
|
15
|
+
const [maxHeight, setMaxHeight] = useState<number>(0);
|
|
16
|
+
|
|
17
|
+
useImperativeHandle(ref, () => internalTextareaRef.current as HTMLTextAreaElement);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const calculateMaxHeight = () => {
|
|
21
|
+
const textarea = internalTextareaRef.current;
|
|
22
|
+
if (textarea) {
|
|
23
|
+
textarea.style.height = "auto";
|
|
24
|
+
const singleRowHeight = textarea.scrollHeight;
|
|
25
|
+
setMaxHeight(singleRowHeight * maxRows);
|
|
26
|
+
if (autoFocus) {
|
|
27
|
+
textarea.focus();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
calculateMaxHeight();
|
|
33
|
+
}, [maxRows]);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const textarea = internalTextareaRef.current;
|
|
37
|
+
if (textarea) {
|
|
38
|
+
textarea.style.height = "auto";
|
|
39
|
+
textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight)}px`;
|
|
40
|
+
}
|
|
41
|
+
}, [value, maxHeight]);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<textarea
|
|
45
|
+
ref={internalTextareaRef}
|
|
46
|
+
value={value}
|
|
47
|
+
onChange={onChange}
|
|
48
|
+
onKeyDown={onKeyDown}
|
|
49
|
+
placeholder={placeholder}
|
|
50
|
+
style={{
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
resize: "none",
|
|
53
|
+
maxHeight: `${maxHeight}px`,
|
|
54
|
+
}}
|
|
55
|
+
rows={1}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
export default AutoResizingTextarea;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React, { useCallback, useEffect } from "react";
|
|
2
|
+
import { WindowProps } from "./props";
|
|
3
|
+
|
|
4
|
+
export const Window = ({
|
|
5
|
+
open,
|
|
6
|
+
setOpen,
|
|
7
|
+
children,
|
|
8
|
+
clickOutsideToClose,
|
|
9
|
+
hotkey,
|
|
10
|
+
hitEscapeToClose,
|
|
11
|
+
}: WindowProps) => {
|
|
12
|
+
const windowRef = React.useRef<HTMLDivElement>(null);
|
|
13
|
+
|
|
14
|
+
const handleClickOutside = useCallback(
|
|
15
|
+
(event: MouseEvent) => {
|
|
16
|
+
if (!clickOutsideToClose) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const parentElement = windowRef.current?.parentElement;
|
|
21
|
+
|
|
22
|
+
if (open && parentElement && !parentElement.contains(event.target as any)) {
|
|
23
|
+
setOpen(false);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
[clickOutsideToClose, open, setOpen],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const handleKeyDown = useCallback(
|
|
30
|
+
(event: KeyboardEvent) => {
|
|
31
|
+
const target = event.target as HTMLElement;
|
|
32
|
+
const isInput =
|
|
33
|
+
target.tagName === "INPUT" ||
|
|
34
|
+
target.tagName === "SELECT" ||
|
|
35
|
+
target.tagName === "TEXTAREA" ||
|
|
36
|
+
target.isContentEditable;
|
|
37
|
+
|
|
38
|
+
const isDescendantOfWrapper = windowRef.current?.contains(target);
|
|
39
|
+
|
|
40
|
+
if (
|
|
41
|
+
open &&
|
|
42
|
+
event.key === "Escape" &&
|
|
43
|
+
(!isInput || isDescendantOfWrapper) &&
|
|
44
|
+
hitEscapeToClose
|
|
45
|
+
) {
|
|
46
|
+
setOpen(false);
|
|
47
|
+
} else if (
|
|
48
|
+
event.key === hotkey &&
|
|
49
|
+
((isMacOS() && event.metaKey) || (!isMacOS() && event.ctrlKey)) &&
|
|
50
|
+
(!isInput || isDescendantOfWrapper)
|
|
51
|
+
) {
|
|
52
|
+
setOpen(!open);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
[hitEscapeToClose, hotkey, open, setOpen],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const adjustForMobile = useCallback(() => {
|
|
59
|
+
const copilotKitWindow = windowRef.current;
|
|
60
|
+
const vv = window.visualViewport;
|
|
61
|
+
if (!copilotKitWindow || !vv) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (window.innerWidth < 640 && open) {
|
|
66
|
+
copilotKitWindow.style.height = `${vv.height}px`;
|
|
67
|
+
copilotKitWindow.style.left = `${vv.offsetLeft}px`;
|
|
68
|
+
copilotKitWindow.style.top = `${vv.offsetTop}px`;
|
|
69
|
+
|
|
70
|
+
document.body.style.position = "fixed";
|
|
71
|
+
document.body.style.width = "100%";
|
|
72
|
+
document.body.style.height = `${window.innerHeight}px`;
|
|
73
|
+
document.body.style.overflow = "hidden";
|
|
74
|
+
document.body.style.touchAction = "none";
|
|
75
|
+
|
|
76
|
+
// Prevent scrolling on iOS
|
|
77
|
+
document.body.addEventListener("touchmove", preventScroll, {
|
|
78
|
+
passive: false,
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
copilotKitWindow.style.height = "";
|
|
82
|
+
copilotKitWindow.style.left = "";
|
|
83
|
+
copilotKitWindow.style.top = "";
|
|
84
|
+
document.body.style.position = "";
|
|
85
|
+
document.body.style.height = "";
|
|
86
|
+
document.body.style.width = "";
|
|
87
|
+
document.body.style.overflow = "";
|
|
88
|
+
document.body.style.top = "";
|
|
89
|
+
document.body.style.touchAction = "";
|
|
90
|
+
|
|
91
|
+
document.body.removeEventListener("touchmove", preventScroll);
|
|
92
|
+
}
|
|
93
|
+
}, [open]);
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
97
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
98
|
+
if (window.visualViewport) {
|
|
99
|
+
window.visualViewport.addEventListener("resize", adjustForMobile);
|
|
100
|
+
adjustForMobile();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return () => {
|
|
104
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
105
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
106
|
+
if (window.visualViewport) {
|
|
107
|
+
window.visualViewport.removeEventListener("resize", adjustForMobile);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}, [adjustForMobile, handleClickOutside, handleKeyDown]);
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<div className={`copilotKitWindow${open ? " open" : ""}`} ref={windowRef}>
|
|
114
|
+
{children}
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const preventScroll = (event: TouchEvent): void => {
|
|
120
|
+
let targetElement = event.target as Element;
|
|
121
|
+
|
|
122
|
+
// Function to check if the target has the parent with a given class
|
|
123
|
+
const hasParentWithClass = (element: Element, className: string): boolean => {
|
|
124
|
+
while (element && element !== document.body) {
|
|
125
|
+
if (element.classList.contains(className)) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
element = element.parentElement!;
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Check if the target of the touch event is inside an element with the 'copilotKitMessages' class
|
|
134
|
+
if (!hasParentWithClass(targetElement, "copilotKitMessages")) {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
function isMacOS() {
|
|
140
|
+
return /Mac|iMac|Macintosh/i.test(navigator.userAgent);
|
|
141
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Message } from "@copilotkit/shared";
|
|
2
|
+
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface WindowProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
clickOutsideToClose: boolean;
|
|
12
|
+
hitEscapeToClose: boolean;
|
|
13
|
+
hotkey: string;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface HeaderProps {
|
|
18
|
+
open: boolean;
|
|
19
|
+
setOpen: (open: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface MessagesProps {
|
|
23
|
+
messages: Message[];
|
|
24
|
+
inProgress: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface InputProps {
|
|
28
|
+
inProgress: boolean;
|
|
29
|
+
onSend: (text: string) => void;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ResponseButtonProps {
|
|
34
|
+
onClick: () => void;
|
|
35
|
+
inProgress: boolean;
|
|
36
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { Tooltip, TooltipProvider } from "./chat-components/ui/tooltip";
|
|
3
|
-
|
|
4
|
-
export { CopilotSidebarUIProvider } from "./sidebar/copilot-sidebar-ui-provider";
|
|
5
|
-
export { CopilotSidebar } from "./sidebar/copilot-sidebar";
|
|
6
|
-
export { CopilotSidebarContext } from "./sidebar/sidebar-context";
|
|
7
|
-
export type { CopilotSidebarContextType } from "./sidebar/sidebar-context";
|
|
1
|
+
export * from "./chat";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.copilotKitActivityDot1 {
|
|
2
|
+
animation: copilotKitActivityDotsAnimation 1.05s infinite;
|
|
3
|
+
}
|
|
4
|
+
.copilotKitActivityDot2 {
|
|
5
|
+
animation-delay: 0.1s;
|
|
6
|
+
}
|
|
7
|
+
.copilotKitActivityDot3 {
|
|
8
|
+
animation-delay: 0.2s;
|
|
9
|
+
}
|
|
10
|
+
@keyframes copilotKitActivityDotsAnimation {
|
|
11
|
+
0%,
|
|
12
|
+
57.14% {
|
|
13
|
+
animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
|
|
14
|
+
transform: translate(0);
|
|
15
|
+
}
|
|
16
|
+
28.57% {
|
|
17
|
+
animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
|
|
18
|
+
transform: translateY(-6px);
|
|
19
|
+
}
|
|
20
|
+
100% {
|
|
21
|
+
transform: translate(0);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes copilotKitSpinAnimation {
|
|
26
|
+
to {
|
|
27
|
+
transform: rotate(360deg);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes copilotKitPulseAnimation {
|
|
32
|
+
50% {
|
|
33
|
+
opacity: 0.5;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.copilotKitButton {
|
|
2
|
+
width: 3.5rem;
|
|
3
|
+
height: 3.5rem;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
9
|
+
outline: none;
|
|
10
|
+
position: relative;
|
|
11
|
+
transform: scale(1);
|
|
12
|
+
transition: transform 200ms;
|
|
13
|
+
background-color: var(--copilot-kit-button-background-color);
|
|
14
|
+
color: var(--copilot-kit-button-icon-color);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.copilotKitButton:hover {
|
|
19
|
+
transform: scale(1.1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.copilotKitButton:active {
|
|
23
|
+
transform: scale(0.75);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.copilotKitButtonIcon {
|
|
27
|
+
transition: opacity 100ms, transform 300ms;
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 50%;
|
|
30
|
+
left: 50%;
|
|
31
|
+
transform: translate(-50%, -50%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* State when the chat is open */
|
|
35
|
+
.copilotKitButton.open .copilotKitButtonIconOpen {
|
|
36
|
+
transform: translate(-50%, -50%) scale(0) rotate(90deg);
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.copilotKitButton.open .copilotKitButtonIconClose {
|
|
41
|
+
transform: translate(-50%, -50%) scale(1) rotate(0deg);
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* State when the chat is closed */
|
|
46
|
+
.copilotKitButton:not(.open) .copilotKitButtonIconOpen {
|
|
47
|
+
transform: translate(-50%, -50%) scale(1) rotate(0deg);
|
|
48
|
+
opacity: 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.copilotKitButton:not(.open) .copilotKitButtonIconClose {
|
|
52
|
+
transform: translate(-50%, -50%) scale(0) rotate(-90deg);
|
|
53
|
+
opacity: 0;
|
|
54
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--copilot-kit-primary-color: rgb(59 130 246);
|
|
3
|
+
--copilot-kit-contrast-color: rgb(255 255 255);
|
|
4
|
+
--copilot-kit-secondary-color: rgb(243 244 246);
|
|
5
|
+
--copilot-kit-secondary-contrast-color: rgb(0 0 0);
|
|
6
|
+
--copilot-kit-background-color: rgb(255 255 255);
|
|
7
|
+
--copilot-kit-muted-color: rgb(106 106 106);
|
|
8
|
+
--copilot-kit-separator-color: rgba(0, 0, 0, 0.08);
|
|
9
|
+
--copilot-kit-scrollbar-color: rgba(0, 0, 0, 0.2);
|
|
10
|
+
|
|
11
|
+
--copilot-kit-button-background-color: var(--copilot-kit-primary-color);
|
|
12
|
+
|
|
13
|
+
/* The color of the icon in the open/close button */
|
|
14
|
+
--copilot-kit-button-icon-color: var(--copilot-kit-contrast-color);
|
|
15
|
+
|
|
16
|
+
/* The background color of the header of the chat window */
|
|
17
|
+
--copilot-kit-header-background-color: var(--copilot-kit-primary-color);
|
|
18
|
+
|
|
19
|
+
/* The color of the title in the header of the chat window */
|
|
20
|
+
--copilot-kit-header-title-color: var(--copilot-kit-contrast-color);
|
|
21
|
+
|
|
22
|
+
/* The color of the close button in the header of the chat window */
|
|
23
|
+
--copilot-kit-header-close-button-color: var(--copilot-kit-contrast-color);
|
|
24
|
+
|
|
25
|
+
/* The color of the separator between the header and the messages area */
|
|
26
|
+
--copilot-kit-header-separator-color: var(--copilot-kit-separator-color);
|
|
27
|
+
|
|
28
|
+
/* The background color of the input area */
|
|
29
|
+
--copilot-kit-input-background-color: var(--copilot-kit-background-color);
|
|
30
|
+
|
|
31
|
+
/* The color of the send button */
|
|
32
|
+
--copilot-kit-input-send-button-color: var(--copilot-kit-primary-color);
|
|
33
|
+
|
|
34
|
+
/* The color of the send button when disabled */
|
|
35
|
+
--copilot-kit-input-send-button-disabled-color: var(--copilot-kit-muted-color);
|
|
36
|
+
|
|
37
|
+
/* The color of the placeholder text in the input area */
|
|
38
|
+
--copilot-kit-input-placeholder-color: var(--copilot-kit-muted-color);
|
|
39
|
+
|
|
40
|
+
/* The color of the text in the input area */
|
|
41
|
+
--copilot-kit-input-color: var(--copilot-kit-secondary-contrast-color);
|
|
42
|
+
|
|
43
|
+
/* The color of the separator between the input area and the messages area */
|
|
44
|
+
--copilot-kit-input-separator-color: var(--copilot-kit-separator-color);
|
|
45
|
+
|
|
46
|
+
/* The background color of the messages area */
|
|
47
|
+
--copilot-kit-messages-background-color: var(--copilot-kit-background-color);
|
|
48
|
+
|
|
49
|
+
/* The background color of a user message */
|
|
50
|
+
--copilot-kit-message-user-background-color: var(--copilot-kit-primary-color);
|
|
51
|
+
--copilot-kit-message-user-color: var(--copilot-kit-contrast-color);
|
|
52
|
+
|
|
53
|
+
/* The background color of a assistant message */
|
|
54
|
+
--copilot-kit-message-assistant-background-color: var(--copilot-kit-secondary-color);
|
|
55
|
+
--copilot-kit-message-assistant-color: var(--copilot-kit-secondary-contrast-color);
|
|
56
|
+
|
|
57
|
+
/* The color of the response control button */
|
|
58
|
+
--copilot-kit-response-button-border-color: var(--copilot-kit-separator-color);
|
|
59
|
+
--copilot-kit-response-button-color: #333;
|
|
60
|
+
--copilot-kit-response-button-background-color: #fff;
|
|
61
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.copilotKitHeader {
|
|
2
|
+
height: 56px;
|
|
3
|
+
font-weight: 500;
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
position: relative;
|
|
8
|
+
background-color: var(--copilot-kit-header-background-color);
|
|
9
|
+
color: var(--copilot-kit-header-title-color);
|
|
10
|
+
border-top-left-radius: 0;
|
|
11
|
+
border-top-right-radius: 0;
|
|
12
|
+
border-bottom: 1px solid var(--copilot-kit-header-separator-color);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.copilotKitSidebar .copilotKitHeader {
|
|
16
|
+
border-radius: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (min-width: 640px) {
|
|
20
|
+
.copilotKitHeader {
|
|
21
|
+
padding-left: 24px;
|
|
22
|
+
padding-right: 24px;
|
|
23
|
+
border-top-left-radius: 8px;
|
|
24
|
+
border-top-right-radius: 8px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.copilotKitHeader > button {
|
|
29
|
+
border: 0;
|
|
30
|
+
padding: 0px;
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 50%;
|
|
33
|
+
right: 16px;
|
|
34
|
+
transform: translateY(-50%);
|
|
35
|
+
outline: none;
|
|
36
|
+
color: var(--copilot-kit-header-close-button-color);
|
|
37
|
+
background-color: transparent;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.copilotKitHeader > button:focus {
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.copilotKitInput {
|
|
2
|
+
border-top: 1px solid var(--copilot-kit-input-separator-color);
|
|
3
|
+
padding-left: 2rem;
|
|
4
|
+
padding-right: 2.5rem;
|
|
5
|
+
padding-top: 1rem;
|
|
6
|
+
padding-bottom: 1rem;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
cursor: text;
|
|
10
|
+
position: relative;
|
|
11
|
+
border-bottom-left-radius: 0.75rem;
|
|
12
|
+
border-bottom-right-radius: 0.75rem;
|
|
13
|
+
background-color: var(--copilot-kit-input-background-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.copilotKitInput > button {
|
|
17
|
+
position: absolute;
|
|
18
|
+
right: 0.5rem;
|
|
19
|
+
padding: 0.25rem;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
transition-property: transform;
|
|
22
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
23
|
+
transition-duration: 200ms;
|
|
24
|
+
transform: scale(1);
|
|
25
|
+
color: rgba(0, 0, 0, 0.25);
|
|
26
|
+
-webkit-appearance: button;
|
|
27
|
+
appearance: button;
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
background-image: none;
|
|
30
|
+
text-transform: none;
|
|
31
|
+
font-family: inherit;
|
|
32
|
+
font-size: 100%;
|
|
33
|
+
font-weight: inherit;
|
|
34
|
+
line-height: inherit;
|
|
35
|
+
border: 0;
|
|
36
|
+
margin: 0;
|
|
37
|
+
text-indent: 0px;
|
|
38
|
+
text-shadow: none;
|
|
39
|
+
display: inline-block;
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.copilotKitInput > button:not([disabled]) {
|
|
44
|
+
color: var(--copilot-kit-input-send-button-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.copilotKitInput > button:not([disabled]):hover {
|
|
48
|
+
transform: scale(1.1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.copilotKitInput > button[disabled] {
|
|
52
|
+
color: var(--copilot-kit-input-send-button-disabled-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.copilotKitInput > textarea {
|
|
56
|
+
width: 100%;
|
|
57
|
+
outline: 2px solid transparent;
|
|
58
|
+
outline-offset: 2px;
|
|
59
|
+
resize: none;
|
|
60
|
+
white-space: pre-wrap;
|
|
61
|
+
overflow-wrap: break-word;
|
|
62
|
+
-webkit-font-smoothing: antialiased;
|
|
63
|
+
-moz-osx-font-smoothing: grayscale;
|
|
64
|
+
cursor: text;
|
|
65
|
+
font-size: 0.875rem;
|
|
66
|
+
line-height: 1.25rem;
|
|
67
|
+
margin: 0;
|
|
68
|
+
padding: 0;
|
|
69
|
+
font-family: inherit;
|
|
70
|
+
font-weight: inherit;
|
|
71
|
+
color: var(--copilot-kit-input-color);
|
|
72
|
+
border: 0px;
|
|
73
|
+
background-color: var(--copilot-kit-input-background-color);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.copilotKitInput > textarea::placeholder {
|
|
77
|
+
color: var(--copilot-kit-input-placeholder-color);
|
|
78
|
+
opacity: 1;
|
|
79
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
.copilotKitMarkdown h1,
|
|
2
|
+
.copilotKitMarkdown h2,
|
|
3
|
+
.copilotKitMarkdown h3,
|
|
4
|
+
.copilotKitMarkdown h4,
|
|
5
|
+
.copilotKitMarkdown h5,
|
|
6
|
+
.copilotKitMarkdown h6 {
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
line-height: 1.2;
|
|
9
|
+
margin-bottom: 1rem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.copilotKitMarkdown h1 {
|
|
13
|
+
font-size: 1.5em;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.copilotKitMarkdown h2 {
|
|
17
|
+
font-size: 1.25em;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.copilotKitMarkdown h3 {
|
|
22
|
+
font-size: 1.1em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.copilotKitMarkdown h4 {
|
|
26
|
+
font-size: 1em;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.copilotKitMarkdown h5 {
|
|
30
|
+
font-size: 0.9em;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.copilotKitMarkdown h6 {
|
|
34
|
+
font-size: 0.8em;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.copilotKitMarkdown p {
|
|
38
|
+
margin-bottom: 1.25em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.copilotKitMarkdown pre {
|
|
42
|
+
margin-bottom: 1.25em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.copilotKitMarkdown blockquote {
|
|
46
|
+
border-color: rgb(142, 142, 160);
|
|
47
|
+
border-left-width: 2px;
|
|
48
|
+
border-left-style: solid;
|
|
49
|
+
line-height: 1.2;
|
|
50
|
+
padding-left: 10px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.copilotKitMarkdown blockquote p {
|
|
54
|
+
padding: 0.7em 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.copilotKitMarkdown ul {
|
|
58
|
+
list-style-type: disc;
|
|
59
|
+
padding-left: 20px;
|
|
60
|
+
overflow: visible;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.copilotKitMarkdown li {
|
|
64
|
+
list-style-type: inherit;
|
|
65
|
+
list-style-position: outside;
|
|
66
|
+
margin-left: 0;
|
|
67
|
+
padding-left: 0;
|
|
68
|
+
position: relative;
|
|
69
|
+
overflow: visible;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.copilotKitCodeBlock {
|
|
73
|
+
position: relative;
|
|
74
|
+
width: 100%;
|
|
75
|
+
background-color: rgb(9 9 11);
|
|
76
|
+
border-radius: 0.375rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.copilotKitCodeBlockToolbar {
|
|
80
|
+
display: flex;
|
|
81
|
+
width: 100%;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
background-color: rgb(39 39 42);
|
|
85
|
+
padding-left: 1rem;
|
|
86
|
+
padding-top: 0.09rem;
|
|
87
|
+
padding-bottom: 0.09rem;
|
|
88
|
+
color: rgb(228, 228, 228);
|
|
89
|
+
border-top-left-radius: 0.375rem;
|
|
90
|
+
border-top-right-radius: 0.375rem;
|
|
91
|
+
font-family: sans-serif;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.copilotKitCodeBlockToolbarLanguage {
|
|
95
|
+
font-size: 0.75rem;
|
|
96
|
+
line-height: 1rem;
|
|
97
|
+
text-transform: lowercase;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.copilotKitCodeBlockToolbarButtons {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
margin-right: 0.25rem;
|
|
104
|
+
margin-left: 0.25rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.copilotKitCodeBlockToolbarButton {
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
border-radius: 0.375rem;
|
|
112
|
+
font-size: 0.875rem;
|
|
113
|
+
line-height: 1.25rem;
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
height: 2.5rem;
|
|
116
|
+
width: 2.5rem;
|
|
117
|
+
padding: 3px;
|
|
118
|
+
margin: 2px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.copilotKitCodeBlockToolbarButton:hover {
|
|
122
|
+
background-color: rgb(55, 55, 58);
|
|
123
|
+
}
|