@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
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { IconChevronUpDown, IconCheck } from '../../../chunk-2KAF7NKC.mjs';
|
|
2
|
-
import { cn } from '../../../chunk-Q6YO7LDK.mjs';
|
|
3
|
-
import { __objRest, __spreadProps, __spreadValues } from '../../../chunk-MRXNTQOX.mjs';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var Select = SelectPrimitive.Root;
|
|
9
|
-
var SelectGroup = SelectPrimitive.Group;
|
|
10
|
-
var SelectValue = SelectPrimitive.Value;
|
|
11
|
-
var SelectTrigger = React.forwardRef((_a, ref) => {
|
|
12
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
13
|
-
return /* @__PURE__ */ jsxs(
|
|
14
|
-
SelectPrimitive.Trigger,
|
|
15
|
-
__spreadProps(__spreadValues({
|
|
16
|
-
ref,
|
|
17
|
-
className: cn(
|
|
18
|
-
"flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
19
|
-
className
|
|
20
|
-
)
|
|
21
|
-
}, props), {
|
|
22
|
-
children: [
|
|
23
|
-
children,
|
|
24
|
-
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(IconChevronUpDown, { className: "opacity-50" }) })
|
|
25
|
-
]
|
|
26
|
-
})
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
30
|
-
var SelectContent = React.forwardRef((_a, ref) => {
|
|
31
|
-
var _b = _a, { className, children, position = "popper" } = _b, props = __objRest(_b, ["className", "children", "position"]);
|
|
32
|
-
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
33
|
-
SelectPrimitive.Content,
|
|
34
|
-
__spreadProps(__spreadValues({
|
|
35
|
-
ref,
|
|
36
|
-
className: cn(
|
|
37
|
-
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",
|
|
38
|
-
position === "popper" && "translate-y-1",
|
|
39
|
-
className
|
|
40
|
-
),
|
|
41
|
-
position
|
|
42
|
-
}, props), {
|
|
43
|
-
children: /* @__PURE__ */ jsx(
|
|
44
|
-
SelectPrimitive.Viewport,
|
|
45
|
-
{
|
|
46
|
-
className: cn(
|
|
47
|
-
"p-1",
|
|
48
|
-
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
49
|
-
),
|
|
50
|
-
children
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
})
|
|
54
|
-
) });
|
|
55
|
-
});
|
|
56
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
57
|
-
var SelectLabel = React.forwardRef((_a, ref) => {
|
|
58
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
59
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
-
SelectPrimitive.Label,
|
|
61
|
-
__spreadValues({
|
|
62
|
-
ref,
|
|
63
|
-
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)
|
|
64
|
-
}, props)
|
|
65
|
-
);
|
|
66
|
-
});
|
|
67
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
68
|
-
var SelectItem = React.forwardRef((_a, ref) => {
|
|
69
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
70
|
-
return /* @__PURE__ */ jsxs(
|
|
71
|
-
SelectPrimitive.Item,
|
|
72
|
-
__spreadProps(__spreadValues({
|
|
73
|
-
ref,
|
|
74
|
-
className: cn(
|
|
75
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
76
|
-
className
|
|
77
|
-
)
|
|
78
|
-
}, props), {
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(IconCheck, { className: "h-4 w-4" }) }) }),
|
|
81
|
-
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
82
|
-
]
|
|
83
|
-
})
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
87
|
-
var SelectSeparator = React.forwardRef((_a, ref) => {
|
|
88
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
89
|
-
return /* @__PURE__ */ jsx(
|
|
90
|
-
SelectPrimitive.Separator,
|
|
91
|
-
__spreadValues({
|
|
92
|
-
ref,
|
|
93
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
94
|
-
}, props)
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
98
|
-
|
|
99
|
-
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };
|
|
100
|
-
//# sourceMappingURL=out.js.map
|
|
101
|
-
//# sourceMappingURL=select.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/chat-components/ui/select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AAe/B,SAUI,KAVJ;AAVF,IAAM,SAAyB;AAE/B,IAAM,cAA8B;AAEpC,IAAM,cAA8B;AAEpC,IAAM,gBAAsB,iBAG1B,CAAC,IAAmC,QAAK;AAAxC,eAAE,aAAW,SAjBhB,IAiBG,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AACd;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI,QANL;AAAA,MAQE;AAAA;AAAA,QACD,oBAAiB,sBAAhB,EAAqB,SAAO,MAC3B,8BAAC,qBAAkB,WAAU,cAAa,GAC5C;AAAA;AAAA;AAAA,EACF;AAAA,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,IAAM,gBAAsB,iBAG1B,CAAC,IAAwD,QAAK;AAA7D,eAAE,aAAW,UAAU,WAAW,SArCrC,IAqCG,IAA+C,kBAA/C,IAA+C,CAA7C,aAAW,YAAU;AACxB,6BAAiB,wBAAhB,EACC;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,aAAa,YAAY;AAAA,QACzB;AAAA,MACF;AAAA,MACA;AAAA,OACI,QARL;AAAA,MAUC;AAAA,QAAiB;AAAA,QAAhB;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,aAAa,YACX;AAAA,UACJ;AAAA,UAEC;AAAA;AAAA,MACH;AAAA;AAAA,EACF,GACF;AAAA,CACD;AACD,cAAc,cAA8B,wBAAQ;AAEpD,IAAM,cAAoB,iBAGxB,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAlEL,IAkEG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,0CAA0C,SAAS;AAAA,OAC7D;AAAA,EACN;AAAA,CACD;AACD,YAAY,cAA8B,sBAAM;AAEhD,IAAM,aAAmB,iBAGvB,CAAC,IAAmC,QAAK;AAAxC,eAAE,aAAW,SA9EhB,IA8EG,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AACd;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI,QANL;AAAA,MAQC;AAAA,4BAAC,UAAK,WAAU,gEACd,8BAAiB,+BAAhB,EACC,8BAAC,aAAU,WAAU,WAAU,GACjC,GACF;AAAA,QACA,oBAAiB,0BAAhB,EAA0B,UAAS;AAAA;AAAA;AAAA,EACtC;AAAA,CACD;AACD,WAAW,cAA8B,qBAAK;AAE9C,IAAM,kBAAwB,iBAG5B,CAAC,IAAyB,QAAK;AAA9B,eAAE,YApGL,IAoGG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW,GAAG,4BAA4B,SAAS;AAAA,OAC/C;AAAA,EACN;AAAA,CACD;AACD,gBAAgB,cAA8B,0BAAU","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { IconArrowDown, IconCheck, IconChevronUpDown } from \"./icons\";\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <IconChevronUpDown className=\"opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80\",\n position === \"popper\" && \"translate-y-1\",\n className,\n )}\n position={position}\n {...props}\n >\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\",\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <IconCheck className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n};\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
-
|
|
4
|
-
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
|
|
6
|
-
export { Separator };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
|
|
4
|
-
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
5
|
-
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
declare const SheetContent: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
declare const SheetHeader: {
|
|
9
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
declare const SheetFooter: {
|
|
13
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
};
|
|
16
|
-
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
-
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
-
|
|
19
|
-
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { IconClose } from '../../../chunk-2KAF7NKC.mjs';
|
|
2
|
-
import { cn } from '../../../chunk-Q6YO7LDK.mjs';
|
|
3
|
-
import { __objRest, __spreadProps, __spreadValues } from '../../../chunk-MRXNTQOX.mjs';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
var Sheet = SheetPrimitive.Root;
|
|
9
|
-
var SheetTrigger = SheetPrimitive.Trigger;
|
|
10
|
-
var SheetClose = SheetPrimitive.Close;
|
|
11
|
-
var SheetPortal = (_a) => {
|
|
12
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
13
|
-
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, __spreadProps(__spreadValues({ className: cn("fixed inset-0 z-50 flex", className) }, props), { children }));
|
|
14
|
-
};
|
|
15
|
-
SheetPortal.displayName = SheetPrimitive.Portal.displayName;
|
|
16
|
-
var SheetOverlay = React.forwardRef((_a, ref) => {
|
|
17
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
18
|
-
return /* @__PURE__ */ jsx(
|
|
19
|
-
SheetPrimitive.Overlay,
|
|
20
|
-
__spreadProps(__spreadValues({
|
|
21
|
-
className: cn(
|
|
22
|
-
"fixed inset-0 z-50 transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",
|
|
23
|
-
className
|
|
24
|
-
)
|
|
25
|
-
}, props), {
|
|
26
|
-
ref
|
|
27
|
-
})
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
31
|
-
var SheetContent = React.forwardRef((_a, ref) => {
|
|
32
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
33
|
-
return /* @__PURE__ */ jsx(SheetPortal, { children: /* @__PURE__ */ jsxs(
|
|
34
|
-
SheetPrimitive.Content,
|
|
35
|
-
__spreadProps(__spreadValues({
|
|
36
|
-
ref,
|
|
37
|
-
className: cn(
|
|
38
|
-
"fixed z-50 h-full border-r bg-background p-6 opacity-100 shadow-lg data-[state=closed]:animate-slide-to-left data-[state=open]:animate-slide-from-left",
|
|
39
|
-
className
|
|
40
|
-
)
|
|
41
|
-
}, props), {
|
|
42
|
-
children: [
|
|
43
|
-
children,
|
|
44
|
-
/* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
45
|
-
/* @__PURE__ */ jsx(IconClose, {}),
|
|
46
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
47
|
-
] })
|
|
48
|
-
]
|
|
49
|
-
})
|
|
50
|
-
) });
|
|
51
|
-
});
|
|
52
|
-
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
53
|
-
var SheetHeader = (_a) => {
|
|
54
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
55
|
-
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col space-y-2", className) }, props));
|
|
56
|
-
};
|
|
57
|
-
SheetHeader.displayName = "SheetHeader";
|
|
58
|
-
var SheetFooter = (_a) => {
|
|
59
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
60
|
-
return /* @__PURE__ */ jsx(
|
|
61
|
-
"div",
|
|
62
|
-
__spreadValues({
|
|
63
|
-
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
|
|
64
|
-
}, props)
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
SheetFooter.displayName = "SheetFooter";
|
|
68
|
-
var SheetTitle = React.forwardRef((_a, ref) => {
|
|
69
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
70
|
-
return /* @__PURE__ */ jsx(
|
|
71
|
-
SheetPrimitive.Title,
|
|
72
|
-
__spreadValues({
|
|
73
|
-
ref,
|
|
74
|
-
className: cn("text-lg font-semibold text-foreground", className)
|
|
75
|
-
}, props)
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
79
|
-
var SheetDescription = React.forwardRef((_a, ref) => {
|
|
80
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
81
|
-
return /* @__PURE__ */ jsx(
|
|
82
|
-
SheetPrimitive.Description,
|
|
83
|
-
__spreadValues({
|
|
84
|
-
ref,
|
|
85
|
-
className: cn("text-sm text-muted-foreground", className)
|
|
86
|
-
}, props)
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
90
|
-
|
|
91
|
-
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
92
|
-
//# sourceMappingURL=out.js.map
|
|
93
|
-
//# sourceMappingURL=sheet.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/chat-components/ui/sheet.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAY9B,cAmCI,YAnCJ;AAPF,IAAM,QAAuB;AAE7B,IAAM,eAA8B;AAEpC,IAAM,aAA4B;AAElC,IAAM,cAAc,CAAC,OAAqE;AAArE,eAAE,aAAW,SAdlC,IAcqB,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AAChC,6BAAgB,uBAAf,+BAAsB,WAAW,GAAG,2BAA2B,SAAS,KAAO,QAA/E,EACE,WACH;AAAA;AAEF,YAAY,cAA6B,sBAAO;AAEhD,IAAM,eAAqB,iBAGzB,CAAC,IAAmC,QAAK;AAAxC,eAAE,aAAW,SAxBhB,IAwBG,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AACd;AAAA,IAAgB;AAAA,IAAf;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI,QALL;AAAA,MAMC;AAAA;AAAA,EACF;AAAA,CACD;AACD,aAAa,cAA6B,uBAAQ;AAElD,IAAM,eAAqB,iBAGzB,CAAC,IAAmC,QAAK;AAAxC,eAAE,aAAW,SAvChB,IAuCG,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AACd,6BAAC,eACC;AAAA,IAAgB;AAAA,IAAf;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI,QANL;AAAA,MAQE;AAAA;AAAA,QACD,qBAAgB,sBAAf,EAAqB,WAAU,4OAC9B;AAAA,8BAAC,aAAU;AAAA,UACX,oBAAC,UAAK,WAAU,WAAU,mBAAK;AAAA,WACjC;AAAA;AAAA;AAAA,EACF,GACF;AAAA,CACD;AACD,aAAa,cAA6B,uBAAQ;AAElD,IAAM,cAAc,CAAC,OAA+D;AAA/D,eAAE,YA3DvB,IA2DqB,IAAgB,kBAAhB,IAAgB,CAAd;AACrB,6BAAC,wBAAI,WAAW,GAAG,2BAA2B,SAAS,KAAO,MAAO;AAAA;AAEvE,YAAY,cAAc;AAE1B,IAAM,cAAc,CAAC,OAA+D;AAA/D,eAAE,YAhEvB,IAgEqB,IAAgB,kBAAhB,IAAgB,CAAd;AACrB;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,iEAAiE,SAAS;AAAA,OACpF;AAAA,EACN;AAAA;AAEF,YAAY,cAAc;AAE1B,IAAM,aAAmB,iBAGvB,CAAC,IAAyB,QAAK;AAA9B,eAAE,YA3EL,IA2EG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAgB;AAAA,IAAf;AAAA,MACC;AAAA,MACA,WAAW,GAAG,yCAAyC,SAAS;AAAA,OAC5D;AAAA,EACN;AAAA,CACD;AACD,WAAW,cAA6B,qBAAM;AAE9C,IAAM,mBAAyB,iBAG7B,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAvFL,IAuFG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAgB;AAAA,IAAf;AAAA,MACC;AAAA,MACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,OACpD;AAAA,EACN;AAAA,CACD;AACD,iBAAiB,cAA6B,2BAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { IconClose } from \"./icons\";\n\nconst Sheet = SheetPrimitive.Root;\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = ({ className, children, ...props }: SheetPrimitive.DialogPortalProps) => (\n <SheetPrimitive.Portal className={cn(\"fixed inset-0 z-50 flex\", className)} {...props}>\n {children}\n </SheetPrimitive.Portal>\n);\nSheetPortal.displayName = SheetPrimitive.Portal.displayName;\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, children, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed z-50 h-full border-r bg-background p-6 opacity-100 shadow-lg data-[state=closed]:animate-slide-to-left data-[state=open]:animate-slide-from-left\",\n className,\n )}\n {...props}\n >\n {children}\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <IconClose />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
-
|
|
4
|
-
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
|
|
6
|
-
export { Switch };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { cn } from '../../../chunk-Q6YO7LDK.mjs';
|
|
2
|
-
import { __objRest, __spreadProps, __spreadValues } from '../../../chunk-MRXNTQOX.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
var Switch = React.forwardRef((_a, ref) => {
|
|
8
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
-
SwitchPrimitives.Root,
|
|
11
|
-
__spreadProps(__spreadValues({
|
|
12
|
-
className: cn(
|
|
13
|
-
"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
14
|
-
className
|
|
15
|
-
)
|
|
16
|
-
}, props), {
|
|
17
|
-
ref,
|
|
18
|
-
children: /* @__PURE__ */ jsx(
|
|
19
|
-
SwitchPrimitives.Thumb,
|
|
20
|
-
{
|
|
21
|
-
className: cn(
|
|
22
|
-
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
})
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
|
-
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
30
|
-
|
|
31
|
-
export { Switch };
|
|
32
|
-
//# sourceMappingURL=out.js.map
|
|
33
|
-
//# sourceMappingURL=switch.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/chat-components/ui/switch.tsx"],"names":[],"mappings":";;;;;;;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,sBAAsB;AAgB9B;AAZJ,IAAM,SAAe,iBAGnB,CAAC,IAAyB,QAAK;AAA9B,eAAE,YAVL,IAUG,IAAgB,kBAAhB,IAAgB,CAAd;AACH;AAAA,IAAkB;AAAA,IAAjB;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI,QALL;AAAA,MAMC;AAAA,MAEA;AAAA,QAAkB;AAAA,QAAjB;AAAA,UACC,WAAW;AAAA,YACT;AAAA,UACF;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAAA,CACD;AACD,OAAO,cAA+B,sBAAK","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\",\n )}\n />\n </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
-
}
|
|
5
|
-
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
6
|
-
|
|
7
|
-
export { Textarea, TextareaProps };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { cn } from '../../../chunk-Q6YO7LDK.mjs';
|
|
2
|
-
import { __objRest, __spreadValues } from '../../../chunk-MRXNTQOX.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
var Textarea = React.forwardRef(
|
|
7
|
-
(_a, ref) => {
|
|
8
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
-
"textarea",
|
|
11
|
-
__spreadValues({
|
|
12
|
-
className: cn(
|
|
13
|
-
"flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
-
className
|
|
15
|
-
),
|
|
16
|
-
ref
|
|
17
|
-
}, props)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
Textarea.displayName = "Textarea";
|
|
22
|
-
|
|
23
|
-
export { Textarea };
|
|
24
|
-
//# sourceMappingURL=out.js.map
|
|
25
|
-
//# sourceMappingURL=textarea.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/chat-components/ui/textarea.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,YAAY,WAAW;AASjB;AAHN,IAAM,WAAiB;AAAA,EACrB,CAAC,IAAyB,QAAQ;AAAjC,iBAAE,YAPL,IAOG,IAAgB,kBAAhB,IAAgB,CAAd;AACD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,SACI;AAAA,IACN;AAAA,EAEJ;AACF;AACA,SAAS,cAAc","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n \"flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
-
|
|
4
|
-
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
5
|
-
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
6
|
-
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
interface CopilotSidebarUIProviderProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
makeSystemMessage?: (contextString: string) => string;
|
|
6
|
-
}
|
|
7
|
-
declare function CopilotSidebarUIProvider({ children, ...props }: CopilotSidebarUIProviderProps): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { CopilotSidebarUIProvider, CopilotSidebarUIProviderProps };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export { CopilotSidebarUIProvider } from '../../chunk-WLTEQ2FW.mjs';
|
|
2
|
-
import '../../chunk-NMT7XT2R.mjs';
|
|
3
|
-
import '../../chunk-MC6KTH4X.mjs';
|
|
4
|
-
import '../../chunk-RPTRCFSO.mjs';
|
|
5
|
-
import '../../chunk-SEH5PQVW.mjs';
|
|
6
|
-
import '../../chunk-5KEDV5VC.mjs';
|
|
7
|
-
import '../../chunk-SHOTWRKC.mjs';
|
|
8
|
-
import '../../chunk-GCOPYGHH.mjs';
|
|
9
|
-
import '../../chunk-CNQX2VY3.mjs';
|
|
10
|
-
import '../../chunk-6LAZQHEB.mjs';
|
|
11
|
-
import '../../chunk-TEYIQHMK.mjs';
|
|
12
|
-
import '../../chunk-OOBQC5H6.mjs';
|
|
13
|
-
import '../../chunk-CF3BK4OX.mjs';
|
|
14
|
-
import '../../chunk-INCNMGJ7.mjs';
|
|
15
|
-
import '../../chunk-VGX2W5ZB.mjs';
|
|
16
|
-
import '../../chunk-M3CZWJI3.mjs';
|
|
17
|
-
import '../../chunk-2KAF7NKC.mjs';
|
|
18
|
-
import '../../chunk-Q6YO7LDK.mjs';
|
|
19
|
-
import '../../chunk-IJLMKBSZ.mjs';
|
|
20
|
-
import '../../chunk-ZYC5YVDO.mjs';
|
|
21
|
-
import '../../chunk-POVINPXX.mjs';
|
|
22
|
-
import '../../chunk-OHWEJUCS.mjs';
|
|
23
|
-
import '../../chunk-MRXNTQOX.mjs';
|
|
24
|
-
//# sourceMappingURL=out.js.map
|
|
25
|
-
//# sourceMappingURL=copilot-sidebar-ui-provider.mjs.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { CopilotSidebar } from '../../chunk-NMT7XT2R.mjs';
|
|
2
|
-
import '../../chunk-RPTRCFSO.mjs';
|
|
3
|
-
import '../../chunk-SEH5PQVW.mjs';
|
|
4
|
-
import '../../chunk-5KEDV5VC.mjs';
|
|
5
|
-
import '../../chunk-SHOTWRKC.mjs';
|
|
6
|
-
import '../../chunk-GCOPYGHH.mjs';
|
|
7
|
-
import '../../chunk-CNQX2VY3.mjs';
|
|
8
|
-
import '../../chunk-6LAZQHEB.mjs';
|
|
9
|
-
import '../../chunk-TEYIQHMK.mjs';
|
|
10
|
-
import '../../chunk-OOBQC5H6.mjs';
|
|
11
|
-
import '../../chunk-CF3BK4OX.mjs';
|
|
12
|
-
import '../../chunk-INCNMGJ7.mjs';
|
|
13
|
-
import '../../chunk-VGX2W5ZB.mjs';
|
|
14
|
-
import '../../chunk-M3CZWJI3.mjs';
|
|
15
|
-
import '../../chunk-2KAF7NKC.mjs';
|
|
16
|
-
import '../../chunk-Q6YO7LDK.mjs';
|
|
17
|
-
import '../../chunk-IJLMKBSZ.mjs';
|
|
18
|
-
import '../../chunk-ZYC5YVDO.mjs';
|
|
19
|
-
import '../../chunk-POVINPXX.mjs';
|
|
20
|
-
import '../../chunk-OHWEJUCS.mjs';
|
|
21
|
-
import '../../chunk-MRXNTQOX.mjs';
|
|
22
|
-
//# sourceMappingURL=out.js.map
|
|
23
|
-
//# sourceMappingURL=copilot-sidebar.mjs.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface CopilotSidebarContextType {
|
|
4
|
-
isSidebarOpen: boolean;
|
|
5
|
-
toggleSidebar: () => void;
|
|
6
|
-
}
|
|
7
|
-
declare const CopilotSidebarContext: React.Context<CopilotSidebarContextType>;
|
|
8
|
-
|
|
9
|
-
export { CopilotSidebarContext, CopilotSidebarContextType };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type Message } from "@copilotkit/react-core";
|
|
2
|
-
|
|
3
|
-
import { Separator } from "./ui/separator";
|
|
4
|
-
import { ChatMessage } from "./chat-message";
|
|
5
|
-
|
|
6
|
-
export interface ChatList {
|
|
7
|
-
messages: Message[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function ChatList({ messages }: ChatList) {
|
|
11
|
-
// we don't want to display system messages
|
|
12
|
-
const displayedMessages = messages.filter((message) => message.role !== "system");
|
|
13
|
-
|
|
14
|
-
if (!displayedMessages.length) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className="relative mx-auto max-w-2xl px-0">
|
|
20
|
-
{displayedMessages.map((message, index) => (
|
|
21
|
-
<div key={index}>
|
|
22
|
-
<ChatMessage message={message} />
|
|
23
|
-
{index < displayedMessages.length - 1 && <Separator className="my-4 md:my-4" />}
|
|
24
|
-
</div>
|
|
25
|
-
))}
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { type Message } from "@copilotkit/react-core";
|
|
4
|
-
|
|
5
|
-
import { Button } from "./ui/button";
|
|
6
|
-
import { IconCheck, IconCopy } from "./ui/icons";
|
|
7
|
-
import { useCopyToClipboard } from "../../hooks/use-copy-to-clipboard";
|
|
8
|
-
import { cn } from "../../lib/utils";
|
|
9
|
-
|
|
10
|
-
interface ChatMessageActionsProps extends React.ComponentProps<"div"> {
|
|
11
|
-
message: Message;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function ChatMessageActions({ message, className, ...props }: ChatMessageActionsProps) {
|
|
15
|
-
const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 });
|
|
16
|
-
|
|
17
|
-
const onCopy = () => {
|
|
18
|
-
if (isCopied) return;
|
|
19
|
-
copyToClipboard(message.content);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div
|
|
24
|
-
className={cn(
|
|
25
|
-
"flex items-center justify-end transition-opacity group-hover:opacity-100 md:absolute md:-right-10 md:-top-2 md:opacity-0",
|
|
26
|
-
className,
|
|
27
|
-
)}
|
|
28
|
-
{...props}
|
|
29
|
-
>
|
|
30
|
-
<Button variant="ghost" size="icon" onClick={onCopy}>
|
|
31
|
-
{isCopied ? <IconCheck /> : <IconCopy />}
|
|
32
|
-
<span className="sr-only">Copy message</span>
|
|
33
|
-
</Button>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Message } from "@copilotkit/react-core";
|
|
2
|
-
import remarkGfm from "remark-gfm";
|
|
3
|
-
import remarkMath from "remark-math";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
import { CodeBlock } from "./ui/codeblock";
|
|
7
|
-
import { MemoizedReactMarkdown } from "./markdown";
|
|
8
|
-
import { IconOpenAI, IconUser } from "./ui/icons";
|
|
9
|
-
import { ChatMessageActions } from "./chat-message-actions";
|
|
10
|
-
|
|
11
|
-
export interface ChatMessageProps {
|
|
12
|
-
message: Message;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function ChatMessage({ message, ...props }: ChatMessageProps) {
|
|
16
|
-
return (
|
|
17
|
-
<div className={cn("group relative mb-4 flex items-start")} {...props}>
|
|
18
|
-
<div
|
|
19
|
-
className={cn(
|
|
20
|
-
"flex h-8 w-8 shrink-0 select-none items-center justify-center rounded-md border shadow",
|
|
21
|
-
message.role === "user" ? "bg-background" : "bg-primary text-primary-foreground",
|
|
22
|
-
)}
|
|
23
|
-
>
|
|
24
|
-
{message.role === "user" ? <IconUser /> : <IconOpenAI />}
|
|
25
|
-
</div>
|
|
26
|
-
<div className="ml-4 flex-1 space-y-2 overflow-hidden px-1">
|
|
27
|
-
<MemoizedReactMarkdown
|
|
28
|
-
className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0 text-sm"
|
|
29
|
-
remarkPlugins={[remarkGfm, remarkMath]}
|
|
30
|
-
components={{
|
|
31
|
-
p({ children }) {
|
|
32
|
-
return <p className="mb-2 last:mb-0">{children}</p>;
|
|
33
|
-
},
|
|
34
|
-
code({ children, className, inline, ...props }) {
|
|
35
|
-
if (children.length) {
|
|
36
|
-
if (children[0] == "▍") {
|
|
37
|
-
return <span className="mt-1 animate-pulse cursor-default">▍</span>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
children[0] = (children[0] as string).replace("`▍`", "▍");
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const match = /language-(\w+)/.exec(className || "");
|
|
44
|
-
|
|
45
|
-
if (inline) {
|
|
46
|
-
return (
|
|
47
|
-
<code className={className} {...props}>
|
|
48
|
-
{children}
|
|
49
|
-
</code>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<CodeBlock
|
|
55
|
-
key={Math.random()}
|
|
56
|
-
language={(match && match[1]) || ""}
|
|
57
|
-
value={String(children).replace(/\n$/, "")}
|
|
58
|
-
{...props}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
},
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
64
|
-
{message.content}
|
|
65
|
-
</MemoizedReactMarkdown>
|
|
66
|
-
<ChatMessageActions message={message} />
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
);
|
|
70
|
-
}
|