@cognite/aura 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +53 -0
- package/dist/components/ui/core/alert/alert.d.ts +19 -0
- package/dist/components/ui/core/alert/alert.js +180 -0
- package/dist/components/ui/core/alert/alert.metadata.d.ts +2 -0
- package/dist/components/ui/core/alert/alert.metadata.js +9 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -0
- package/dist/components/ui/core/avatar/avatar.js +94 -0
- package/dist/components/ui/core/avatar/avatar.metadata.d.ts +8 -0
- package/dist/components/ui/core/avatar/avatar.metadata.js +9 -0
- package/dist/components/ui/core/badge/badge.d.ts +14 -0
- package/dist/components/ui/core/badge/badge.js +116 -0
- package/dist/components/ui/core/badge/badge.metadata.d.ts +2 -0
- package/dist/components/ui/core/badge/badge.metadata.js +8 -0
- package/dist/components/ui/core/button/button.d.ts +9 -0
- package/dist/components/ui/core/button/button.js +50 -0
- package/dist/components/ui/core/button/button.metadata.d.ts +2 -0
- package/dist/components/ui/core/button/button.metadata.js +9 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/core/button-group/button-group.js +83 -0
- package/dist/components/ui/core/button-group/button-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/button-group/button-group.metadata.js +8 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +21 -0
- package/dist/components/ui/core/code-block/code-block.js +146 -0
- package/dist/components/ui/core/code-block/code-block.metadata.d.ts +2 -0
- package/dist/components/ui/core/code-block/code-block.metadata.js +8 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +4 -0
- package/dist/components/ui/core/collapsible/collapsible.js +44 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +2 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.js +9 -0
- package/dist/components/ui/core/command/command.d.ts +86 -0
- package/dist/components/ui/core/command/command.js +150 -0
- package/dist/components/ui/core/command/command.metadata.d.ts +2 -0
- package/dist/components/ui/core/command/command.metadata.js +9 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +18 -0
- package/dist/components/ui/core/dialog/dialog.js +155 -0
- package/dist/components/ui/core/dialog/dialog.metadata.d.ts +2 -0
- package/dist/components/ui/core/dialog/dialog.metadata.js +9 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +53 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +250 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +2 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +9 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +12 -0
- package/dist/components/ui/core/helper-text/helper-text.js +65 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +2 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.js +9 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +12 -0
- package/dist/components/ui/core/hover-card/hover-card.js +76 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +2 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.js +8 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +33 -0
- package/dist/components/ui/core/inline-citation/inline-citation.js +170 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +2 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +8 -0
- package/dist/components/ui/core/input/input.d.ts +6 -0
- package/dist/components/ui/core/input/input.js +34 -0
- package/dist/components/ui/core/input/input.metadata.d.ts +2 -0
- package/dist/components/ui/core/input/input.metadata.js +9 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +15 -0
- package/dist/components/ui/core/input-group/input-group.js +144 -0
- package/dist/components/ui/core/input-group/input-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/input-group/input-group.metadata.js +9 -0
- package/dist/components/ui/core/label/label.d.ts +2 -0
- package/dist/components/ui/core/label/label.js +20 -0
- package/dist/components/ui/core/label/label.metadata.d.ts +2 -0
- package/dist/components/ui/core/label/label.metadata.js +9 -0
- package/dist/components/ui/core/loader/loader.d.ts +7 -0
- package/dist/components/ui/core/loader/loader.js +119 -0
- package/dist/components/ui/core/loader/loader.metadata.d.ts +2 -0
- package/dist/components/ui/core/loader/loader.metadata.js +9 -0
- package/dist/components/ui/core/message/message.d.ts +55 -0
- package/dist/components/ui/core/message/message.js +169 -0
- package/dist/components/ui/core/message/message.metadata.d.ts +2 -0
- package/dist/components/ui/core/popover/popover.d.ts +8 -0
- package/dist/components/ui/core/popover/popover.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +161 -0
- package/dist/components/ui/core/prompt-input/prompt-input.js +402 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +9 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +9 -0
- package/dist/components/ui/core/reasoning/reasoning.js +85 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +2 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.js +8 -0
- package/dist/components/ui/core/select/select.d.ts +44 -0
- package/dist/components/ui/core/select/select.js +279 -0
- package/dist/components/ui/core/select/select.metadata.d.ts +2 -0
- package/dist/components/ui/core/select/select.metadata.js +9 -0
- package/dist/components/ui/core/separator/separator.d.ts +6 -0
- package/dist/components/ui/core/separator/separator.js +25 -0
- package/dist/components/ui/core/separator/separator.metadata.d.ts +2 -0
- package/dist/components/ui/core/separator/separator.metadata.js +8 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +14 -0
- package/dist/components/ui/core/shimmer/shimmer.js +69 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +2 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.js +9 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.js +18 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.js +9 -0
- package/dist/components/ui/core/sources/sources.d.ts +16 -0
- package/dist/components/ui/core/sources/sources.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +9 -0
- package/dist/components/ui/core/textarea/textarea.js +49 -0
- package/dist/components/ui/core/textarea/textarea.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.metadata.js +9 -0
- package/dist/components/ui/core/tool/tool.d.ts +21 -0
- package/dist/components/ui/core/tool/tool.js +151 -0
- package/dist/components/ui/core/tool/tool.metadata.d.ts +2 -0
- package/dist/components/ui/core/tool/tool.metadata.js +8 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +10 -0
- package/dist/components/ui/core/tooltip/tooltip.js +82 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +8 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.js +9 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.d.ts +134 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.metadata.d.ts +2 -0
- package/dist/components/ui/lab/topbar/topbar.d.ts +10 -0
- package/dist/components/ui/lab/topbar/topbar.metadata.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +229 -0
- package/dist/lib/ai/types.d.ts +53 -0
- package/dist/lib/component-status-config.d.ts +12 -0
- package/dist/lib/style-scope.d.ts +5 -0
- package/dist/lib/style-scope.js +7 -0
- package/dist/lib/types.d.ts +50 -0
- package/dist/lib/use-controllable-state.d.ts +11 -0
- package/dist/lib/use-controllable-state.js +32 -0
- package/dist/lib/utils.d.ts +45 -0
- package/dist/lib/utils.js +92 -0
- package/package.json +51 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ComponentProps, HTMLAttributes } from 'react';
|
|
2
|
+
import { Streamdown } from 'streamdown';
|
|
3
|
+
import { FileUIPart, UIMessage } from '../../../../lib/ai/types';
|
|
4
|
+
import { Avatar, AvatarIcon } from '../avatar/avatar';
|
|
5
|
+
import { Button } from '../button/button';
|
|
6
|
+
type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
isResponse?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const Message: ({ className, isResponse, ...props }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
type MessageContentProps = HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
declare const MessageContent: ({ children, className, ...props }: MessageContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
type MessageAvatarProps = ComponentProps<typeof Avatar> & {
|
|
13
|
+
avatarUrl?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const MessageAvatar: ({ avatarUrl, name, className, children, variant, sizes, ...props }: MessageAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type MessageAvatarIconProps = ComponentProps<typeof AvatarIcon>;
|
|
18
|
+
declare const MessageAvatarIcon: (props: MessageAvatarIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
type MessageActionsProps = ComponentProps<'div'>;
|
|
20
|
+
declare const MessageActions: ({ className, children, ...props }: MessageActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
type MessageActionProps = ComponentProps<typeof Button> & {
|
|
22
|
+
tooltip?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
};
|
|
25
|
+
declare const MessageAction: ({ tooltip, children, label, className, variant, size, ...props }: MessageActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
type MessageBranchProps = HTMLAttributes<HTMLDivElement> & {
|
|
27
|
+
defaultBranch?: number;
|
|
28
|
+
onBranchChange?: (branchIndex: number) => void;
|
|
29
|
+
};
|
|
30
|
+
declare const MessageBranch: ({ defaultBranch, onBranchChange, className, ...props }: MessageBranchProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
type MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;
|
|
32
|
+
declare const MessageBranchContent: ({ children, ...props }: MessageBranchContentProps) => import("react/jsx-runtime").JSX.Element[];
|
|
33
|
+
type MessageBranchSelectorProps = HTMLAttributes<HTMLDivElement> & {
|
|
34
|
+
from: UIMessage['role'];
|
|
35
|
+
};
|
|
36
|
+
declare const MessageBranchSelector: ({ ...props }: MessageBranchSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
37
|
+
type MessageBranchPreviousProps = ComponentProps<typeof Button>;
|
|
38
|
+
declare const MessageBranchPrevious: ({ children, ...props }: MessageBranchPreviousProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
type MessageBranchNextProps = ComponentProps<typeof Button>;
|
|
40
|
+
declare const MessageBranchNext: ({ children, ...props }: MessageBranchNextProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
|
|
42
|
+
declare const MessageBranchPage: ({ className, ...props }: MessageBranchPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
type MessageResponseProps = ComponentProps<typeof Streamdown>;
|
|
44
|
+
declare const MessageResponse: import('react').MemoExoticComponent<({ className, components, ...props }: MessageResponseProps) => import("react/jsx-runtime").JSX.Element>;
|
|
45
|
+
type MessageAttachmentProps = HTMLAttributes<HTMLDivElement> & {
|
|
46
|
+
data: FileUIPart;
|
|
47
|
+
className?: string;
|
|
48
|
+
onRemove?: () => void;
|
|
49
|
+
};
|
|
50
|
+
declare function MessageAttachment({ data, className, onRemove, ...props }: MessageAttachmentProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
type MessageAttachmentsProps = ComponentProps<'div'>;
|
|
52
|
+
declare function MessageAttachments({ children, className, ...props }: MessageAttachmentsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
53
|
+
type MessageToolbarProps = ComponentProps<'div'>;
|
|
54
|
+
declare const MessageToolbar: ({ className, children, ...props }: MessageToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export { Message, MessageContent, MessageAvatar, MessageAvatarIcon, MessageActions, MessageAction, MessageBranch, MessageBranchContent, MessageBranchSelector, MessageBranchPrevious, MessageBranchNext, MessageBranchPage, MessageResponse, MessageAttachment, MessageAttachments, MessageToolbar, };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as c, memo as g, isValidElement as u } from "react";
|
|
3
|
+
import "@tabler/icons-react";
|
|
4
|
+
import { bundledLanguages as f } from "shiki";
|
|
5
|
+
import { Streamdown as p } from "streamdown";
|
|
6
|
+
import { cn as l } from "../../../../lib/utils.js";
|
|
7
|
+
import "../avatar/avatar.js";
|
|
8
|
+
import { Button as b } from "../button/button.js";
|
|
9
|
+
import "../button-group/button-group.js";
|
|
10
|
+
import { CodeBlock as x, CodeBlockCopyButton as h } from "../code-block/code-block.js";
|
|
11
|
+
import { Tooltip as N, TooltipTrigger as k, TooltipContent as v } from "../tooltip/tooltip.js";
|
|
12
|
+
const V = ({ className: e, isResponse: s = !1, ...o }) => /* @__PURE__ */ t(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "message",
|
|
16
|
+
className: l(
|
|
17
|
+
"group flex w-full items-start justify-start gap-3 py-2 mb-0",
|
|
18
|
+
s ? "is-assistant items-start" : "is-user flex-row-reverse",
|
|
19
|
+
e
|
|
20
|
+
),
|
|
21
|
+
...o
|
|
22
|
+
}
|
|
23
|
+
), D = ({
|
|
24
|
+
children: e,
|
|
25
|
+
className: s,
|
|
26
|
+
...o
|
|
27
|
+
}) => /* @__PURE__ */ t(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
"data-slot": "message-content",
|
|
31
|
+
className: l(
|
|
32
|
+
"is-user:dark flex flex-col gap-1 overflow-hidden rounded-md text-base leading-tight tracking-tightest",
|
|
33
|
+
"max-w-4/5",
|
|
34
|
+
"group-[.is-user]:bg-accent group-[.is-user]:p-2 group-[.is-user]:text-accent-foreground",
|
|
35
|
+
"group-[.is-assistant]:text-foreground group-[.is-assistant]:pt-1",
|
|
36
|
+
s
|
|
37
|
+
),
|
|
38
|
+
...o,
|
|
39
|
+
children: e
|
|
40
|
+
}
|
|
41
|
+
), F = ({
|
|
42
|
+
className: e,
|
|
43
|
+
children: s,
|
|
44
|
+
...o
|
|
45
|
+
}) => /* @__PURE__ */ t(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "message-actions",
|
|
49
|
+
className: l("flex items-center gap-2", e),
|
|
50
|
+
...o,
|
|
51
|
+
children: s
|
|
52
|
+
}
|
|
53
|
+
), G = ({
|
|
54
|
+
tooltip: e,
|
|
55
|
+
children: s,
|
|
56
|
+
label: o,
|
|
57
|
+
className: a,
|
|
58
|
+
variant: m = "ghost",
|
|
59
|
+
size: r = "sm",
|
|
60
|
+
...n
|
|
61
|
+
}) => {
|
|
62
|
+
const i = /* @__PURE__ */ d(
|
|
63
|
+
b,
|
|
64
|
+
{
|
|
65
|
+
"data-slot": "message-action",
|
|
66
|
+
className: l(
|
|
67
|
+
"relative icon-sm text-muted-foreground hover:text-foreground",
|
|
68
|
+
a
|
|
69
|
+
),
|
|
70
|
+
size: r,
|
|
71
|
+
type: "button",
|
|
72
|
+
variant: m,
|
|
73
|
+
...n,
|
|
74
|
+
children: [
|
|
75
|
+
s,
|
|
76
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: o || e })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
return e ? /* @__PURE__ */ d(N, { children: [
|
|
81
|
+
/* @__PURE__ */ t(k, { render: i }),
|
|
82
|
+
/* @__PURE__ */ t(v, { children: /* @__PURE__ */ t("p", { children: e }) })
|
|
83
|
+
] }) : i;
|
|
84
|
+
};
|
|
85
|
+
c(
|
|
86
|
+
null
|
|
87
|
+
);
|
|
88
|
+
const _ = (e) => e in f, y = ({
|
|
89
|
+
className: e,
|
|
90
|
+
children: s
|
|
91
|
+
}) => {
|
|
92
|
+
const a = e?.match(/language-(\w+)/)?.[1], m = a && _(a) ? a : void 0;
|
|
93
|
+
let r = "";
|
|
94
|
+
return typeof s == "string" ? r = s : u(s) && typeof s.props.children == "string" && (r = s.props.children), !m ? /* @__PURE__ */ t("code", { className: "relative rounded bg-muted px-1.5 py-0.5 font-mono text-sm font-semibold", children: s }) : /* @__PURE__ */ t(
|
|
95
|
+
x,
|
|
96
|
+
{
|
|
97
|
+
code: r,
|
|
98
|
+
language: m,
|
|
99
|
+
className: "my-4 rounded-md border border-border",
|
|
100
|
+
children: /* @__PURE__ */ t(h, {})
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}, w = {
|
|
104
|
+
h1: ({ children: e }) => /* @__PURE__ */ t("h1", { className: "mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest", children: e }),
|
|
105
|
+
h2: ({ children: e }) => /* @__PURE__ */ t("h2", { className: "mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest", children: e }),
|
|
106
|
+
h3: ({ children: e }) => /* @__PURE__ */ t("h3", { className: "mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter", children: e }),
|
|
107
|
+
h4: ({ children: e }) => /* @__PURE__ */ t("h4", { className: "mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal", children: e }),
|
|
108
|
+
h5: ({ children: e }) => /* @__PURE__ */ t("h5", { className: "mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter", children: e }),
|
|
109
|
+
h6: ({ children: e }) => /* @__PURE__ */ t("h6", { className: "mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter", children: e }),
|
|
110
|
+
p: ({ children: e }) => /* @__PURE__ */ t("p", { className: "mt-2 mb-3 text-base font-normal leading-7 tracking-tightest", children: e }),
|
|
111
|
+
strong: ({ children: e }) => /* @__PURE__ */ t("strong", { className: "font-medium", children: e }),
|
|
112
|
+
em: ({ children: e }) => /* @__PURE__ */ t("em", { className: "italic", children: e }),
|
|
113
|
+
ul: ({ children: e }) => /* @__PURE__ */ t("ul", { className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest", children: e }),
|
|
114
|
+
ol: ({ children: e }) => /* @__PURE__ */ t("ol", { className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest", children: e }),
|
|
115
|
+
li: ({ children: e }) => /* @__PURE__ */ t("li", { className: "py-0", children: e }),
|
|
116
|
+
blockquote: ({ children: e }) => /* @__PURE__ */ t("blockquote", { className: "my-3 pr-2 pl-2 border-l border-l-border text-sm text-muted-foreground font-normal tracking-tight not-italic", children: e }),
|
|
117
|
+
hr: () => /* @__PURE__ */ t("hr", { className: "my-4 border-border" }),
|
|
118
|
+
a: ({
|
|
119
|
+
children: e,
|
|
120
|
+
href: s,
|
|
121
|
+
...o
|
|
122
|
+
}) => /* @__PURE__ */ t(
|
|
123
|
+
"a",
|
|
124
|
+
{
|
|
125
|
+
className: "text-foreground-link no-underline hover:underline underline-offset-4",
|
|
126
|
+
href: s,
|
|
127
|
+
...o,
|
|
128
|
+
children: e
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
table: ({ children: e }) => /* @__PURE__ */ t("table", { className: "my-6 w-full", children: e }),
|
|
132
|
+
thead: ({ children: e }) => /* @__PURE__ */ t("thead", { children: e }),
|
|
133
|
+
tbody: ({ children: e }) => /* @__PURE__ */ t("tbody", { children: e }),
|
|
134
|
+
tr: ({ children: e }) => /* @__PURE__ */ t("tr", { className: "m-0 border-t p-0 even:bg-muted", children: e }),
|
|
135
|
+
th: ({ children: e }) => /* @__PURE__ */ t("th", { className: "border px-4 py-2 text-left font-bold", children: e }),
|
|
136
|
+
td: ({ children: e }) => /* @__PURE__ */ t("td", { className: "border px-4 py-2 text-left", children: e }),
|
|
137
|
+
code: y
|
|
138
|
+
}, C = g(
|
|
139
|
+
({ className: e, components: s, ...o }) => /* @__PURE__ */ t(
|
|
140
|
+
p,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "message-response",
|
|
143
|
+
className: l(
|
|
144
|
+
"size-full",
|
|
145
|
+
'[&_div[data-streamdown="mermaid-block"]_.relative.w-full]:min-h-28',
|
|
146
|
+
'[&_div[data-streamdown="mermaid-block"]_>div>.fixed]:z-200',
|
|
147
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:fixed',
|
|
148
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:top-4',
|
|
149
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:bottom-auto',
|
|
150
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:left-4',
|
|
151
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:z-201',
|
|
152
|
+
"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
153
|
+
e
|
|
154
|
+
),
|
|
155
|
+
components: { ...w, ...s },
|
|
156
|
+
controls: !1,
|
|
157
|
+
...o
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
(e, s) => e.children === s.children
|
|
161
|
+
);
|
|
162
|
+
C.displayName = "MessageResponse";
|
|
163
|
+
export {
|
|
164
|
+
V as Message,
|
|
165
|
+
G as MessageAction,
|
|
166
|
+
F as MessageActions,
|
|
167
|
+
D as MessageContent,
|
|
168
|
+
C as MessageResponse
|
|
169
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
2
|
+
declare function Popover(props: PopoverPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace Popover {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
6
|
+
declare function PopoverTrigger({ children, ...props }: PopoverPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const PopoverContent: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').PopoverPopupProps & Pick<import('@base-ui/react').PopoverPositionerProps, "align" | "alignOffset" | "side" | "sideOffset">, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Popover, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { ComponentProps, HTMLAttributes, PropsWithChildren, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { ChatStatus } from '../../../../lib/ai/types';
|
|
3
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '../command/command';
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem } from '../dropdown-menu/dropdown-menu';
|
|
5
|
+
import { HoverCard, HoverCardContent, HoverCardTrigger } from '../hover-card/hover-card';
|
|
6
|
+
import { InputGroupAddon, InputGroupButton } from '../input-group/input-group';
|
|
7
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../select/select';
|
|
8
|
+
type TextInputContext = {
|
|
9
|
+
value: string;
|
|
10
|
+
setInput: (v: string) => void;
|
|
11
|
+
clear: () => void;
|
|
12
|
+
};
|
|
13
|
+
type PromptInputControllerProps = {
|
|
14
|
+
textInput: TextInputContext;
|
|
15
|
+
};
|
|
16
|
+
declare const usePromptInputController: () => PromptInputControllerProps;
|
|
17
|
+
type PromptInputProviderProps = PropsWithChildren<{
|
|
18
|
+
initialInput?: string;
|
|
19
|
+
}>;
|
|
20
|
+
declare function PromptInputProvider({ initialInput: initialTextInput, children, }: PromptInputProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare namespace PromptInputProvider {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
type PromptInputMessage = {
|
|
25
|
+
text?: string;
|
|
26
|
+
};
|
|
27
|
+
type PromptInputProps = Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit'> & {
|
|
28
|
+
onSubmit: (message: PromptInputMessage, event: SyntheticEvent<HTMLFormElement>) => void | Promise<void>;
|
|
29
|
+
helperText?: ReactNode | false;
|
|
30
|
+
errorMessage?: string;
|
|
31
|
+
};
|
|
32
|
+
declare const PromptInput: {
|
|
33
|
+
({ className, onSubmit, helperText, errorMessage, children, ...props }: PromptInputProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
37
|
+
declare const PromptInputBody: import('react').ForwardRefExoticComponent<PromptInputBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
38
|
+
declare const PromptInputTextarea: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
39
|
+
type PromptInputHeaderProps = Omit<ComponentProps<typeof InputGroupAddon>, 'align'>;
|
|
40
|
+
declare const PromptInputHeader: import('react').ForwardRefExoticComponent<Omit<PromptInputHeaderProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
41
|
+
type PromptInputFooterProps = Omit<ComponentProps<typeof InputGroupAddon>, 'align'>;
|
|
42
|
+
declare const PromptInputFooter: import('react').ForwardRefExoticComponent<Omit<PromptInputFooterProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
43
|
+
type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;
|
|
44
|
+
declare const PromptInputTools: import('react').ForwardRefExoticComponent<PromptInputToolsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
45
|
+
type PromptInputButtonProps = ComponentProps<typeof InputGroupButton>;
|
|
46
|
+
declare const PromptInputButton: import('react').ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import('@base-ui/react').ButtonProps & import('class-variance-authority').VariantProps<(props?: ({
|
|
47
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
48
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
49
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "size"> & import('class-variance-authority').VariantProps<(props?: ({
|
|
50
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
51
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & import('react').RefAttributes<HTMLElement>, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
52
|
+
type PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;
|
|
53
|
+
declare const PromptInputActionMenu: {
|
|
54
|
+
(props: PromptInputActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
type PromptInputActionMenuTriggerProps = PromptInputButtonProps;
|
|
58
|
+
declare const PromptInputActionMenuTrigger: {
|
|
59
|
+
({ className, children, ...props }: PromptInputActionMenuTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
displayName: string;
|
|
61
|
+
};
|
|
62
|
+
type PromptInputActionMenuContentProps = ComponentProps<typeof DropdownMenuContent>;
|
|
63
|
+
declare const PromptInputActionMenuContent: {
|
|
64
|
+
({ className, ...props }: PromptInputActionMenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
displayName: string;
|
|
66
|
+
};
|
|
67
|
+
type PromptInputActionMenuItemProps = ComponentProps<typeof DropdownMenuItem>;
|
|
68
|
+
declare const PromptInputActionMenuItem: {
|
|
69
|
+
({ className, ...props }: PromptInputActionMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
displayName: string;
|
|
71
|
+
};
|
|
72
|
+
type PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {
|
|
73
|
+
status?: ChatStatus;
|
|
74
|
+
};
|
|
75
|
+
declare const PromptInputSubmit: import('react').ForwardRefExoticComponent<Omit<PromptInputSubmitProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
76
|
+
type PromptInputModelSelectProps = ComponentProps<typeof Select>;
|
|
77
|
+
declare const PromptInputModelSelect: {
|
|
78
|
+
(props: PromptInputModelSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
displayName: string;
|
|
80
|
+
};
|
|
81
|
+
type PromptInputModelSelectTriggerProps = ComponentProps<typeof SelectTrigger>;
|
|
82
|
+
declare const PromptInputModelSelectTrigger: {
|
|
83
|
+
({ className, ...props }: PromptInputModelSelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
displayName: string;
|
|
85
|
+
};
|
|
86
|
+
type PromptInputModelSelectContentProps = ComponentProps<typeof SelectContent>;
|
|
87
|
+
declare const PromptInputModelSelectContent: {
|
|
88
|
+
({ className, ...props }: PromptInputModelSelectContentProps): import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
91
|
+
type PromptInputModelSelectItemProps = ComponentProps<typeof SelectItem>;
|
|
92
|
+
declare const PromptInputModelSelectItem: {
|
|
93
|
+
({ className, ...props }: PromptInputModelSelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
displayName: string;
|
|
95
|
+
};
|
|
96
|
+
type PromptInputModelSelectValueProps = ComponentProps<typeof SelectValue>;
|
|
97
|
+
declare const PromptInputModelSelectValue: {
|
|
98
|
+
({ className, ...props }: PromptInputModelSelectValueProps): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
displayName: string;
|
|
100
|
+
};
|
|
101
|
+
type PromptInputHoverCardProps = ComponentProps<typeof HoverCard>;
|
|
102
|
+
declare const PromptInputHoverCard: {
|
|
103
|
+
({ openDelay, closeDelay, ...props }: PromptInputHoverCardProps): import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
displayName: string;
|
|
105
|
+
};
|
|
106
|
+
type PromptInputHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;
|
|
107
|
+
declare const PromptInputHoverCardTrigger: {
|
|
108
|
+
(props: PromptInputHoverCardTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
displayName: string;
|
|
110
|
+
};
|
|
111
|
+
type PromptInputHoverCardContentProps = ComponentProps<typeof HoverCardContent>;
|
|
112
|
+
declare const PromptInputHoverCardContent: {
|
|
113
|
+
({ align, ...props }: PromptInputHoverCardContentProps): import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
displayName: string;
|
|
115
|
+
};
|
|
116
|
+
type PromptInputTabsListProps = HTMLAttributes<HTMLDivElement>;
|
|
117
|
+
declare const PromptInputTabsList: import('react').ForwardRefExoticComponent<PromptInputTabsListProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
118
|
+
type PromptInputTabProps = HTMLAttributes<HTMLDivElement>;
|
|
119
|
+
declare const PromptInputTab: import('react').ForwardRefExoticComponent<PromptInputTabProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
120
|
+
type PromptInputTabLabelProps = HTMLAttributes<HTMLHeadingElement>;
|
|
121
|
+
declare const PromptInputTabLabel: import('react').ForwardRefExoticComponent<PromptInputTabLabelProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
122
|
+
type PromptInputTabBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
123
|
+
declare const PromptInputTabBody: import('react').ForwardRefExoticComponent<PromptInputTabBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
124
|
+
type PromptInputTabItemProps = HTMLAttributes<HTMLDivElement>;
|
|
125
|
+
declare const PromptInputTabItem: import('react').ForwardRefExoticComponent<PromptInputTabItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
126
|
+
type PromptInputCommandProps = ComponentProps<typeof Command>;
|
|
127
|
+
declare const PromptInputCommand: {
|
|
128
|
+
({ className, ...props }: PromptInputCommandProps): import("react/jsx-runtime").JSX.Element;
|
|
129
|
+
displayName: string;
|
|
130
|
+
};
|
|
131
|
+
type PromptInputCommandInputProps = ComponentProps<typeof CommandInput>;
|
|
132
|
+
declare const PromptInputCommandInput: {
|
|
133
|
+
({ className, ...props }: PromptInputCommandInputProps): import("react/jsx-runtime").JSX.Element;
|
|
134
|
+
displayName: string;
|
|
135
|
+
};
|
|
136
|
+
type PromptInputCommandListProps = ComponentProps<typeof CommandList>;
|
|
137
|
+
declare const PromptInputCommandList: {
|
|
138
|
+
({ className, ...props }: PromptInputCommandListProps): import("react/jsx-runtime").JSX.Element;
|
|
139
|
+
displayName: string;
|
|
140
|
+
};
|
|
141
|
+
type PromptInputCommandEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
142
|
+
declare const PromptInputCommandEmpty: {
|
|
143
|
+
({ className, ...props }: PromptInputCommandEmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
144
|
+
displayName: string;
|
|
145
|
+
};
|
|
146
|
+
type PromptInputCommandGroupProps = ComponentProps<typeof CommandGroup>;
|
|
147
|
+
declare const PromptInputCommandGroup: {
|
|
148
|
+
({ className, ...props }: PromptInputCommandGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
displayName: string;
|
|
150
|
+
};
|
|
151
|
+
type PromptInputCommandItemProps = ComponentProps<typeof CommandItem>;
|
|
152
|
+
declare const PromptInputCommandItem: {
|
|
153
|
+
({ className, ...props }: PromptInputCommandItemProps): import("react/jsx-runtime").JSX.Element;
|
|
154
|
+
displayName: string;
|
|
155
|
+
};
|
|
156
|
+
type PromptInputCommandSeparatorProps = ComponentProps<typeof CommandSeparator>;
|
|
157
|
+
declare const PromptInputCommandSeparator: {
|
|
158
|
+
({ className, ...props }: PromptInputCommandSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
159
|
+
displayName: string;
|
|
160
|
+
};
|
|
161
|
+
export { usePromptInputController, PromptInputProvider, PromptInput, PromptInputBody, PromptInputTextarea, PromptInputHeader, PromptInputFooter, PromptInputTools, PromptInputButton, PromptInputActionMenu, PromptInputActionMenuTrigger, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputSubmit, PromptInputModelSelect, PromptInputModelSelectTrigger, PromptInputModelSelectContent, PromptInputModelSelectItem, PromptInputModelSelectValue, PromptInputHoverCard, PromptInputHoverCardTrigger, PromptInputHoverCardContent, PromptInputTabsList, PromptInputTab, PromptInputTabLabel, PromptInputTabBody, PromptInputTabItem, PromptInputCommand, PromptInputCommandInput, PromptInputCommandList, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandItem, PromptInputCommandSeparator, };
|