@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.
@@ -1,22 +1,23 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { createContext as c, forwardRef as s, useContext as p, useMemo as f } from "react";
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 { getPortalContainer as g, cn as v } from "../../../../lib/utils.js";
5
- const m = c(null);
6
- function u({
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 = f(
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
- u.displayName = "HoverCard";
18
- const C = s(({ children: o, ...e }, a) => {
19
- const r = p(m), { delay: n, closeDelay: i, ...l } = e;
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
- ...l,
28
+ ...s,
28
29
  children: o
29
30
  }
30
31
  );
31
32
  });
32
- C.displayName = "HoverCardTrigger";
33
- const h = s(
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
- }, l) => /* @__PURE__ */ t(
42
- d.Portal,
43
- {
44
- "data-slot": "hover-card-portal",
45
- container: g(),
46
- children: /* @__PURE__ */ t(
47
- d.Positioner,
48
- {
49
- align: r,
50
- alignOffset: n,
51
- side: e,
52
- sideOffset: a,
53
- className: "isolate z-50",
54
- children: /* @__PURE__ */ t(
55
- d.Popup,
56
- {
57
- ref: l,
58
- "data-slot": "hover-card-content",
59
- className: v(
60
- "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",
61
- o
62
- ),
63
- ...i
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
- h.displayName = "HoverCardContent";
75
+ y.displayName = "HoverCardContent";
72
76
  export {
73
- u as HoverCard,
74
- h as HoverCardContent,
75
- C as HoverCardTrigger
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, InlineCitationGroup, InlineCitationText, InlineCitationCard, InlineCitationCardTrigger, InlineCitationCardBody, InlineCitationSource, InlineCitationQuote, InlineCitationLink, };
33
+ export { InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationGroup, InlineCitationLink, InlineCitationQuote, InlineCitationSource, InlineCitationText, };
@@ -1,169 +1,240 @@
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";
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 { bundledLanguages as f } from "shiki";
5
- import { Streamdown as p } from "streamdown";
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 b } from "../button/button.js";
7
+ import { Button as p } from "../button/button.js";
9
8
  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(
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: l(
14
+ className: d(
17
15
  "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
16
+ o ? "is-assistant items-start" : "is-user flex-row-reverse",
17
+ t
20
18
  ),
21
- ...o
19
+ ...a
22
20
  }
23
- ), D = ({
24
- children: e,
25
- className: s,
26
- ...o
27
- }) => /* @__PURE__ */ t(
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: l(
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
- s
34
+ o
37
35
  ),
38
- ...o,
39
- children: e
36
+ ...a,
37
+ children: t
40
38
  }
41
- ), F = ({
42
- className: e,
43
- children: s,
44
- ...o
45
- }) => /* @__PURE__ */ t(
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: l("flex items-center gap-2", e),
50
- ...o,
51
- children: s
47
+ className: d("flex items-center gap-2", t),
48
+ ...a,
49
+ children: o
52
50
  }
53
- ), G = ({
54
- tooltip: e,
55
- children: s,
56
- label: o,
57
- className: a,
51
+ ), A = ({
52
+ tooltip: t,
53
+ children: o,
54
+ label: a,
55
+ className: n,
58
56
  variant: m = "ghost",
59
- size: r = "sm",
60
- ...n
57
+ size: c = "sm",
58
+ ...l
61
59
  }) => {
62
- const i = /* @__PURE__ */ d(
63
- b,
60
+ const r = /* @__PURE__ */ s(
61
+ p,
64
62
  {
65
63
  "data-slot": "message-action",
66
- className: l(
64
+ className: d(
67
65
  "relative icon-sm text-muted-foreground hover:text-foreground",
68
- a
66
+ n
69
67
  ),
70
- size: r,
68
+ size: c,
71
69
  type: "button",
72
70
  variant: m,
73
- ...n,
71
+ ...l,
74
72
  children: [
75
- s,
76
- /* @__PURE__ */ t("span", { className: "sr-only", children: o || e })
73
+ o,
74
+ /* @__PURE__ */ e("span", { className: "sr-only", children: a || t })
77
75
  ]
78
76
  }
79
77
  );
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;
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
- c(
83
+ i(
86
84
  null
87
85
  );
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" }),
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: e,
120
- href: s,
121
- ...o
122
- }) => /* @__PURE__ */ t(
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: s,
127
- ...o,
128
- children: e
111
+ href: o,
112
+ ...a,
113
+ children: t
129
114
  }
130
115
  ),
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,
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: l(
127
+ className: d(
144
128
  "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
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: { ...w, ...s },
226
+ components: { ...f, ...o },
156
227
  controls: !1,
157
- ...o
228
+ ...a
158
229
  }
159
230
  ),
160
- (e, s) => e.children === s.children
231
+ (t, o) => t.children === o.children
161
232
  );
162
- C.displayName = "MessageResponse";
233
+ k.displayName = "MessageResponse";
163
234
  export {
164
- V as Message,
165
- G as MessageAction,
166
- F as MessageActions,
167
- D as MessageContent,
168
- C as MessageResponse
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
+ };