@cognite/aura 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +239 -0
- package/dist/components/ui/core/dialog/dialog.js +21 -19
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +40 -38
- package/dist/components/ui/core/hover-card/hover-card.js +48 -44
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +2 -2
- package/dist/components/ui/core/message/message.js +187 -116
- package/dist/components/ui/core/popover/popover.js +55 -0
- package/dist/components/ui/core/select/select.js +37 -35
- package/dist/components/ui/core/sources/sources.js +68 -0
- package/dist/components/ui/core/tooltip/tooltip.js +42 -38
- package/dist/index.js +47 -37
- package/dist/lib/portal-container-context.d.ts +2 -0
- package/dist/lib/portal-container-context.js +12 -0
- package/dist/lib/utils.js +44 -30
- package/dist/styles.css +1 -0
- package/package.json +12 -4
- package/dist/components/ui/lab/breadcrumb/breadcrumb.d.ts +0 -134
- package/dist/components/ui/lab/breadcrumb/breadcrumb.metadata.d.ts +0 -2
- package/dist/components/ui/lab/topbar/topbar.d.ts +0 -10
- package/dist/components/ui/lab/topbar/topbar.metadata.d.ts +0 -2
- package/dist/lib/component-status-config.d.ts +0 -12
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
2
|
+
import { createContext as p, forwardRef as l, useContext as f, useMemo as u } from "react";
|
|
3
3
|
import { PreviewCard as d } from "@base-ui/react/preview-card";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { usePortalContainer as v } from "../../../../lib/portal-container-context.js";
|
|
5
|
+
import { cn as g } from "../../../../lib/utils.js";
|
|
6
|
+
const m = p(null);
|
|
7
|
+
function C({
|
|
7
8
|
openDelay: o,
|
|
8
9
|
closeDelay: e,
|
|
9
10
|
...a
|
|
10
11
|
}) {
|
|
11
|
-
const r =
|
|
12
|
+
const r = u(
|
|
12
13
|
() => ({ openDelay: o, closeDelay: e }),
|
|
13
14
|
[o, e]
|
|
14
15
|
);
|
|
15
16
|
return /* @__PURE__ */ t(m.Provider, { value: r, children: /* @__PURE__ */ t(d.Root, { "data-slot": "hover-card", ...a }) });
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const r =
|
|
18
|
+
C.displayName = "HoverCard";
|
|
19
|
+
const h = l(({ children: o, ...e }, a) => {
|
|
20
|
+
const r = f(m), { delay: n, closeDelay: i, ...s } = e;
|
|
20
21
|
return /* @__PURE__ */ t(
|
|
21
22
|
d.Trigger,
|
|
22
23
|
{
|
|
@@ -24,13 +25,13 @@ const C = s(({ children: o, ...e }, a) => {
|
|
|
24
25
|
"data-slot": "hover-card-trigger",
|
|
25
26
|
delay: n ?? r?.openDelay,
|
|
26
27
|
closeDelay: i ?? r?.closeDelay,
|
|
27
|
-
...
|
|
28
|
+
...s,
|
|
28
29
|
children: o
|
|
29
30
|
}
|
|
30
31
|
);
|
|
31
32
|
});
|
|
32
|
-
|
|
33
|
-
const
|
|
33
|
+
h.displayName = "HoverCardTrigger";
|
|
34
|
+
const y = l(
|
|
34
35
|
({
|
|
35
36
|
className: o,
|
|
36
37
|
side: e = "bottom",
|
|
@@ -38,39 +39,42 @@ const h = s(
|
|
|
38
39
|
align: r = "center",
|
|
39
40
|
alignOffset: n = 4,
|
|
40
41
|
...i
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
42
|
+
}, s) => {
|
|
43
|
+
const c = v();
|
|
44
|
+
return /* @__PURE__ */ t(
|
|
45
|
+
d.Portal,
|
|
46
|
+
{
|
|
47
|
+
"data-slot": "hover-card-portal",
|
|
48
|
+
container: c,
|
|
49
|
+
children: /* @__PURE__ */ t(
|
|
50
|
+
d.Positioner,
|
|
51
|
+
{
|
|
52
|
+
align: r,
|
|
53
|
+
alignOffset: n,
|
|
54
|
+
side: e,
|
|
55
|
+
sideOffset: a,
|
|
56
|
+
className: "isolate z-50",
|
|
57
|
+
children: /* @__PURE__ */ t(
|
|
58
|
+
d.Popup,
|
|
59
|
+
{
|
|
60
|
+
ref: s,
|
|
61
|
+
"data-slot": "hover-card-content",
|
|
62
|
+
className: g(
|
|
63
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-[var(--transform-origin)] rounded-md border p-4 shadow-md outline-none",
|
|
64
|
+
o
|
|
65
|
+
),
|
|
66
|
+
...i
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
70
74
|
);
|
|
71
|
-
|
|
75
|
+
y.displayName = "HoverCardContent";
|
|
72
76
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
C as HoverCard,
|
|
78
|
+
y as HoverCardContent,
|
|
79
|
+
h as HoverCardTrigger
|
|
76
80
|
};
|
|
@@ -22,7 +22,7 @@ type InlineCitationSourceProps = ComponentProps<'div'> & {
|
|
|
22
22
|
};
|
|
23
23
|
declare const InlineCitationSource: import('react').ForwardRefExoticComponent<Omit<InlineCitationSourceProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
24
|
declare const InlineCitationQuote: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, "ref"> & import('react').RefAttributes<HTMLQuoteElement>>;
|
|
25
|
-
type InlineCitationLinkProps = Omit<ComponentProps<'a'>, 'target'> & {
|
|
25
|
+
export type InlineCitationLinkProps = Omit<ComponentProps<'a'>, 'target'> & {
|
|
26
26
|
target?: '_blank' | '_self';
|
|
27
27
|
icon?: ComponentType<{
|
|
28
28
|
className?: string;
|
|
@@ -30,4 +30,4 @@ type InlineCitationLinkProps = Omit<ComponentProps<'a'>, 'target'> & {
|
|
|
30
30
|
variant?: 'mountain' | 'nordic' | 'fjord';
|
|
31
31
|
};
|
|
32
32
|
declare const InlineCitationLink: import('react').ForwardRefExoticComponent<Omit<InlineCitationLinkProps, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
33
|
-
export { InlineCitation,
|
|
33
|
+
export { InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationGroup, InlineCitationLink, InlineCitationQuote, InlineCitationSource, InlineCitationText, };
|
|
@@ -1,169 +1,240 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as i, memo as b } from "react";
|
|
3
3
|
import "@tabler/icons-react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { cn as l } from "../../../../lib/utils.js";
|
|
4
|
+
import { Streamdown as _ } from "streamdown";
|
|
5
|
+
import { cn as d } from "../../../../lib/utils.js";
|
|
7
6
|
import "../avatar/avatar.js";
|
|
8
|
-
import { Button as
|
|
7
|
+
import { Button as p } from "../button/button.js";
|
|
9
8
|
import "../button-group/button-group.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const V = ({ className: e, isResponse: s = !1, ...o }) => /* @__PURE__ */ t(
|
|
9
|
+
import { Tooltip as u, TooltipTrigger as w, TooltipContent as g } from "../tooltip/tooltip.js";
|
|
10
|
+
const T = ({ className: t, isResponse: o = !1, ...a }) => /* @__PURE__ */ e(
|
|
13
11
|
"div",
|
|
14
12
|
{
|
|
15
13
|
"data-slot": "message",
|
|
16
|
-
className:
|
|
14
|
+
className: d(
|
|
17
15
|
"group flex w-full items-start justify-start gap-3 py-2 mb-0",
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
o ? "is-assistant items-start" : "is-user flex-row-reverse",
|
|
17
|
+
t
|
|
20
18
|
),
|
|
21
|
-
...
|
|
19
|
+
...a
|
|
22
20
|
}
|
|
23
|
-
),
|
|
24
|
-
children:
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
27
|
-
}) => /* @__PURE__ */
|
|
21
|
+
), R = ({
|
|
22
|
+
children: t,
|
|
23
|
+
className: o,
|
|
24
|
+
...a
|
|
25
|
+
}) => /* @__PURE__ */ e(
|
|
28
26
|
"div",
|
|
29
27
|
{
|
|
30
28
|
"data-slot": "message-content",
|
|
31
|
-
className:
|
|
29
|
+
className: d(
|
|
32
30
|
"is-user:dark flex flex-col gap-1 overflow-hidden rounded-md text-base leading-tight tracking-tightest",
|
|
33
31
|
"max-w-4/5",
|
|
34
32
|
"group-[.is-user]:bg-accent group-[.is-user]:p-2 group-[.is-user]:text-accent-foreground",
|
|
35
33
|
"group-[.is-assistant]:text-foreground group-[.is-assistant]:pt-1",
|
|
36
|
-
|
|
34
|
+
o
|
|
37
35
|
),
|
|
38
|
-
...
|
|
39
|
-
children:
|
|
36
|
+
...a,
|
|
37
|
+
children: t
|
|
40
38
|
}
|
|
41
|
-
),
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
44
|
-
...
|
|
45
|
-
}) => /* @__PURE__ */
|
|
39
|
+
), z = ({
|
|
40
|
+
className: t,
|
|
41
|
+
children: o,
|
|
42
|
+
...a
|
|
43
|
+
}) => /* @__PURE__ */ e(
|
|
46
44
|
"div",
|
|
47
45
|
{
|
|
48
46
|
"data-slot": "message-actions",
|
|
49
|
-
className:
|
|
50
|
-
...
|
|
51
|
-
children:
|
|
47
|
+
className: d("flex items-center gap-2", t),
|
|
48
|
+
...a,
|
|
49
|
+
children: o
|
|
52
50
|
}
|
|
53
|
-
),
|
|
54
|
-
tooltip:
|
|
55
|
-
children:
|
|
56
|
-
label:
|
|
57
|
-
className:
|
|
51
|
+
), A = ({
|
|
52
|
+
tooltip: t,
|
|
53
|
+
children: o,
|
|
54
|
+
label: a,
|
|
55
|
+
className: n,
|
|
58
56
|
variant: m = "ghost",
|
|
59
|
-
size:
|
|
60
|
-
...
|
|
57
|
+
size: c = "sm",
|
|
58
|
+
...l
|
|
61
59
|
}) => {
|
|
62
|
-
const
|
|
63
|
-
|
|
60
|
+
const r = /* @__PURE__ */ s(
|
|
61
|
+
p,
|
|
64
62
|
{
|
|
65
63
|
"data-slot": "message-action",
|
|
66
|
-
className:
|
|
64
|
+
className: d(
|
|
67
65
|
"relative icon-sm text-muted-foreground hover:text-foreground",
|
|
68
|
-
|
|
66
|
+
n
|
|
69
67
|
),
|
|
70
|
-
size:
|
|
68
|
+
size: c,
|
|
71
69
|
type: "button",
|
|
72
70
|
variant: m,
|
|
73
|
-
...
|
|
71
|
+
...l,
|
|
74
72
|
children: [
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */
|
|
73
|
+
o,
|
|
74
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: a || t })
|
|
77
75
|
]
|
|
78
76
|
}
|
|
79
77
|
);
|
|
80
|
-
return
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
] }) :
|
|
78
|
+
return t ? /* @__PURE__ */ s(u, { children: [
|
|
79
|
+
/* @__PURE__ */ e(w, { render: r }),
|
|
80
|
+
/* @__PURE__ */ e(g, { children: /* @__PURE__ */ e("p", { children: t }) })
|
|
81
|
+
] }) : r;
|
|
84
82
|
};
|
|
85
|
-
|
|
83
|
+
i(
|
|
86
84
|
null
|
|
87
85
|
);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
children:
|
|
91
|
-
}) => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
)
|
|
103
|
-
},
|
|
104
|
-
|
|
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" }),
|
|
86
|
+
const f = {
|
|
87
|
+
h1: ({ children: t }) => /* @__PURE__ */ e("h1", { className: "mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest", children: t }),
|
|
88
|
+
h2: ({ children: t }) => /* @__PURE__ */ e("h2", { className: "mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest", children: t }),
|
|
89
|
+
h3: ({ children: t }) => /* @__PURE__ */ e("h3", { className: "mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter", children: t }),
|
|
90
|
+
h4: ({ children: t }) => /* @__PURE__ */ e("h4", { className: "mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal", children: t }),
|
|
91
|
+
h5: ({ children: t }) => /* @__PURE__ */ e("h5", { className: "mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter", children: t }),
|
|
92
|
+
h6: ({ children: t }) => /* @__PURE__ */ e("h6", { className: "mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter", children: t }),
|
|
93
|
+
p: ({ children: t }) => /* @__PURE__ */ e("p", { className: "mt-2 mb-3 text-base font-normal leading-5 tracking-tightest", children: t }),
|
|
94
|
+
strong: ({ children: t }) => /* @__PURE__ */ e("strong", { className: "font-medium", children: t }),
|
|
95
|
+
em: ({ children: t }) => /* @__PURE__ */ e("em", { className: "italic", children: t }),
|
|
96
|
+
b: ({ children: t }) => /* @__PURE__ */ e("b", { className: "font-medium", children: t }),
|
|
97
|
+
i: ({ children: t }) => /* @__PURE__ */ e("i", { className: "italic", children: t }),
|
|
98
|
+
ul: ({ children: t }) => /* @__PURE__ */ e("ul", { className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest", children: t }),
|
|
99
|
+
ol: ({ children: t }) => /* @__PURE__ */ e("ol", { className: "ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest", children: t }),
|
|
100
|
+
li: ({ children: t }) => /* @__PURE__ */ e("li", { className: "py-0", children: t }),
|
|
101
|
+
blockquote: ({ children: t }) => /* @__PURE__ */ e("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: t }),
|
|
102
|
+
hr: () => /* @__PURE__ */ e("hr", { className: "my-4 border-border" }),
|
|
118
103
|
a: ({
|
|
119
|
-
children:
|
|
120
|
-
href:
|
|
121
|
-
...
|
|
122
|
-
}) => /* @__PURE__ */
|
|
104
|
+
children: t,
|
|
105
|
+
href: o,
|
|
106
|
+
...a
|
|
107
|
+
}) => /* @__PURE__ */ e(
|
|
123
108
|
"a",
|
|
124
109
|
{
|
|
125
110
|
className: "text-foreground-link no-underline hover:underline underline-offset-4",
|
|
126
|
-
href:
|
|
127
|
-
...
|
|
128
|
-
children:
|
|
111
|
+
href: o,
|
|
112
|
+
...a,
|
|
113
|
+
children: t
|
|
129
114
|
}
|
|
130
115
|
),
|
|
131
|
-
table: ({ children:
|
|
132
|
-
thead: ({ children:
|
|
133
|
-
tbody: ({ children:
|
|
134
|
-
tr: ({ children:
|
|
135
|
-
th: ({ children:
|
|
136
|
-
td: ({ children:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
p,
|
|
116
|
+
table: ({ children: t }) => /* @__PURE__ */ e("table", { className: "my-6 w-full", children: t }),
|
|
117
|
+
thead: ({ children: t }) => /* @__PURE__ */ e("thead", { children: t }),
|
|
118
|
+
tbody: ({ children: t }) => /* @__PURE__ */ e("tbody", { children: t }),
|
|
119
|
+
tr: ({ children: t }) => /* @__PURE__ */ e("tr", { className: "m-0 border-t p-0 even:bg-muted", children: t }),
|
|
120
|
+
th: ({ children: t }) => /* @__PURE__ */ e("th", { className: "border px-4 py-2 text-left font-bold", children: t }),
|
|
121
|
+
td: ({ children: t }) => /* @__PURE__ */ e("td", { className: "border px-4 py-2 text-left", children: t })
|
|
122
|
+
}, k = b(
|
|
123
|
+
({ className: t, components: o, ...a }) => /* @__PURE__ */ e(
|
|
124
|
+
_,
|
|
141
125
|
{
|
|
142
126
|
"data-slot": "message-response",
|
|
143
|
-
className:
|
|
127
|
+
className: d(
|
|
144
128
|
"size-full",
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"[
|
|
153
|
-
|
|
129
|
+
// Blockquote paragraph overrides
|
|
130
|
+
"[&_blockquote_p]:text-sm",
|
|
131
|
+
"[&_blockquote_p]:tracking-tight",
|
|
132
|
+
// Inline code
|
|
133
|
+
"[&_code]:relative",
|
|
134
|
+
"[&_code]:rounded",
|
|
135
|
+
"[&_code]:bg-muted",
|
|
136
|
+
"[&_code]:px-[0.3rem]",
|
|
137
|
+
"[&_code]:py-[0.2rem]",
|
|
138
|
+
"[&_code]:font-mono",
|
|
139
|
+
"[&_code]:text-sm",
|
|
140
|
+
"[&_code]:font-semibold",
|
|
141
|
+
// Code blocks (Streamdown container)
|
|
142
|
+
'[&_div[data-streamdown="code-block"]]:my-4',
|
|
143
|
+
'[&_div[data-streamdown="code-block"]]:w-full',
|
|
144
|
+
'[&_div[data-streamdown="code-block"]]:overflow-hidden',
|
|
145
|
+
'[&_div[data-streamdown="code-block"]]:rounded-xl',
|
|
146
|
+
'[&_div[data-streamdown="code-block"]]:border',
|
|
147
|
+
'[&_div[data-streamdown="code-block"]]:border-border',
|
|
148
|
+
// Code block header
|
|
149
|
+
'[&_div[data-streamdown="code-block-header"]]:flex',
|
|
150
|
+
'[&_div[data-streamdown="code-block-header"]]:items-center',
|
|
151
|
+
'[&_div[data-streamdown="code-block-header"]]:justify-between',
|
|
152
|
+
'[&_div[data-streamdown="code-block-header"]]:bg-muted/80',
|
|
153
|
+
'[&_div[data-streamdown="code-block-header"]]:px-4',
|
|
154
|
+
'[&_div[data-streamdown="code-block-header"]]:py-3',
|
|
155
|
+
'[&_div[data-streamdown="code-block-header"]]:text-xs',
|
|
156
|
+
'[&_div[data-streamdown="code-block-header"]]:text-muted-foreground',
|
|
157
|
+
// Pre element inside code block
|
|
158
|
+
'[&_div[data-streamdown="code-block"]_pre]:m-0',
|
|
159
|
+
'[&_div[data-streamdown="code-block"]_pre]:overflow-x-auto',
|
|
160
|
+
'[&_div[data-streamdown="code-block"]_pre]:border-t',
|
|
161
|
+
'[&_div[data-streamdown="code-block"]_pre]:border-border',
|
|
162
|
+
'[&_div[data-streamdown="code-block"]_pre]:bg-background!',
|
|
163
|
+
'[&_div[data-streamdown="code-block"]_pre]:p-4',
|
|
164
|
+
'[&_div[data-streamdown="code-block"]_pre]:text-sm',
|
|
165
|
+
'[&_div[data-streamdown="code-block"]_pre]:text-foreground!',
|
|
166
|
+
// Code element inside pre
|
|
167
|
+
'[&_div[data-streamdown="code-block"]_pre_code]:static',
|
|
168
|
+
'[&_div[data-streamdown="code-block"]_pre_code]:rounded-none',
|
|
169
|
+
'[&_div[data-streamdown="code-block"]_pre_code]:bg-transparent',
|
|
170
|
+
'[&_div[data-streamdown="code-block"]_pre_code]:p-0',
|
|
171
|
+
'[&_div[data-streamdown="code-block"]_pre_code]:font-mono',
|
|
172
|
+
'[&_div[data-streamdown="code-block"]_pre_code]:text-sm',
|
|
173
|
+
'[&_div[data-streamdown="code-block"]_pre_code]:font-normal',
|
|
174
|
+
// Code block buttons
|
|
175
|
+
'[&_button[data-streamdown="code-block-copy-button"]]:cursor-pointer',
|
|
176
|
+
'[&_button[data-streamdown="code-block-copy-button"]]:p-1',
|
|
177
|
+
'[&_button[data-streamdown="code-block-copy-button"]]:text-muted-foreground',
|
|
178
|
+
'[&_button[data-streamdown="code-block-copy-button"]]:transition-all',
|
|
179
|
+
'[&_button[data-streamdown="code-block-copy-button"]]:hover:text-foreground',
|
|
180
|
+
'[&_button[data-streamdown="code-block-download-button"]]:cursor-pointer',
|
|
181
|
+
'[&_button[data-streamdown="code-block-download-button"]]:p-1',
|
|
182
|
+
'[&_button[data-streamdown="code-block-download-button"]]:text-muted-foreground',
|
|
183
|
+
'[&_button[data-streamdown="code-block-download-button"]]:transition-all',
|
|
184
|
+
'[&_button[data-streamdown="code-block-download-button"]]:hover:text-foreground',
|
|
185
|
+
// Regular pre blocks (not in Streamdown code blocks)
|
|
186
|
+
"[&_pre:not([data-streamdown])]:my-3",
|
|
187
|
+
"[&_pre:not([data-streamdown])]:mx-0",
|
|
188
|
+
"[&_pre:not([data-streamdown])]:overflow-x-auto",
|
|
189
|
+
"[&_pre:not([data-streamdown])]:rounded-md",
|
|
190
|
+
"[&_pre:not([data-streamdown])]:border",
|
|
191
|
+
"[&_pre:not([data-streamdown])]:bg-card",
|
|
192
|
+
"[&_pre:not([data-streamdown])]:p-4",
|
|
193
|
+
"[&_pre:not([data-streamdown])]:text-foreground",
|
|
194
|
+
"[&_pre:not([data-streamdown])]:text-sm",
|
|
195
|
+
"[&_pre:not([data-streamdown])_code]:static",
|
|
196
|
+
"[&_pre:not([data-streamdown])_code]:rounded-none",
|
|
197
|
+
"[&_pre:not([data-streamdown])_code]:bg-transparent",
|
|
198
|
+
"[&_pre:not([data-streamdown])_code]:px-0",
|
|
199
|
+
"[&_pre:not([data-streamdown])_code]:py-0",
|
|
200
|
+
"[&_pre:not([data-streamdown])_code]:font-mono",
|
|
201
|
+
"[&_pre:not([data-streamdown])_code]:text-sm",
|
|
202
|
+
"[&_pre:not([data-streamdown])_code]:font-normal",
|
|
203
|
+
// Mermaid diagram blocks
|
|
204
|
+
'[&_div[data-streamdown="mermaid-block"]]:bg-card',
|
|
205
|
+
'[&_div[data-streamdown="mermaid-block"]]:text-card-foreground',
|
|
206
|
+
'[&_div[data-streamdown="mermaid-block"]]:flex',
|
|
207
|
+
'[&_div[data-streamdown="mermaid-block"]]:flex-col',
|
|
208
|
+
'[&_div[data-streamdown="mermaid-block"]]:rounded-lg',
|
|
209
|
+
'[&_div[data-streamdown="mermaid-block"]]:hover:bg-accent',
|
|
210
|
+
'[&_div[data-streamdown="mermaid-block"]]:border-0',
|
|
211
|
+
// Ensure mermaid container is tall enough for the toolbar
|
|
212
|
+
'[&_div[data-streamdown="mermaid-block"]_.relative.w-full]:!min-h-28',
|
|
213
|
+
// Mermaid fullscreen overlay: boost z-index above eos footer (z-150)
|
|
214
|
+
'[&_div[data-streamdown="mermaid-block"]_>div>.fixed]:!z-[200]',
|
|
215
|
+
// Mermaid fullscreen toolbar: pin to viewport top-left (only in fullscreen via .inset-0)
|
|
216
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!fixed',
|
|
217
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!top-4',
|
|
218
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!bottom-auto',
|
|
219
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!right-auto',
|
|
220
|
+
'[&_div[data-streamdown="mermaid-block"]_.fixed.inset-0_.flex-col.absolute]:!left-4',
|
|
221
|
+
// First and last child margin resets
|
|
222
|
+
"[&>*:first-child]:mt-0",
|
|
223
|
+
"[&>*:last-child]:mb-0",
|
|
224
|
+
t
|
|
154
225
|
),
|
|
155
|
-
components: { ...
|
|
226
|
+
components: { ...f, ...o },
|
|
156
227
|
controls: !1,
|
|
157
|
-
...
|
|
228
|
+
...a
|
|
158
229
|
}
|
|
159
230
|
),
|
|
160
|
-
(
|
|
231
|
+
(t, o) => t.children === o.children
|
|
161
232
|
);
|
|
162
|
-
|
|
233
|
+
k.displayName = "MessageResponse";
|
|
163
234
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
235
|
+
T as Message,
|
|
236
|
+
A as MessageAction,
|
|
237
|
+
z as MessageActions,
|
|
238
|
+
R as MessageContent,
|
|
239
|
+
k as MessageResponse
|
|
169
240
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { Popover as t } from "@base-ui/react/popover";
|
|
4
|
+
import { usePortalContainer as l } from "../../../../lib/portal-container-context.js";
|
|
5
|
+
import { cn as f } from "../../../../lib/utils.js";
|
|
6
|
+
function c(o) {
|
|
7
|
+
return /* @__PURE__ */ r(t.Root, { "data-slot": "popover", ...o });
|
|
8
|
+
}
|
|
9
|
+
c.displayName = "Popover";
|
|
10
|
+
function z({
|
|
11
|
+
children: o,
|
|
12
|
+
...e
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ r(t.Trigger, { "data-slot": "popover-trigger", ...e, children: o });
|
|
15
|
+
}
|
|
16
|
+
const g = m(
|
|
17
|
+
({
|
|
18
|
+
className: o,
|
|
19
|
+
align: e = "center",
|
|
20
|
+
alignOffset: a = 0,
|
|
21
|
+
side: n = "bottom",
|
|
22
|
+
sideOffset: i = 4,
|
|
23
|
+
...d
|
|
24
|
+
}, p) => {
|
|
25
|
+
const s = l();
|
|
26
|
+
return /* @__PURE__ */ r(t.Portal, { container: s, children: /* @__PURE__ */ r(
|
|
27
|
+
t.Positioner,
|
|
28
|
+
{
|
|
29
|
+
align: e,
|
|
30
|
+
alignOffset: a,
|
|
31
|
+
side: n,
|
|
32
|
+
sideOffset: i,
|
|
33
|
+
className: "isolate z-50",
|
|
34
|
+
children: /* @__PURE__ */ r(
|
|
35
|
+
t.Popup,
|
|
36
|
+
{
|
|
37
|
+
ref: p,
|
|
38
|
+
"data-slot": "popover-content",
|
|
39
|
+
className: f(
|
|
40
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-[var(--transform-origin)] rounded-lg border border-border p-3 gap-2 shadow-md outline-none",
|
|
41
|
+
o
|
|
42
|
+
),
|
|
43
|
+
...d
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
) });
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
g.displayName = "PopoverContent";
|
|
51
|
+
export {
|
|
52
|
+
c as Popover,
|
|
53
|
+
g as PopoverContent,
|
|
54
|
+
z as PopoverTrigger
|
|
55
|
+
};
|