@arcadeai/design-system 3.33.2 → 3.34.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.
Files changed (45) hide show
  1. package/dist/components/index.js +595 -567
  2. package/dist/components/ui/atoms/avatar-notification-badge.d.ts +34 -0
  3. package/dist/components/ui/atoms/avatar-notification-badge.d.ts.map +1 -0
  4. package/dist/components/ui/atoms/avatar-notification-badge.js +78 -0
  5. package/dist/components/ui/atoms/index.d.ts +3 -0
  6. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  7. package/dist/components/ui/atoms/index.js +512 -504
  8. package/dist/components/ui/atoms/json-highlight.d.ts +60 -0
  9. package/dist/components/ui/atoms/json-highlight.d.ts.map +1 -0
  10. package/dist/components/ui/atoms/json-highlight.js +77 -0
  11. package/dist/components/ui/atoms/scroll-button.js +8 -8
  12. package/dist/components/ui/atoms/view-tools-control.d.ts +1 -1
  13. package/dist/components/ui/atoms/view-tools-control.d.ts.map +1 -1
  14. package/dist/components/ui/atoms/view-tools-control.js +20 -19
  15. package/dist/components/ui/index.js +595 -567
  16. package/dist/components/ui/molecules/chat-message-list.d.ts +5 -2
  17. package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -1
  18. package/dist/components/ui/molecules/chat-message-list.js +2 -2
  19. package/dist/components/ui/molecules/index.d.ts +8 -0
  20. package/dist/components/ui/molecules/index.d.ts.map +1 -1
  21. package/dist/components/ui/molecules/index.js +48 -28
  22. package/dist/components/ui/molecules/prompt-input.js +20 -20
  23. package/dist/components/ui/molecules/requirement-badges.js +8 -4
  24. package/dist/components/ui/molecules/switcher.d.ts +83 -0
  25. package/dist/components/ui/molecules/switcher.d.ts.map +1 -0
  26. package/dist/components/ui/molecules/switcher.js +164 -0
  27. package/dist/components/ui/molecules/tool-authorization.d.ts +56 -0
  28. package/dist/components/ui/molecules/tool-authorization.d.ts.map +1 -0
  29. package/dist/components/ui/molecules/tool-authorization.js +160 -0
  30. package/dist/components/ui/molecules/tool-call-accordion.d.ts +36 -0
  31. package/dist/components/ui/molecules/tool-call-accordion.d.ts.map +1 -0
  32. package/dist/components/ui/molecules/tool-call-accordion.js +301 -0
  33. package/dist/components/ui/molecules/toolkit-card.js +1 -1
  34. package/dist/components/ui/molecules/user-nav.d.ts +65 -0
  35. package/dist/components/ui/molecules/user-nav.d.ts.map +1 -0
  36. package/dist/components/ui/molecules/user-nav.js +154 -0
  37. package/dist/components/ui/pages/chat-page.d.ts +18 -10
  38. package/dist/components/ui/pages/chat-page.d.ts.map +1 -1
  39. package/dist/components/ui/pages/chat-page.js +328 -243
  40. package/dist/components/ui/templates/chat-template.d.ts +1 -1
  41. package/dist/components/ui/templates/chat-template.d.ts.map +1 -1
  42. package/dist/components/ui/templates/chat-template.js +11 -11
  43. package/dist/main.js +621 -593
  44. package/dist/{toolkit-card-k8jio69G.js → toolkit-card-DAgQXF93.js} +13 -10
  45. package/package.json +1 -1
@@ -0,0 +1,160 @@
1
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { c as d } from "../../../index-UgeK3A8s.js";
3
+ import { Card as m, CardContent as c, CardHeader as x } from "../atoms/card.js";
4
+ import { JsonHighlight as f } from "../atoms/json-highlight.js";
5
+ import { cn as o } from "../../../lib/utils.js";
6
+ const h = d("gap-0 py-0", {
7
+ variants: {
8
+ status: {
9
+ loading: "",
10
+ pending: "",
11
+ completed: "border-green-100 dark:border-green-950",
12
+ failed: "border-red-100 dark:border-red-950"
13
+ }
14
+ },
15
+ defaultVariants: { status: "loading" }
16
+ }), p = d("shrink-0 rounded-full p-2", {
17
+ variants: {
18
+ status: {
19
+ loading: "bg-muted",
20
+ pending: "bg-orange-50 dark:bg-orange-950/50",
21
+ completed: "bg-green-50 dark:bg-green-950/50",
22
+ failed: "bg-red-50 dark:bg-red-950/50"
23
+ }
24
+ },
25
+ defaultVariants: { status: "loading" }
26
+ }), b = d("size-5", {
27
+ variants: {
28
+ status: {
29
+ loading: "text-muted-foreground",
30
+ pending: "text-orange-500 dark:text-orange-400",
31
+ completed: "text-green-500 dark:text-green-400",
32
+ failed: "text-red-500 dark:text-red-400"
33
+ }
34
+ },
35
+ defaultVariants: { status: "loading" }
36
+ }), k = d(
37
+ "flex items-center gap-2 rounded-md p-3 text-xs",
38
+ {
39
+ variants: {
40
+ status: {
41
+ loading: "bg-muted text-muted-foreground",
42
+ pending: "bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300",
43
+ completed: "bg-green-50 text-green-700 dark:bg-green-950/50 dark:text-green-300",
44
+ failed: "bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300"
45
+ }
46
+ },
47
+ defaultVariants: { status: "loading" }
48
+ }
49
+ );
50
+ function C({
51
+ className: e,
52
+ status: a,
53
+ ...r
54
+ }) {
55
+ return /* @__PURE__ */ t(
56
+ m,
57
+ {
58
+ className: o(h({ status: a }), e),
59
+ "data-slot": "tool-authorization",
60
+ ...r
61
+ }
62
+ );
63
+ }
64
+ function T({
65
+ className: e,
66
+ status: a,
67
+ icon: r,
68
+ toolkitIcon: l,
69
+ title: s,
70
+ description: i,
71
+ children: g,
72
+ ...u
73
+ }) {
74
+ return /* @__PURE__ */ t(x, { className: "px-3 pt-3 pb-0", children: /* @__PURE__ */ n(
75
+ "div",
76
+ {
77
+ className: o("flex items-start gap-3 sm:items-center", e),
78
+ "data-slot": "tool-authorization-header",
79
+ ...u,
80
+ children: [
81
+ r && /* @__PURE__ */ t("div", { className: o(p({ status: a })), children: /* @__PURE__ */ t(
82
+ r,
83
+ {
84
+ className: o(b({ status: a }))
85
+ }
86
+ ) }),
87
+ (s || i) && /* @__PURE__ */ n("div", { children: [
88
+ s && /* @__PURE__ */ n("h3", { className: "flex items-center gap-1.5 font-medium text-card-foreground text-sm", children: [
89
+ l && /* @__PURE__ */ t(l, { className: "size-4 shrink-0" }),
90
+ s
91
+ ] }),
92
+ i && /* @__PURE__ */ t("p", { className: "mt-0.5 text-muted-foreground text-xs", children: i })
93
+ ] }),
94
+ g
95
+ ]
96
+ }
97
+ ) });
98
+ }
99
+ function j({
100
+ className: e,
101
+ ...a
102
+ }) {
103
+ return /* @__PURE__ */ t(c, { className: "p-3 pt-2", children: /* @__PURE__ */ t(
104
+ "div",
105
+ {
106
+ className: o("flex flex-col gap-2", e),
107
+ "data-slot": "tool-authorization-content",
108
+ ...a
109
+ }
110
+ ) });
111
+ }
112
+ function y({
113
+ className: e,
114
+ status: a,
115
+ ...r
116
+ }) {
117
+ return /* @__PURE__ */ t(
118
+ "div",
119
+ {
120
+ className: o(
121
+ k({ status: a }),
122
+ "items-start sm:items-center",
123
+ e
124
+ ),
125
+ "data-slot": "tool-authorization-message",
126
+ ...r
127
+ }
128
+ );
129
+ }
130
+ function H({
131
+ args: e,
132
+ className: a,
133
+ ...r
134
+ }) {
135
+ return Object.keys(e).length === 0 ? null : /* @__PURE__ */ n(
136
+ "div",
137
+ {
138
+ className: o("w-full rounded-lg bg-muted p-2 sm:p-2.5", a),
139
+ "data-slot": "tool-authorization-args",
140
+ ...r,
141
+ children: [
142
+ /* @__PURE__ */ t("h4", { className: "mb-1 font-medium text-xs", children: "Tool Arguments:" }),
143
+ /* @__PURE__ */ t(
144
+ f,
145
+ {
146
+ className: "text-[11px] sm:text-xs",
147
+ code: JSON.stringify(e, null, 2)
148
+ }
149
+ )
150
+ ]
151
+ }
152
+ );
153
+ }
154
+ export {
155
+ C as ToolAuthorization,
156
+ H as ToolAuthorizationArgs,
157
+ j as ToolAuthorizationContent,
158
+ T as ToolAuthorizationHeader,
159
+ y as ToolAuthorizationMessage
160
+ };
@@ -0,0 +1,36 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '../atoms/accordion';
3
+ import { ClassProp } from 'class-variance-authority/types';
4
+ import * as React from "react";
5
+ export type ToolCallView = "table" | "code";
6
+ export type ToolCallState = "calling" | "complete" | "error";
7
+ export type ToolCallAccordionProps = React.ComponentProps<typeof Accordion>;
8
+ export type ToolCallAccordionItemProps = React.ComponentProps<typeof AccordionItem>;
9
+ export type ToolCallAccordionTriggerProps = React.ComponentProps<typeof AccordionTrigger> & VariantProps<typeof toolCallAccordionTriggerVariants> & {
10
+ toolName: string;
11
+ icon?: React.ReactNode;
12
+ showStateIndicator?: boolean;
13
+ };
14
+ export type ToolCallAccordionContentProps = React.ComponentProps<typeof AccordionContent> & {
15
+ view?: ToolCallView;
16
+ onViewChange?: (view: ToolCallView) => void;
17
+ showViewToggle?: boolean;
18
+ args?: Record<string, unknown>;
19
+ result?: unknown;
20
+ };
21
+ declare const toolCallAccordionTriggerVariants: (props?: ({
22
+ state?: "error" | "complete" | "calling" | null | undefined;
23
+ } & ClassProp) | undefined) => string;
24
+ declare function ToolCallAccordion({ className, ...props }: ToolCallAccordionProps): import("react/jsx-runtime").JSX.Element;
25
+ declare function ToolCallAccordionItem({ className, ...props }: ToolCallAccordionItemProps): import("react/jsx-runtime").JSX.Element;
26
+ declare function ToolCallAccordionTrigger({ className, state, toolName, icon, showStateIndicator, ...props }: ToolCallAccordionTriggerProps): import("react/jsx-runtime").JSX.Element;
27
+ /**
28
+ * Expandable content area with a built-in table/JSON view toggle.
29
+ *
30
+ * Pass `args` and/or `result` as props to render the standard "Parameters"
31
+ * and "Response" sections. The active view is applied automatically.
32
+ * Additional content can be passed as `children`.
33
+ */
34
+ declare function ToolCallAccordionContent({ className, children, view: viewProp, onViewChange, showViewToggle, args, result, ...props }: ToolCallAccordionContentProps): import("react/jsx-runtime").JSX.Element;
35
+ export { ToolCallAccordion, ToolCallAccordionItem, ToolCallAccordionTrigger, ToolCallAccordionContent, };
36
+ //# sourceMappingURL=tool-call-accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-call-accordion.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/tool-call-accordion.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AASlE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EACjB,MAAM,iCAAiC,CAAC;AASzC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAE5E,MAAM,MAAM,0BAA0B,GAAG,KAAK,CAAC,cAAc,CAC3D,OAAO,aAAa,CACrB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,KAAK,CAAC,cAAc,CAC9D,OAAO,gBAAgB,CACxB,GACC,YAAY,CAAC,OAAO,gCAAgC,CAAC,GAAG;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEJ,MAAM,MAAM,6BAA6B,GAAG,KAAK,CAAC,cAAc,CAC9D,OAAO,gBAAgB,CACxB,GAAG;IACF,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAMF,QAAA,MAAM,gCAAgC;;8EAYrC,CAAC;AAmNF,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,2CAQzE;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,0BAA0B,2CAW5B;AAED,iBAAS,wBAAwB,CAAC,EAChC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,kBAAyB,EACzB,GAAG,KAAK,EACT,EAAE,6BAA6B,2CAyD/B;AAED;;;;;;GAMG;AACH,iBAAS,wBAAwB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,cAAqB,EACrB,IAAI,EACJ,MAAM,EACN,GAAG,KAAK,EACT,EAAE,6BAA6B,2CAkE/B;AAMD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,GACzB,CAAC"}
@@ -0,0 +1,301 @@
1
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
+ import { c as y } from "../../../index-UgeK3A8s.js";
3
+ import { Table as A, Code as T, Wrench as C, TriangleAlert as v, CheckCircle2 as S, Loader2 as V } from "lucide-react";
4
+ import * as c from "react";
5
+ import { Accordion as j, AccordionContent as z, AccordionItem as I, AccordionTrigger as O } from "../atoms/accordion.js";
6
+ import { CopyButton as E } from "../atoms/copy-button.js";
7
+ import { JsonHighlight as N } from "../atoms/json-highlight.js";
8
+ import { cn as l } from "../../../lib/utils.js";
9
+ const J = y(
10
+ "font-mono text-xs transition-colors",
11
+ {
12
+ variants: {
13
+ state: {
14
+ calling: "text-muted-foreground hover:text-foreground",
15
+ complete: "text-muted-foreground hover:text-foreground",
16
+ error: "text-destructive hover:text-destructive/80"
17
+ }
18
+ },
19
+ defaultVariants: { state: "calling" }
20
+ }
21
+ ), R = y(
22
+ "absolute -top-0.5 right-0 size-2 shrink-0 rounded-full ring-2 ring-background",
23
+ {
24
+ variants: {
25
+ state: {
26
+ calling: "animate-pulse bg-orange-400",
27
+ complete: "bg-green-500",
28
+ error: "bg-destructive"
29
+ }
30
+ },
31
+ defaultVariants: { state: "calling" }
32
+ }
33
+ );
34
+ function $(e, t = 140) {
35
+ return e.length > t ? `${e.slice(0, t).trimEnd()}...` : e;
36
+ }
37
+ function w(e) {
38
+ if (typeof e == "string")
39
+ try {
40
+ return JSON.stringify(JSON.parse(e), null, 2);
41
+ } catch {
42
+ return e;
43
+ }
44
+ return JSON.stringify(e, null, 2) ?? "null";
45
+ }
46
+ function D(e) {
47
+ if (typeof e == "string") {
48
+ try {
49
+ const t = JSON.parse(e);
50
+ if (typeof t == "object" && t !== null && !Array.isArray(t))
51
+ return t;
52
+ } catch {
53
+ return { value: e };
54
+ }
55
+ return { value: e };
56
+ }
57
+ return typeof e == "object" && e !== null && !Array.isArray(e) ? e : { value: e };
58
+ }
59
+ function H(e) {
60
+ if (typeof e == "string")
61
+ return $(e.replace(/\s+/g, " "));
62
+ if (typeof e == "number" || typeof e == "boolean" || e === null || e === void 0)
63
+ return String(e);
64
+ if (Array.isArray(e))
65
+ return `${e.length} item${e.length === 1 ? "" : "s"}`;
66
+ if (typeof e == "object") {
67
+ const t = Object.keys(e).length;
68
+ return `${t} field${t === 1 ? "" : "s"}`;
69
+ }
70
+ return String(e);
71
+ }
72
+ function M(e) {
73
+ return typeof e == "string" && e.length > 180 || Array.isArray(e) || typeof e == "object" && e !== null;
74
+ }
75
+ function h({
76
+ activeView: e,
77
+ panelView: t,
78
+ children: o,
79
+ lazy: i = !1
80
+ }) {
81
+ const s = e === t, [d, n] = c.useState(s || !i);
82
+ return c.useEffect(() => {
83
+ s && n(!0);
84
+ }, [s]), d ? /* @__PURE__ */ r("div", { className: l(!s && "hidden"), children: o }) : null;
85
+ }
86
+ function B({ label: e, value: t }) {
87
+ const [, o] = c.useTransition(), [i, s] = c.useState(!1), d = M(t);
88
+ return /* @__PURE__ */ a("div", { className: "grid gap-1 px-3 py-2.5 sm:grid-cols-[minmax(0,8rem)_minmax(0,1fr)] sm:gap-3", children: [
89
+ /* @__PURE__ */ r("dt", { className: "font-medium text-[11px] text-muted-foreground uppercase tracking-[0.08em]", children: e }),
90
+ /* @__PURE__ */ a("dd", { className: "min-w-0 space-y-2 text-foreground/90 text-xs", children: [
91
+ /* @__PURE__ */ r("span", { className: "wrap-break-word block whitespace-pre-wrap", children: H(t) }),
92
+ d && /* @__PURE__ */ r(
93
+ "button",
94
+ {
95
+ className: "inline-flex items-center rounded-md border border-border/60 px-2 py-1 font-medium text-[11px] text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground dark:border-white/10",
96
+ onClick: () => o(() => s((n) => !n)),
97
+ type: "button",
98
+ children: i ? "Show less" : "Show more"
99
+ }
100
+ ),
101
+ i && /* @__PURE__ */ r(
102
+ N,
103
+ {
104
+ className: "rounded-lg border border-border/60 bg-background/80 dark:border-white/10",
105
+ code: w(t)
106
+ }
107
+ )
108
+ ] })
109
+ ] });
110
+ }
111
+ const F = c.memo(function({ value: t }) {
112
+ const o = c.useMemo(
113
+ () => Object.entries(D(t)),
114
+ [t]
115
+ );
116
+ return /* @__PURE__ */ r("div", { className: "overflow-hidden rounded-lg border border-border/60 bg-background/80 dark:border-white/10", children: /* @__PURE__ */ r("dl", { className: "divide-y divide-border/50 dark:divide-white/10", children: o.map(([i, s]) => /* @__PURE__ */ r(B, { label: i, value: s }, i)) }) });
117
+ }), x = c.memo(function({
118
+ label: t,
119
+ value: o,
120
+ view: i = "table",
121
+ className: s,
122
+ ...d
123
+ }) {
124
+ const n = c.useMemo(() => w(o), [o]);
125
+ return /* @__PURE__ */ a("section", { className: l("space-y-2", s), ...d, children: [
126
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-3", children: [
127
+ /* @__PURE__ */ r("h4", { className: "font-medium text-foreground text-xs", children: t }),
128
+ /* @__PURE__ */ r(
129
+ E,
130
+ {
131
+ className: "size-7 shrink-0 text-muted-foreground hover:text-foreground",
132
+ content: n,
133
+ size: "icon",
134
+ variant: "ghost"
135
+ }
136
+ )
137
+ ] }),
138
+ /* @__PURE__ */ r(h, { activeView: i, panelView: "table", children: /* @__PURE__ */ r(F, { value: o }) }),
139
+ /* @__PURE__ */ r(h, { activeView: i, lazy: !0, panelView: "code", children: /* @__PURE__ */ r(
140
+ N,
141
+ {
142
+ className: "rounded-lg border border-border/60 bg-background/80 dark:border-white/10",
143
+ code: n
144
+ }
145
+ ) })
146
+ ] });
147
+ });
148
+ function Q({ className: e, ...t }) {
149
+ return /* @__PURE__ */ r(
150
+ j,
151
+ {
152
+ className: l("w-full", e),
153
+ "data-slot": "tool-call-accordion",
154
+ ...t
155
+ }
156
+ );
157
+ }
158
+ function U({
159
+ className: e,
160
+ ...t
161
+ }) {
162
+ return /* @__PURE__ */ r(
163
+ I,
164
+ {
165
+ className: l(
166
+ "w-full overflow-hidden rounded-xl border border-border/50 bg-card/75 shadow-sm last:border-b dark:border-white/10 dark:shadow-black/20",
167
+ e
168
+ ),
169
+ "data-slot": "tool-call-accordion-item",
170
+ ...t
171
+ }
172
+ );
173
+ }
174
+ function X({
175
+ className: e,
176
+ state: t,
177
+ toolName: o,
178
+ icon: i,
179
+ showStateIndicator: s = !0,
180
+ ...d
181
+ }) {
182
+ const n = t ?? "calling", m = i ?? /* @__PURE__ */ r(C, { className: "size-3.5 text-muted-foreground" }), g = {
183
+ calling: /* @__PURE__ */ r(V, { className: "size-3 shrink-0 animate-spin text-orange-500" }),
184
+ complete: /* @__PURE__ */ r(S, { className: "size-3 shrink-0 text-green-500" }),
185
+ error: /* @__PURE__ */ r(v, { className: "size-3 shrink-0 text-destructive" })
186
+ }, f = {
187
+ calling: "Running",
188
+ complete: "Completed",
189
+ error: "Failed"
190
+ };
191
+ return /* @__PURE__ */ a(
192
+ O,
193
+ {
194
+ className: l(
195
+ "items-center gap-3 px-3 py-3 hover:bg-muted/15 hover:no-underline [&>svg]:translate-y-0 [&>svg]:self-center",
196
+ J({ state: n }),
197
+ e
198
+ ),
199
+ "data-slot": "tool-call-accordion-trigger",
200
+ ...d,
201
+ children: [
202
+ /* @__PURE__ */ a("div", { className: "relative shrink-0", children: [
203
+ /* @__PURE__ */ r("div", { className: "flex size-8 items-center justify-center rounded-full bg-muted/45 ring-1 ring-border/50", children: m }),
204
+ s && /* @__PURE__ */ r(
205
+ "span",
206
+ {
207
+ "aria-hidden": "true",
208
+ className: R({
209
+ state: n
210
+ })
211
+ }
212
+ )
213
+ ] }),
214
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 text-left", children: /* @__PURE__ */ r("span", { className: "block truncate text-foreground text-xs", children: o }) }),
215
+ /* @__PURE__ */ a(
216
+ "span",
217
+ {
218
+ className: l(
219
+ "inline-flex shrink-0 items-center gap-1.5 self-center text-[11px] text-muted-foreground leading-none",
220
+ n === "error" && "text-destructive"
221
+ ),
222
+ children: [
223
+ g[n],
224
+ f[n]
225
+ ]
226
+ }
227
+ )
228
+ ]
229
+ }
230
+ );
231
+ }
232
+ function Y({
233
+ className: e,
234
+ children: t,
235
+ view: o,
236
+ onViewChange: i,
237
+ showViewToggle: s = !0,
238
+ args: d,
239
+ result: n,
240
+ ...m
241
+ }) {
242
+ const [g, f] = c.useState("table"), [, k] = c.useTransition(), u = o ?? g, b = (p) => {
243
+ i?.(p), o === void 0 && k(() => f(p));
244
+ };
245
+ return /* @__PURE__ */ r(
246
+ z,
247
+ {
248
+ className: "w-full border-border/50 border-t bg-muted/10 dark:border-white/10",
249
+ "data-slot": "tool-call-accordion-content",
250
+ ...m,
251
+ children: /* @__PURE__ */ a("div", { className: l("space-y-3 overflow-auto px-3 py-3", e), children: [
252
+ s && /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-3", children: [
253
+ /* @__PURE__ */ r("p", { className: "truncate text-[11px] text-muted-foreground", children: "Inspect payload and response" }),
254
+ /* @__PURE__ */ a("div", { className: "inline-flex shrink-0 items-center gap-0.5 rounded-lg border border-border/60 bg-background/70 p-0.5 shadow-sm dark:border-white/10", children: [
255
+ /* @__PURE__ */ a(
256
+ "button",
257
+ {
258
+ className: l(
259
+ "inline-flex h-6.5 items-center justify-center gap-1.5 rounded-md px-2.5 text-[11px] transition-colors",
260
+ u === "table" ? "bg-background text-foreground shadow-sm ring-1 ring-border/60" : "text-muted-foreground hover:bg-background/60 hover:text-foreground"
261
+ ),
262
+ onClick: () => b("table"),
263
+ type: "button",
264
+ children: [
265
+ /* @__PURE__ */ r(A, { className: "size-3.5" }),
266
+ "Table"
267
+ ]
268
+ }
269
+ ),
270
+ /* @__PURE__ */ a(
271
+ "button",
272
+ {
273
+ className: l(
274
+ "inline-flex h-6.5 items-center justify-center gap-1.5 rounded-md px-2.5 text-[11px] transition-colors",
275
+ u === "code" ? "bg-background text-foreground shadow-sm ring-1 ring-border/60" : "text-muted-foreground hover:bg-background/60 hover:text-foreground"
276
+ ),
277
+ onClick: () => b("code"),
278
+ type: "button",
279
+ children: [
280
+ /* @__PURE__ */ r(T, { className: "size-3.5" }),
281
+ "JSON"
282
+ ]
283
+ }
284
+ )
285
+ ] })
286
+ ] }),
287
+ /* @__PURE__ */ a("div", { className: "space-y-3", children: [
288
+ t,
289
+ d !== void 0 && /* @__PURE__ */ r(x, { label: "Parameters", value: d, view: u }),
290
+ n !== void 0 && /* @__PURE__ */ r(x, { label: "Response", value: n, view: u })
291
+ ] })
292
+ ] })
293
+ }
294
+ );
295
+ }
296
+ export {
297
+ Q as ToolCallAccordion,
298
+ Y as ToolCallAccordionContent,
299
+ U as ToolCallAccordionItem,
300
+ X as ToolCallAccordionTrigger
301
+ };
@@ -6,7 +6,7 @@ import "../atoms/card.js";
6
6
  import "../atoms/checkbox.js";
7
7
  import "../atoms/view-tools-control.js";
8
8
  import "../../../lib/utils.js";
9
- import { T as k } from "../../../toolkit-card-k8jio69G.js";
9
+ import { T as k } from "../../../toolkit-card-DAgQXF93.js";
10
10
  import "../utils/memo.js";
11
11
  export {
12
12
  k as ToolkitCard
@@ -0,0 +1,65 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { DropdownMenuContent } from '../atoms/dropdown-menu';
3
+ export type UserNavSize = "sm" | "lg";
4
+ export type UserNavProps = {
5
+ /** Display name. @default "User" */
6
+ name?: string;
7
+ /** Email shown as default secondary content. */
8
+ email?: string;
9
+ /** Avatar image URL. Falls back to initials when omitted. */
10
+ avatarUrl?: string;
11
+ /** Avatar size. `"sm"` = 36px, `"lg"` = 40px. @default "sm" */
12
+ avatarSize?: UserNavSize;
13
+ /** Additional class names for the avatar fallback. */
14
+ avatarClassName?: string;
15
+ /** Badge overlay on the avatar (e.g. a notification dot). Positioned top-right automatically. */
16
+ badge?: ReactNode;
17
+ /** Optional badge content rendered in the dropdown identity instead of reusing the trigger badge. */
18
+ menuBadge?: ReactNode;
19
+ /**
20
+ * Custom content rendered below the name.
21
+ * Defaults to the email when omitted.
22
+ * Pass `null` explicitly to render nothing below the name.
23
+ */
24
+ secondary?: ReactNode;
25
+ /** Optional secondary content rendered in the dropdown identity instead of reusing the trigger secondary content. */
26
+ menuSecondary?: ReactNode;
27
+ /** Compact mode hides trigger details and chevron while keeping the dropdown identity expanded. */
28
+ compact?: boolean;
29
+ /**
30
+ * Dropdown menu items (e.g. `DropdownMenuItem`, `DropdownMenuSeparator`).
31
+ * When provided the trigger becomes interactive and opens a dropdown.
32
+ * When omitted the component renders as a static display.
33
+ */
34
+ children?: ReactNode;
35
+ /** Which side of the trigger the dropdown opens on. @default "top" */
36
+ dropdownSide?: ComponentProps<typeof DropdownMenuContent>["side"];
37
+ /** How the dropdown aligns with the trigger. @default "end" */
38
+ dropdownAlign?: ComponentProps<typeof DropdownMenuContent>["align"];
39
+ className?: string;
40
+ };
41
+ /**
42
+ * Presentational user widget — avatar, name, and secondary info.
43
+ *
44
+ * - Without `children` it renders as a static display.
45
+ * - With `children` (typically `DropdownMenuItem`) it renders as a dropdown.
46
+ * - `secondary` defaults to the email; override with any ReactNode.
47
+ * Pass `null` explicitly to suppress the email entirely.
48
+ *
49
+ * @example Chat sidebar
50
+ * ```tsx
51
+ * <UserNav name={name} email={email}>
52
+ * <DropdownMenuItem onClick={onSignOut}>Sign out</DropdownMenuItem>
53
+ * </UserNav>
54
+ * ```
55
+ *
56
+ * @example Dashboard with plan badge
57
+ * ```tsx
58
+ * <UserNav name={name} avatarSize="lg" secondary={<PlanBadge plan="pro" />}>
59
+ * <DropdownMenuItem onClick={onBilling}>Billing</DropdownMenuItem>
60
+ * </UserNav>
61
+ * ```
62
+ */
63
+ declare function UserNav({ name, email, avatarUrl, avatarSize, avatarClassName, badge, menuBadge, secondary, menuSecondary, compact, children, dropdownSide, dropdownAlign, className, }: UserNavProps): import("react/jsx-runtime").JSX.Element;
64
+ export { UserNav };
65
+ //# sourceMappingURL=user-nav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-nav.d.ts","sourceRoot":"","sources":["../../../../lib/components/ui/molecules/user-nav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvD,OAAO,EAEL,mBAAmB,EAIpB,MAAM,qCAAqC,CAAC;AAK7C,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iGAAiG;IACjG,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,qGAAqG;IACrG,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,qHAAqH;IACrH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,mGAAmG;IACnG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sEAAsE;IACtE,YAAY,CAAC,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;IAClE,+DAA+D;IAC/D,aAAa,CAAC,EAAE,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA2EF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iBAAS,OAAO,CAAC,EACf,IAAI,EACJ,KAAK,EACL,SAAS,EACT,UAAiB,EACjB,eAAe,EACf,KAAK,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,OAAe,EACf,QAAQ,EACR,YAAoB,EACpB,aAAqB,EACrB,SAAS,GACV,EAAE,YAAY,2CAyFd;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}