Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

feat: agent chat UI foundation and tool cards

Khuram Niaza8e7cfbeb620
diff --git a/__tests__/AgentApprovalCard.spec.tsx b/__tests__/AgentApprovalCard.spec.tsx
new file mode 100644
index 0000000..4326ffe
--- /dev/null
+++ b/__tests__/AgentApprovalCard.spec.tsx
@@ -0,0 +1,148 @@
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { AgentApprovalCard } from "@/components/agent/AgentApprovalCard";
+
+const part = (overrides: Record<string, unknown> = {}) =>
+ ({
+ type: "tool-add_job",
+ toolCallId: "c1",
+ state: "approval-requested",
+ approval: { id: "ap1" },
+ input: {
+ company: "Acme Corp",
+ jobTitle: "Senior Platform Engineer",
+ location: "Remote",
+ source: "LinkedIn",
+ jobUrl: "https://example.com/jobs/1",
+ salaryRange: "$180k",
+ tags: ["Go", "Kubernetes"],
+ },
+ ...overrides,
+ }) as any;
+
+const longPaste = Array.from({ length: 200 }, () => "word").join(" ");
+
+describe("AgentApprovalCard", () => {
+ it("renders the arguments as labelled rows under a Needs approval pill", () => {
+ render(<AgentApprovalCard part={part()} onRespond={vi.fn()} />);
+ expect(screen.getByText("Needs approval")).toBeInTheDocument();
+ expect(screen.getByText("Acme Corp")).toBeInTheDocument();
+ expect(screen.getByText("Senior Platform Engineer")).toBeInTheDocument();
+ expect(screen.getByText("Remote")).toBeInTheDocument();
+ expect(screen.getByText("LinkedIn")).toBeInTheDocument();
+ expect(screen.getByText("$180k")).toBeInTheDocument();
+ expect(screen.getByText(/Go/)).toBeInTheDocument();
+ });
+
+ it("renders a model-supplied URL as text, never as an anchor", () => {
+ const { container } = render(
+ <AgentApprovalCard part={part()} onRespond={vi.fn()} />,
+ );
+ expect(screen.getByText("https://example.com/jobs/1")).toBeInTheDocument();
+ const anchors = Array.from(container.querySelectorAll("a"));
+ expect(
+ anchors.some((a) => a.getAttribute("href")?.includes("example.com")),
+ ).toBe(false);
+ });
+
+ it("shows the pasted source, its size and a completeness badge before Confirm", () => {
+ render(
+ <AgentApprovalCard
+ part={part()}
+ pastedText={longPaste}
+ onRespond={vi.fn()}
+ />,
+ );
+ expect(screen.getByText(/pasted/i)).toBeInTheDocument();
+ expect(
+ screen.getByText(new RegExp(`${longPaste.length}`)),
+ ).toBeInTheDocument();
+ expect(screen.getByText(/full/i)).toBeInTheDocument();
+ });
+
+ it("labels a model-supplied description and classifies it as thin when it is", () => {
+ render(
+ <AgentApprovalCard
+ part={part({
+ input: {
+ company: "Acme",
+ jobTitle: "Eng",
+ jobDescription: "Backend role, remote.",
+ },
+ })}
+ onRespond={vi.fn()}
+ />,
+ );
+ expect(screen.getByText(/model-supplied/i)).toBeInTheDocument();
+ expect(screen.getByText(/title-only/i)).toBeInTheDocument();
+ });
+
+ it("uses Confirm and Cancel, not Approve and Deny", () => {
+ render(<AgentApprovalCard part={part()} onRespond={vi.fn()} />);
+ expect(
+ screen.getByRole("button", { name: /confirm/i }),
+ ).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: /cancel/i })).toBeInTheDocument();
+ expect(
+ screen.queryByRole("button", { name: /approve/i }),
+ ).not.toBeInTheDocument();
+ expect(
+ screen.queryByRole("button", { name: /deny/i }),
+ ).not.toBeInTheDocument();
+ });
+
+ it("responds approved with the approval id from the tool part", async () => {
+ const onRespond = vi.fn();
+ render(<AgentApprovalCard part={part()} onRespond={onRespond} />);
+ await userEvent.click(screen.getByRole("button", { name: /confirm/i }));
+ expect(onRespond).toHaveBeenCalledWith({ id: "ap1", approved: true });
+ });
+
+ it("carries an optional decline reason back to the model", async () => {
+ const onRespond = vi.fn();
+ render(<AgentApprovalCard part={part()} onRespond={onRespond} />);
+ await userEvent.click(screen.getByRole("button", { name: /cancel/i }));
+ const reason = screen.getByPlaceholderText(/what was wrong/i);
+ await userEvent.type(reason, "wrong company");
+ await userEvent.click(screen.getByRole("button", { name: /send/i }));
+ expect(onRespond).toHaveBeenCalledWith({
+ id: "ap1",
+ approved: false,
+ reason: "wrong company",
+ });
+ });
+
+ it("cancels with no reason if the user does not give one", async () => {
+ const onRespond = vi.fn();
+ render(<AgentApprovalCard part={part()} onRespond={onRespond} />);
+ await userEvent.click(screen.getByRole("button", { name: /cancel/i }));
+ await userEvent.click(screen.getByRole("button", { name: /skip/i }));
+ expect(onRespond).toHaveBeenCalledWith({ id: "ap1", approved: false });
+ });
+
+ it("replaces the buttons with a waiting state once responded", () => {
+ render(
+ <AgentApprovalCard
+ part={part({
+ state: "approval-responded",
+ approval: { id: "ap1", approved: true },
+ })}
+ onRespond={vi.fn()}
+ />,
+ );
+ expect(
+ screen.queryByRole("button", { name: /confirm/i }),
+ ).not.toBeInTheDocument();
+ expect(screen.getByText(/waiting/i)).toBeInTheDocument();
+ });
+
+ it("renders nothing for a state it does not own", () => {
+ const { container } = render(
+ <AgentApprovalCard
+ part={part({ state: "input-available" })}
+ onRespond={vi.fn()}
+ />,
+ );
+ expect(container).toBeEmptyDOMElement();
+ });
+});
diff --git a/__tests__/AgentResultCard.spec.tsx b/__tests__/AgentResultCard.spec.tsx
new file mode 100644
index 0000000..a14279a
--- /dev/null
+++ b/__tests__/AgentResultCard.spec.tsx
@@ -0,0 +1,121 @@
+import { render, screen } from "@testing-library/react";
+import { AgentResultCard } from "@/components/agent/AgentResultCard";
+
+const resultPart = (output: unknown, state = "output-available") =>
+ ({
+ type: "tool-add_job",
+ toolCallId: "c1",
+ state,
+ input: { company: "Acme", jobTitle: "Engineer" },
+ output,
+ }) as any;
+
+describe("AgentResultCard", () => {
+ it("names the created job, links to it, and reports the description", () => {
+ render(
+ <AgentResultCard
+ part={resultPart({
+ created: true,
+ jobId: "job-123",
+ resolutions: [
+ { id: "c", label: "Acme", created: true },
+ { id: "t", label: "Engineer", created: false },
+ ],
+ descriptionSource: "pasted",
+ descriptionChars: 6200,
+ descriptionCompleteness: "full",
+ })}
+ />,
+ );
+ expect(screen.getByText(/Engineer/)).toBeInTheDocument();
+ expect(screen.getByRole("link")).toHaveAttribute(
+ "href",
+ expect.stringContaining("job-123"),
+ );
+ expect(screen.getByText(/6200|6,200/)).toBeInTheDocument();
+ expect(screen.getByText(/full/i)).toBeInTheDocument();
+ });
+
+ it("names entities it newly created, not ones it matched", () => {
+ render(
+ <AgentResultCard
+ part={resultPart({
+ created: true,
+ jobId: "job-1",
+ resolutions: [
+ { id: "c", label: "Acme", created: true },
+ { id: "t", label: "Engineer", created: false },
+ ],
+ })}
+ />,
+ );
+ expect(screen.getByText(/new/i).textContent).toContain("Acme");
+ expect(screen.getByText(/new/i).textContent).not.toContain("Engineer");
+ });
+
+ it("reports a duplicate and says no second job was created", () => {
+ render(
+ <AgentResultCard
+ part={resultPart({
+ created: false,
+ resolutions: [],
+ duplicateOf: { id: "job-9", title: "Engineer", company: "Acme" },
+ })}
+ />,
+ );
+ expect(screen.getByText(/no second job/i)).toBeInTheDocument();
+ expect(screen.getByRole("link")).toHaveAttribute(
+ "href",
+ expect.stringContaining("job-9"),
+ );
+ });
+
+ it("never leaks the helper's agent-facing guidance or a raw job id into the copy", () => {
+ const { container } = render(
+ <AgentResultCard
+ part={resultPart({
+ created: false,
+ resolutions: [],
+ duplicateOf: {
+ id: "b7f1c2de-0000-4444-8888-abcdefabcdef",
+ title: "Engineer",
+ company: "Acme",
+ },
+ })}
+ />,
+ );
+ const text = container.textContent ?? "";
+ expect(text).not.toContain("update_job");
+ expect(text).not.toContain("allowDuplicate");
+ expect(text).not.toContain("b7f1c2de-0000-4444-8888-abcdefabcdef");
+ });
+
+ it("renders the validation branch", () => {
+ render(
+ <AgentResultCard
+ part={resultPart({
+ created: false,
+ resolutions: [],
+ validationError: "dueDate: invalid datetime",
+ })}
+ />,
+ );
+ expect(screen.getByText(/dueDate/)).toBeInTheDocument();
+ });
+
+ it("renders a declined branch for output-denied", () => {
+ render(<AgentResultCard part={resultPart(undefined, "output-denied")} />);
+ expect(screen.getByText(/cancel|declin/i)).toBeInTheDocument();
+ });
+
+ it("renders a failed branch for output-error", () => {
+ render(
+ <AgentResultCard
+ part={
+ { ...resultPart(undefined, "output-error"), errorText: "boom" } as any
+ }
+ />,
+ );
+ expect(screen.getByText(/could not|failed/i)).toBeInTheDocument();
+ });
+});
diff --git a/__tests__/AiJobMatchSection.spec.tsx b/__tests__/AiJobMatchSection.spec.tsx
index dc297fa..ef96c32 100644
--- a/__tests__/AiJobMatchSection.spec.tsx
+++ b/__tests__/AiJobMatchSection.spec.tsx
@@ -1,5 +1,15 @@
import React from "react";
-import { render, waitFor, act } from "@testing-library/react";
+import {
+ render as rtlRender,
+ waitFor,
+ act,
+ type RenderOptions,
+} from "@testing-library/react";
+import { RightRailProvider } from "@/context/RightRailContext";
+
+// The sheet claims the right rail on open, so it needs the provider.
+const render = (ui: React.ReactElement, options?: RenderOptions) =>
+ rtlRender(ui, { wrapper: RightRailProvider, ...options });
import { AiJobMatchSection } from "@/components/profile/AiJobMatchSection";
import type { JobMatchResult } from "@/utils/streamJobMatch.utils";
diff --git a/__tests__/AiResumeReviewSection.spec.tsx b/__tests__/AiResumeReviewSection.spec.tsx
index 5f478c9..d0ad3d5 100644
--- a/__tests__/AiResumeReviewSection.spec.tsx
+++ b/__tests__/AiResumeReviewSection.spec.tsx
@@ -1,12 +1,18 @@
import React from "react";
import {
- render,
+ render as rtlRender,
screen,
fireEvent,
waitFor,
within,
act,
+ type RenderOptions,
} from "@testing-library/react";
+import { RightRailProvider } from "@/context/RightRailContext";
+
+// The sheet claims the right rail on open, so it needs the provider.
+const render = (ui: React.ReactElement, options?: RenderOptions) =>
+ rtlRender(ui, { wrapper: RightRailProvider, ...options });
import AiResumeReviewSection from "@/components/profile/AiResumeReviewSection";
import { Resume, SectionType } from "@/models/profile.model";
import type { ResumeReviewResult } from "@/utils/streamResumeReview.utils";
diff --git a/__tests__/GenerateCoverLetterSection.spec.tsx b/__tests__/GenerateCoverLetterSection.spec.tsx
index ac6cdaa..c1b7921 100644
--- a/__tests__/GenerateCoverLetterSection.spec.tsx
+++ b/__tests__/GenerateCoverLetterSection.spec.tsx
@@ -1,5 +1,15 @@
import React from "react";
-import { render, screen, waitFor } from "@testing-library/react";
+import {
+ render as rtlRender,
+ screen,
+ waitFor,
+ type RenderOptions,
+} from "@testing-library/react";
+import { RightRailProvider } from "@/context/RightRailContext";
+
+// The sheet claims the right rail on open, so it needs the provider.
+const render = (ui: React.ReactElement, options?: RenderOptions) =>
+ rtlRender(ui, { wrapper: RightRailProvider, ...options });
import userEvent from "@testing-library/user-event";
import { GenerateCoverLetterSection } from "@/components/myjobs/GenerateCoverLetterSection";
import { streamCoverLetter } from "@/utils/streamCoverLetter.utils";
diff --git a/__tests__/RightRailContext.spec.tsx b/__tests__/RightRailContext.spec.tsx
new file mode 100644
index 0000000..ee552b7
--- /dev/null
+++ b/__tests__/RightRailContext.spec.tsx
@@ -0,0 +1,62 @@
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import {
+ RightRailProvider,
+ useRightRailPanel,
+} from "@/context/RightRailContext";
+
+function Panel({ id }: { id: string }) {
+ const { isHolder, claim, release } = useRightRailPanel(id);
+ return (
+ <div>
+ <button onClick={claim}>open {id}</button>
+ <button onClick={release}>close {id}</button>
+ {isHolder && <span>{id} is open</span>}
+ </div>
+ );
+}
+
+const setup = () =>
+ render(
+ <RightRailProvider>
+ <Panel id="chat" />
+ <Panel id="review" />
+ </RightRailProvider>,
+ );
+
+describe("RightRailContext", () => {
+ it("lets one panel hold the rail", async () => {
+ setup();
+ await userEvent.click(screen.getByText("open chat"));
+ expect(screen.getByText("chat is open")).toBeInTheDocument();
+ });
+
+ it("evicts the current holder when another panel opens", async () => {
+ setup();
+ await userEvent.click(screen.getByText("open chat"));
+ await userEvent.click(screen.getByText("open review"));
+ expect(screen.getByText("review is open")).toBeInTheDocument();
+ expect(screen.queryByText("chat is open")).not.toBeInTheDocument();
+ });
+
+ it("never lets two panels hold the rail at once", async () => {
+ setup();
+ await userEvent.click(screen.getByText("open chat"));
+ await userEvent.click(screen.getByText("open review"));
+ expect(screen.getAllByText(/is open$/)).toHaveLength(1);
+ });
+
+ it("releases the rail so nothing holds it", async () => {
+ setup();
+ await userEvent.click(screen.getByText("open chat"));
+ await userEvent.click(screen.getByText("close chat"));
+ expect(screen.queryByText(/is open$/)).not.toBeInTheDocument();
+ });
+
+ it("ignores a release from a panel that does not hold the rail", async () => {
+ setup();
+ await userEvent.click(screen.getByText("open chat"));
+ await userEvent.click(screen.getByText("close review"));
+ expect(screen.getByText("chat is open")).toBeInTheDocument();
+ });
+});
diff --git a/__tests__/SheetOverlay.spec.tsx b/__tests__/SheetOverlay.spec.tsx
new file mode 100644
index 0000000..dffd599
--- /dev/null
+++ b/__tests__/SheetOverlay.spec.tsx
@@ -0,0 +1,40 @@
+import { render, screen } from "@testing-library/react";
+import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet";
+
+const OVERLAY = "[data-radix-dialog-overlay], .fixed.inset-0";
+
+// Modal on purpose: Radix's DialogOverlay returns null whenever modal is
+// false, so a non-modal sheet would pass the suppression case vacuously.
+function renderSheet(props: { overlay?: boolean } = {}) {
+ return render(
+ <Sheet open>
+ <SheetContent {...props}>
+ <SheetTitle>Panel</SheetTitle>
+ </SheetContent>
+ </Sheet>,
+ );
+}
+
+describe("SheetContent overlay prop", () => {
+ it("renders the scrim when the prop is omitted — every existing sheet depends on this", () => {
+ const { baseElement } = renderSheet();
+ expect(screen.getByText("Panel")).toBeInTheDocument();
+ expect(baseElement.querySelector(OVERLAY)).not.toBeNull();
+ });
+
+ it("renders the scrim when overlay is explicitly true", () => {
+ const { baseElement } = renderSheet({ overlay: true });
+ expect(baseElement.querySelector(OVERLAY)).not.toBeNull();
+ });
+
+ it("suppresses the scrim when overlay is false", () => {
+ const { baseElement } = renderSheet({ overlay: false });
+ expect(screen.getByText("Panel")).toBeInTheDocument();
+ expect(baseElement.querySelector(OVERLAY)).toBeNull();
+ });
+
+ it("does not leak the prop onto the DOM node", () => {
+ const { baseElement } = renderSheet({ overlay: false });
+ expect(baseElement.querySelector("[overlay]")).toBeNull();
+ });
+});
diff --git a/components.json b/components.json
index 88ba53a..2c8e5b6 100644
--- a/components.json
+++ b/components.json
@@ -1,6 +1,6 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
- "style": "default",
+ "style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
diff --git a/package-lock.json b/package-lock.json
index 32b0cfe..208995c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -23,6 +23,7 @@
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-dialog": "^1.1.3",
"@radix-ui/react-dropdown-menu": "^2.1.3",
+ "@radix-ui/react-hover-card": "^1.1.23",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-popover": "^1.1.3",
"@radix-ui/react-progress": "^1.1.1",
@@ -49,6 +50,7 @@
"lucide-react": "^0.469.0",
"mammoth": "^1.12.0",
"markdown-it": "^14.3.0",
+ "nanoid": "^6.0.0",
"next": "^15.5.21",
"next-auth": "^5.0.0-beta.32",
"next-themes": "^0.4.4",
@@ -60,10 +62,12 @@
"react-day-picker": "^9.12.0",
"react-dom": "19.2.4",
"react-hook-form": "^7.54.2",
+ "shiki": "^4.4.1",
"sonner": "^2.0.7",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"unpdf": "^1.6.2",
+ "use-stick-to-bottom": "^1.1.6",
"zod": "^4.3.5"
},
"devDependencies": {
@@ -2819,29 +2823,28 @@
}
},
"node_modules/@radix-ui/number": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz",
- "integrity": "sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g==",
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.3.tgz",
+ "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==",
"license": "MIT"
},
"node_modules/@radix-ui/primitive": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz",
- "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==",
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
+ "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
"license": "MIT"
},
"node_modules/@radix-ui/react-alert-dialog": {
- "version": "1.1.15",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.15.tgz",
- "integrity": "sha512-oTVLkEw5GpdRe29BqJ0LSDFWI3qu0vR1M0mUkOQWDIUnY/QIkLpgDMWuKxP94c2NAC2LGcgVhG1ImF3jkZ5wXw==",
+ "version": "1.1.23",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.23.tgz",
+ "integrity": "sha512-VAYOiQRqj3GPpYJE0I9J+X8Ip05cyVlNdKOFeiGS2Ou1HHGfpl0BxOyZm6nmVDyU+W+NF3/XLzmjHmVGydhwgA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-dialog": "1.1.15",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-slot": "1.2.3"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-dialog": "1.1.23",
+ "@radix-ui/react-primitive": "2.1.10"
},
"peerDependencies": {
"@types/react": "*",
@@ -2858,31 +2861,13 @@
}
}
},
- "node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-arrow": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.7.tgz",
- "integrity": "sha512-F+M1tLhO+mlQaOWspE8Wstg+z6PwxwRd8oQ8IXceWz92kfAmalTRf0EjrouQeo7QssEPfCn05B4Ihs1K9WQ/7w==",
+ "version": "1.1.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.15.tgz",
+ "integrity": "sha512-v4zggRcjadnI+ClKDuijlQEW4tw3NoaeHc/PwpKnLoLLKNUG4InLegkstooLcRIUWCs+8L22dGURCVuFfOKfnA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-primitive": "2.1.3"
+ "@radix-ui/react-primitive": "2.1.10"
},
"peerDependencies": {
"@types/react": "*",
@@ -2900,54 +2885,17 @@
}
},
"node_modules/@radix-ui/react-avatar": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.11.tgz",
- "integrity": "sha512-0Qk603AHGV28BOBO34p7IgD5m+V5Sg/YovfayABkoDDBM5d3NCx0Mp4gGrjzLGes1jV5eNOE1r3itqOR33VC6Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-context": "1.1.3",
- "@radix-ui/react-primitive": "2.1.4",
- "@radix-ui/react-use-callback-ref": "1.1.1",
- "@radix-ui/react-use-is-hydrated": "0.1.0",
- "@radix-ui/react-use-layout-effect": "1.1.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.3.tgz",
- "integrity": "sha512-ieIFACdMpYfMEjF0rEf5KLvfVyIkOz6PDGyNnP+u+4xQ6jny3VCgA4OgXOwNx2aUkxn8zx9fiVcM8CfFYv9Lxw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.4.tgz",
- "integrity": "sha512-9hQc4+GNVtJAIEPEqlYqW5RiYdrr8ea5XQ0ZOnD6fgru+83kqT15mq2OCcbe8KnjRZl5vF3ks69AKz3kh1jrhg==",
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.2.6.tgz",
+ "integrity": "sha512-4ULOTJ/mqy2hT9GlWa/MFHxHSvH3nJzHnZM1waNsc5Bonv7i70aNenghXmD97S6OJ81ekXONGGt4nT1r0PfEdA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-slot": "1.2.4"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-callback-ref": "1.1.4",
+ "@radix-ui/react-use-is-hydrated": "0.1.3",
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -2965,19 +2913,19 @@
}
},
"node_modules/@radix-ui/react-collapsible": {
- "version": "1.1.12",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.12.tgz",
- "integrity": "sha512-Uu+mSh4agx2ib1uIGPP4/CKNULyajb3p92LsVXmH2EHVMTfZWpll88XJ0j4W0z3f8NK1eYl1+Mf/szHPmcHzyA==",
+ "version": "1.1.20",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.20.tgz",
+ "integrity": "sha512-mcGesGplBnzN2sbvJETzpCNfSMyPnb29q1GRLU+Ib7bJrpIG2ywmRoh2V5VbA2uNvKikKUlVbAPks7JDjz4A8Q==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-controllable-state": "1.2.2",
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -2995,15 +2943,15 @@
}
},
"node_modules/@radix-ui/react-collection": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.7.tgz",
- "integrity": "sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw==",
+ "version": "1.1.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.15.tgz",
+ "integrity": "sha512-9W+B9NPF0NaaPh/1NJd3+KqsnlLqU9H7T2rvww+fp+T/evVXdNAyYcnfRQZFOjkR1ajQp3yORlqnI8soawLvNA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-slot": "1.2.3"
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-slot": "1.3.3"
},
"peerDependencies": {
"@types/react": "*",
@@ -3020,28 +2968,10 @@
}
}
},
- "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",
- "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
+ "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -3054,9 +2984,9 @@
}
},
"node_modules/@radix-ui/react-context": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.2.tgz",
- "integrity": "sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA==",
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.2.2.tgz",
+ "integrity": "sha512-RHCUGwKHDr0hDGg4X7ma4JG4/+12qxw8rkh5QKdDldlCvtja6nUx1Ef/8HVrJze81lEsgLQlqjzjGNHantgnQA==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -3069,25 +2999,26 @@
}
},
"node_modules/@radix-ui/react-dialog": {
- "version": "1.1.15",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.15.tgz",
- "integrity": "sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-dismissable-layer": "1.1.11",
- "@radix-ui/react-focus-guards": "1.1.3",
- "@radix-ui/react-focus-scope": "1.1.7",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-portal": "1.1.9",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-slot": "1.2.3",
- "@radix-ui/react-use-controllable-state": "1.2.2",
+ "version": "1.1.23",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.23.tgz",
+ "integrity": "sha512-Ksw4WeROkO4rC9k/onilX/Ao2Cr1ku1unMNH+XSCcP4jSXYu7HDsg9n4ojMjVb22XpYjAQ9qfrFlVbru1vXDUA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-dismissable-layer": "1.1.19",
+ "@radix-ui/react-focus-guards": "1.1.6",
+ "@radix-ui/react-focus-scope": "1.1.16",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-portal": "1.1.17",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-slot": "1.3.3",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-layout-effect": "1.1.4",
"aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.6.3"
+ "react-remove-scroll": "^2.7.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -3104,28 +3035,10 @@
}
}
},
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-direction": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.1.tgz",
- "integrity": "sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.4.tgz",
+ "integrity": "sha512-5pzg4FGQNpExhnhT2zlrP1wZFaYCd1K0nYWoFAdcYoYK868IEigqMX3B3f8yIoRlAhAeDWciLI6ZdCKHF9P4Vg==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -3138,16 +3051,16 @@
}
},
"node_modules/@radix-ui/react-dismissable-layer": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.11.tgz",
- "integrity": "sha512-Nqcp+t5cTB8BinFkZgXiMJniQH0PsUt2k51FUhbdfeKvc4ACcG2uQniY/8+h1Yv6Kza4Q7lD7PQV0z0oicE0Mg==",
+ "version": "1.1.19",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.19.tgz",
+ "integrity": "sha512-8g4pfOL9HoKKLWGiypT+dphVqjFfmcXO5GBnhsG6zI+lxAx/8feQpr+1LSN8Re3hiZ+XkLNS4O9ztK11/LzQ6w==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-callback-ref": "1.1.1",
- "@radix-ui/react-use-escape-keydown": "1.1.1"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-callback-ref": "1.1.4",
+ "@radix-ui/react-use-effect-event": "0.0.5"
},
"peerDependencies": {
"@types/react": "*",
@@ -3165,18 +3078,18 @@
}
},
"node_modules/@radix-ui/react-dropdown-menu": {
- "version": "2.1.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.16.tgz",
- "integrity": "sha512-1PLGQEynI/3OX/ftV54COn+3Sud/Mn8vALg2rWnBLnRaGtJDduNW/22XjlGgPdpcIbiQxjKtb7BkcjP00nqfJw==",
+ "version": "2.1.24",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.24.tgz",
+ "integrity": "sha512-geq8l2rJkxvkXsT9RMgtUE3P8pITFpTsvYpbySi1IH4fZEABD/Gp85myayFgxk0ktljGMJnCbeFkyTusvSvv7g==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-menu": "2.1.16",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-controllable-state": "1.2.2"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-menu": "2.1.24",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-controllable-state": "1.2.6"
},
"peerDependencies": {
"@types/react": "*",
@@ -3194,9 +3107,9 @@
}
},
"node_modules/@radix-ui/react-focus-guards": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.3.tgz",
- "integrity": "sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw==",
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.6.tgz",
+ "integrity": "sha512-RNOJjfZMTyBM6xYmV3IVGXkPjIhcBAuv48POevAXwrGJhkWZ9p1rFoIS1JFooPuT193AZmRsCPhpoVJxx6OPoQ==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -3209,14 +3122,14 @@
}
},
"node_modules/@radix-ui/react-focus-scope": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.7.tgz",
- "integrity": "sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw==",
+ "version": "1.1.16",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.16.tgz",
+ "integrity": "sha512-wmRZ2WWLvmt6KHy2rNPOdPUjwq5xOHY02+m+udwJTn0aNIox/rkskAvJTyTLGhPK6KgrUjlJUJpgmx/+wFiFIQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-callback-ref": "1.1.1"
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-callback-ref": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3233,54 +3146,62 @@
}
}
},
- "node_modules/@radix-ui/react-id": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.1.tgz",
- "integrity": "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg==",
+ "node_modules/@radix-ui/react-hover-card": {
+ "version": "1.1.23",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-hover-card/-/react-hover-card-1.1.23.tgz",
+ "integrity": "sha512-H8qONfZd3ltrU3+jHCIgITbWo6e1iTKvP9DHdrvYbX48ooRM5FjEDTn16AMwdfuOGkWdZEhpl3PLL/Wk/AnHDQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-dismissable-layer": "1.1.19",
+ "@radix-ui/react-popper": "1.3.7",
+ "@radix-ui/react-portal": "1.1.17",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-controllable-state": "1.2.6"
},
"peerDependencies": {
"@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
}
}
},
- "node_modules/@radix-ui/react-label": {
- "version": "2.1.8",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.8.tgz",
- "integrity": "sha512-FmXs37I6hSBVDlO4y764TNz1rLgKwjJMQ0EGte6F3Cb3f4bIuHB/iLa/8I9VKkmOy+gNHq8rql3j686ACVV21A==",
+ "node_modules/@radix-ui/react-id": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.4.tgz",
+ "integrity": "sha512-TMQp2llA+RYn7JcjnrMnz7wN4pcVttPZnRZo52PLQsoLVKzNlVwUeHmfePgTgRluXFvlD3GD5g5MOVVTJCO0qA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-primitive": "2.1.4"
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
- },
- "@types/react-dom": {
- "optional": true
}
}
},
- "node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.4.tgz",
- "integrity": "sha512-9hQc4+GNVtJAIEPEqlYqW5RiYdrr8ea5XQ0ZOnD6fgru+83kqT15mq2OCcbe8KnjRZl5vF3ks69AKz3kh1jrhg==",
+ "node_modules/@radix-ui/react-label": {
+ "version": "2.1.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.15.tgz",
+ "integrity": "sha512-o/rdYEwZTTo5tjknnPeyQFU45kUC4i/XyeDPP+HGyi6XqpOP6Zf5Ya5vh/Yfe9Id5JiuWnnAx2XqIeD3UYZt0g==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-slot": "1.2.4"
+ "@radix-ui/react-primitive": "2.1.10"
},
"peerDependencies": {
"@types/react": "*",
@@ -3298,29 +3219,29 @@
}
},
"node_modules/@radix-ui/react-menu": {
- "version": "2.1.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.16.tgz",
- "integrity": "sha512-72F2T+PLlphrqLcAotYPp0uJMr5SjP5SL01wfEspJbru5Zs5vQaSHb4VB3ZMJPimgHHCHG7gMOeOB9H3Hdmtxg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-collection": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-direction": "1.1.1",
- "@radix-ui/react-dismissable-layer": "1.1.11",
- "@radix-ui/react-focus-guards": "1.1.3",
- "@radix-ui/react-focus-scope": "1.1.7",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-popper": "1.2.8",
- "@radix-ui/react-portal": "1.1.9",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-roving-focus": "1.1.11",
- "@radix-ui/react-slot": "1.2.3",
- "@radix-ui/react-use-callback-ref": "1.1.1",
+ "version": "2.1.24",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.24.tgz",
+ "integrity": "sha512-uW7RVuU6Lp/ZtfeY4b3kL32zccgEWvPv1+cf17ubYzHa9cL8AHokmk36cG/XEiH/smbQvumnieXX9j/e9RqJWA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-collection": "1.1.15",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-direction": "1.1.4",
+ "@radix-ui/react-dismissable-layer": "1.1.19",
+ "@radix-ui/react-focus-guards": "1.1.6",
+ "@radix-ui/react-focus-scope": "1.1.16",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-popper": "1.3.7",
+ "@radix-ui/react-portal": "1.1.17",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-roving-focus": "1.1.19",
+ "@radix-ui/react-slot": "1.3.3",
+ "@radix-ui/react-use-callback-ref": "1.1.4",
"aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.6.3"
+ "react-remove-scroll": "^2.7.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -3337,45 +3258,27 @@
}
}
},
- "node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-popover": {
- "version": "1.1.15",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.15.tgz",
- "integrity": "sha512-kr0X2+6Yy/vJzLYJUPCZEc8SfQcf+1COFoAqauJm74umQhta9M7lNJHP7QQS3vkvcGLQUbWpMzwrXYwrYztHKA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-dismissable-layer": "1.1.11",
- "@radix-ui/react-focus-guards": "1.1.3",
- "@radix-ui/react-focus-scope": "1.1.7",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-popper": "1.2.8",
- "@radix-ui/react-portal": "1.1.9",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-slot": "1.2.3",
- "@radix-ui/react-use-controllable-state": "1.2.2",
+ "version": "1.1.23",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.23.tgz",
+ "integrity": "sha512-mw58MrBlyHWFisTOYignD0vf/3gdcgAR+9of1s9G/38CbFiUwH1nCDkc0AUM9IrXFgN5Ue8n45j9WCgyM1sbiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-dismissable-layer": "1.1.19",
+ "@radix-ui/react-focus-guards": "1.1.6",
+ "@radix-ui/react-focus-scope": "1.1.16",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-popper": "1.3.7",
+ "@radix-ui/react-portal": "1.1.17",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-slot": "1.3.3",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
"aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.6.3"
+ "react-remove-scroll": "^2.7.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -3392,40 +3295,22 @@
}
}
},
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-popper": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.8.tgz",
- "integrity": "sha512-0NJQ4LFFUuWkE7Oxf0htBKS6zLkkjBH+hM1uk7Ng705ReR8m/uelduy1DBo0PyBXPKVnBA6YBlU94MBGXrSBCw==",
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.3.7.tgz",
+ "integrity": "sha512-UsJrrd7w4wuKKTdvd/DNERVlwSlUcyXzjhyDwBk+3aPOsCjOY6ZSbxuw8E6lZTjjfP8Cpd0J8VVkrYUWyGYXyg==",
"license": "MIT",
"dependencies": {
"@floating-ui/react-dom": "^2.0.0",
- "@radix-ui/react-arrow": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-callback-ref": "1.1.1",
- "@radix-ui/react-use-layout-effect": "1.1.1",
- "@radix-ui/react-use-rect": "1.1.1",
- "@radix-ui/react-use-size": "1.1.1",
- "@radix-ui/rect": "1.1.1"
+ "@radix-ui/react-arrow": "1.1.15",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-callback-ref": "1.1.4",
+ "@radix-ui/react-use-layout-effect": "1.1.4",
+ "@radix-ui/react-use-rect": "1.1.4",
+ "@radix-ui/react-use-size": "1.1.4",
+ "@radix-ui/rect": "1.1.3"
},
"peerDependencies": {
"@types/react": "*",
@@ -3443,13 +3328,13 @@
}
},
"node_modules/@radix-ui/react-portal": {
- "version": "1.1.9",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.9.tgz",
- "integrity": "sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ==",
+ "version": "1.1.17",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.17.tgz",
+ "integrity": "sha512-vKQLcWypUnwZVvfV7UkGahH2g6ySe8M8R+zYBwPrv5byZ9QAW6cQVvNKo7GgmD+p8aYb6D9JBuvy8/WhOno2wQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3467,13 +3352,12 @@
}
},
"node_modules/@radix-ui/react-presence": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.5.tgz",
- "integrity": "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ==",
+ "version": "1.1.10",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.10.tgz",
+ "integrity": "sha512-3wyzCQ6+ubRA+D4uv9m95JYLXxmOHp05qjrkjeA7uKHHtjpPggQzc6DAb0URl7j67oR0K2foO4ip27TiX037Bw==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3491,12 +3375,12 @@
}
},
"node_modules/@radix-ui/react-primitive": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz",
- "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==",
+ "version": "2.1.10",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
+ "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-slot": "1.2.3"
+ "@radix-ui/react-slot": "1.3.3"
},
"peerDependencies": {
"@types/react": "*",
@@ -3513,70 +3397,14 @@
}
}
},
- "node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-progress": {
- "version": "1.1.8",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.8.tgz",
- "integrity": "sha512-+gISHcSPUJ7ktBy9RnTqbdKW78bcGke3t6taawyZ71pio1JewwGSJizycs7rLhGTvMJYCQB1DBK4KQsxs7U8dA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-context": "1.1.3",
- "@radix-ui/react-primitive": "2.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.3.tgz",
- "integrity": "sha512-ieIFACdMpYfMEjF0rEf5KLvfVyIkOz6PDGyNnP+u+4xQ6jny3VCgA4OgXOwNx2aUkxn8zx9fiVcM8CfFYv9Lxw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.4.tgz",
- "integrity": "sha512-9hQc4+GNVtJAIEPEqlYqW5RiYdrr8ea5XQ0ZOnD6fgru+83kqT15mq2OCcbe8KnjRZl5vF3ks69AKz3kh1jrhg==",
+ "version": "1.1.16",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.16.tgz",
+ "integrity": "sha512-5XnomAsoZZCY+KNTxbIghpGqPruZvKFNlvcAljVAOdDRDsH4/OZQxhtwo5wdtoDM5R6MhJBb2sPnDuRFep3lzg==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-slot": "1.2.4"
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-primitive": "2.1.10"
},
"peerDependencies": {
"@types/react": "*",
@@ -3594,21 +3422,20 @@
}
},
"node_modules/@radix-ui/react-radio-group": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.3.8.tgz",
- "integrity": "sha512-VBKYIYImA5zsxACdisNQ3BjCBfmbGH3kQlnFVqlWU4tXwjy7cGX8ta80BcrO+WJXIn5iBylEH3K6ZTlee//lgQ==",
+ "version": "1.4.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.4.7.tgz",
+ "integrity": "sha512-cgYFEkntCxppHZgtSZ+7vh0wbZQ+IC7PPMw8DSnRG27B6kDd32/Zw0OJt7dGDigCoprMuWHjg2PvUn3PYvPFoQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-direction": "1.1.1",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-roving-focus": "1.1.11",
- "@radix-ui/react-use-controllable-state": "1.2.2",
- "@radix-ui/react-use-previous": "1.1.1",
- "@radix-ui/react-use-size": "1.1.1"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-direction": "1.1.4",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-roving-focus": "1.1.19",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-size": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3626,20 +3453,22 @@
}
},
"node_modules/@radix-ui/react-roving-focus": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.11.tgz",
- "integrity": "sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA==",
+ "version": "1.1.19",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.19.tgz",
+ "integrity": "sha512-V9jI6hDjT7l3jsCQD9bLNvDLM3tH/gdbOTp7Tefp3hbbgCGQoK7tUvrWiRlcoBHIZ809ElXwNQwVo0B98LuTXQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-collection": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-direction": "1.1.1",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-callback-ref": "1.1.1",
- "@radix-ui/react-use-controllable-state": "1.2.2"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-collection": "1.1.15",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-direction": "1.1.4",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-callback-ref": "1.1.4",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-is-hydrated": "0.1.3",
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3657,20 +3486,20 @@
}
},
"node_modules/@radix-ui/react-scroll-area": {
- "version": "1.2.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.2.10.tgz",
- "integrity": "sha512-tAXIa1g3sM5CGpVT0uIbUx/U3Gs5N8T52IICuCtObaos1S8fzsrPXG5WObkQN3S6NVl6wKgPhAIiBGbWnvc97A==",
+ "version": "1.2.18",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.2.18.tgz",
+ "integrity": "sha512-Zn5Cd171wxsO3Dfg8HaW6RifTb9CYTKQJHs/G4+LN1GfmJpaQMZQyQxMprVPHpaz7QY4l9BxK2JwQuzHsXC8nA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/number": "1.1.1",
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-direction": "1.1.1",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-callback-ref": "1.1.1",
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/number": "1.1.3",
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-direction": "1.1.4",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-callback-ref": "1.1.4",
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3688,32 +3517,33 @@
}
},
"node_modules/@radix-ui/react-select": {
- "version": "2.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.2.6.tgz",
- "integrity": "sha512-I30RydO+bnn2PQztvo25tswPH+wFBjehVGtmagkU78yMdwTwVf12wnAOF+AeP8S2N8xD+5UPbGhkUfPyvT+mwQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/number": "1.1.1",
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-collection": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-direction": "1.1.1",
- "@radix-ui/react-dismissable-layer": "1.1.11",
- "@radix-ui/react-focus-guards": "1.1.3",
- "@radix-ui/react-focus-scope": "1.1.7",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-popper": "1.2.8",
- "@radix-ui/react-portal": "1.1.9",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-slot": "1.2.3",
- "@radix-ui/react-use-callback-ref": "1.1.1",
- "@radix-ui/react-use-controllable-state": "1.2.2",
- "@radix-ui/react-use-layout-effect": "1.1.1",
- "@radix-ui/react-use-previous": "1.1.1",
- "@radix-ui/react-visually-hidden": "1.2.3",
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.3.7.tgz",
+ "integrity": "sha512-WFGImkmbzcfxeIwq/+4HvRN0pizBwbwQUED4I13ezQsDdfl38ZntN6TmR8XaSzPBqoCToe8rF75j6NPNDSzhbg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/number": "1.1.3",
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-collection": "1.1.15",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-direction": "1.1.4",
+ "@radix-ui/react-dismissable-layer": "1.1.19",
+ "@radix-ui/react-focus-guards": "1.1.6",
+ "@radix-ui/react-focus-scope": "1.1.16",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-popper": "1.3.7",
+ "@radix-ui/react-portal": "1.1.17",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-slot": "1.3.3",
+ "@radix-ui/react-use-callback-ref": "1.1.4",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-layout-effect": "1.1.4",
+ "@radix-ui/react-use-previous": "1.1.4",
+ "@radix-ui/react-visually-hidden": "1.2.11",
"aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.6.3"
+ "react-remove-scroll": "^2.7.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -3730,41 +3560,23 @@
}
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-slider": {
- "version": "1.3.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.3.6.tgz",
- "integrity": "sha512-JPYb1GuM1bxfjMRlNLE+BcmBC8onfCi60Blk7OBqi2MLTFdS+8401U4uFjnwkOr49BLmXxLC6JHkvAsx5OJvHw==",
+ "version": "1.4.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.4.7.tgz",
+ "integrity": "sha512-mTSLf1GC/C0moWjTbvCM6Qn/gBjvlFt1azuWF2v7MN5C3Zq2U2J2lN3ZEYkpujuOU5Ro7A28wkviSxaKnG0BYg==",
"license": "MIT",
"dependencies": {
- "@radix-ui/number": "1.1.1",
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-collection": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-direction": "1.1.1",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-controllable-state": "1.2.2",
- "@radix-ui/react-use-layout-effect": "1.1.1",
- "@radix-ui/react-use-previous": "1.1.1",
- "@radix-ui/react-use-size": "1.1.1"
+ "@radix-ui/number": "1.1.3",
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-collection": "1.1.15",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-direction": "1.1.4",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-layout-effect": "1.1.4",
+ "@radix-ui/react-use-previous": "1.1.4",
+ "@radix-ui/react-use-size": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3782,12 +3594,12 @@
}
},
"node_modules/@radix-ui/react-slot": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.4.tgz",
- "integrity": "sha512-Jl+bCv8HxKnlTLVrcDE8zTMJ09R9/ukw4qBs/oZClOfoQk/cOTbDn+NceXfV7j09YPVQUryJPHurafcSg6EVKA==",
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
+ "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
+ "@radix-ui/react-compose-refs": "1.1.5"
},
"peerDependencies": {
"@types/react": "*",
@@ -3800,18 +3612,17 @@
}
},
"node_modules/@radix-ui/react-switch": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.2.6.tgz",
- "integrity": "sha512-bByzr1+ep1zk4VubeEVViV592vu2lHE2BZY5OnzehZqOOgogN80+mNtCqPkhn2gklJqOpxWgPoYTSnhBCqpOXQ==",
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.3.7.tgz",
+ "integrity": "sha512-48tB/4dn2UVLBCYhTu9AuR63IHl73l/qLbLgxd86noTUor4/K4LFDAcYjK+isP5313qxaFpjPVogE7+Y0/V3Kw==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-controllable-state": "1.2.2",
- "@radix-ui/react-use-previous": "1.1.1",
- "@radix-ui/react-use-size": "1.1.1"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-size": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3829,19 +3640,19 @@
}
},
"node_modules/@radix-ui/react-tabs": {
- "version": "1.1.13",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.13.tgz",
- "integrity": "sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A==",
+ "version": "1.1.21",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.21.tgz",
+ "integrity": "sha512-UKxJlZid7FVtsk/WTxj4i4uSEgj2Au+KBbS7SQyTlzMhhn+86Cz3tISZdTa87bfEfcuvZezf2ZsxD4xuEKtkog==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-direction": "1.1.1",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-roving-focus": "1.1.11",
- "@radix-ui/react-use-controllable-state": "1.2.2"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-direction": "1.1.4",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-roving-focus": "1.1.19",
+ "@radix-ui/react-use-controllable-state": "1.2.6"
},
"peerDependencies": {
"@types/react": "*",
@@ -3859,14 +3670,14 @@
}
},
"node_modules/@radix-ui/react-toggle": {
- "version": "1.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.10.tgz",
- "integrity": "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==",
+ "version": "1.1.18",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.18.tgz",
+ "integrity": "sha512-7lonPlKfSacd20GlOBx2ltuVKz9oqWYZz+oMQyOltw6t1y2nyftj2ZmwwUHYn49kqfDWcp8dNZm5NgV+5Z+mug==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-controllable-state": "1.2.2"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-use-controllable-state": "1.2.6"
},
"peerDependencies": {
"@types/react": "*",
@@ -3884,23 +3695,24 @@
}
},
"node_modules/@radix-ui/react-tooltip": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.8.tgz",
- "integrity": "sha512-tY7sVt1yL9ozIxvmbtN5qtmH2krXcBCfjEiCgKGLqunJHvgvZG2Pcl2oQ3kbcZARb1BGEHdkLzcYGO8ynVlieg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-compose-refs": "1.1.2",
- "@radix-ui/react-context": "1.1.2",
- "@radix-ui/react-dismissable-layer": "1.1.11",
- "@radix-ui/react-id": "1.1.1",
- "@radix-ui/react-popper": "1.2.8",
- "@radix-ui/react-portal": "1.1.9",
- "@radix-ui/react-presence": "1.1.5",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-slot": "1.2.3",
- "@radix-ui/react-use-controllable-state": "1.2.2",
- "@radix-ui/react-visually-hidden": "1.2.3"
+ "version": "1.2.16",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.16.tgz",
+ "integrity": "sha512-6EamKFRRnlpdadndbZ6LMwycfwkwPte1B42hs6QA0gYhjaOKqW4PZ4pjaW9UrlDX5eVt/OjncE7BFTPL5nmZhg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.5",
+ "@radix-ui/react-context": "1.2.2",
+ "@radix-ui/react-dismissable-layer": "1.1.19",
+ "@radix-ui/react-id": "1.1.4",
+ "@radix-ui/react-popper": "1.3.7",
+ "@radix-ui/react-portal": "1.1.17",
+ "@radix-ui/react-presence": "1.1.10",
+ "@radix-ui/react-primitive": "2.1.10",
+ "@radix-ui/react-slot": "1.3.3",
+ "@radix-ui/react-use-controllable-state": "1.2.6",
+ "@radix-ui/react-use-layout-effect": "1.1.4",
+ "@radix-ui/react-visually-hidden": "1.2.11"
},
"peerDependencies": {
"@types/react": "*",
@@ -3917,28 +3729,10 @@
}
}
},
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-use-callback-ref": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.1.tgz",
- "integrity": "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.4.tgz",
+ "integrity": "sha512-R6OUY2e2fA6Yn6s+VSx5KBV6Nx8LQEhu+cz7LCej18rQ1HLyg9PSC9jP/ZNx0o6FAIK9c0F1kHylzSxKsdlkrQ==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -3951,13 +3745,14 @@
}
},
"node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz",
- "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==",
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",
+ "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-use-effect-event": "0.0.2",
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/primitive": "1.1.7",
+ "@radix-ui/react-use-effect-event": "0.0.5",
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -3970,30 +3765,12 @@
}
},
"node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.2.tgz",
- "integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.1"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-escape-keydown": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.1.tgz",
- "integrity": "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==",
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
+ "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-use-callback-ref": "1.1.1"
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -4006,13 +3783,10 @@
}
},
"node_modules/@radix-ui/react-use-is-hydrated": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.0.tgz",
- "integrity": "sha512-U+UORVEq+cTnRIaostJv9AGdV3G6Y+zbVd+12e18jQ5A3c0xL03IhnHuiU4UV69wolOQp5GfR58NW/EgdQhwOA==",
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.3.tgz",
+ "integrity": "sha512-umO/aJ+82CpOnhDZUTbILCQf7kU/g0iv+oGs/Q8jw7IkhWBzaEP4sA268PhFAJTFetbwp3ICc6ktpI4TqtxcIw==",
"license": "MIT",
- "dependencies": {
- "use-sync-external-store": "^1.5.0"
- },
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
@@ -4024,9 +3798,9 @@
}
},
"node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz",
- "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
+ "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -4039,9 +3813,9 @@
}
},
"node_modules/@radix-ui/react-use-previous": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.1.tgz",
- "integrity": "sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.4.tgz",
+ "integrity": "sha512-XoSLhbRbqxFtgJoi2fNHA3C6pDlY34x508vUpUGoFZfvePfHXHbE1lC4FYFMnJWgiCRroSTw6fOsXQoVS9RwZg==",
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -4054,12 +3828,12 @@
}
},
"node_modules/@radix-ui/react-use-rect": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.1.tgz",
- "integrity": "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.4.tgz",
+ "integrity": "sha512-cSOCh6JlkmfjLyNcLiu2nB4v+nm+dkZ+Q5KHWk/soo4U7ZLiEQFKHK9/YmtBHjfCEaU43IBKQOc4/uJmCaiCTQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/rect": "1.1.1"
+ "@radix-ui/rect": "1.1.3"
},
"peerDependencies": {
"@types/react": "*",
@@ -4072,12 +3846,12 @@
}
},
"node_modules/@radix-ui/react-use-size": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.1.tgz",
- "integrity": "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.4.tgz",
+ "integrity": "sha512-D3anSY15EJoxrihpsXI6SMrmmonnQtR2ni7arO+Lfdg3O95b9hNXxONk8jA5C8ANdF/h5HMAxejgs8PWJ6rlhw==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.1"
+ "@radix-ui/react-use-layout-effect": "1.1.4"
},
"peerDependencies": {
"@types/react": "*",
@@ -4090,12 +3864,12 @@
}
},
"node_modules/@radix-ui/react-visually-hidden": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.3.tgz",
- "integrity": "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug==",
+ "version": "1.2.11",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.11.tgz",
+ "integrity": "sha512-NFS86RYYZb4/exihaESBGOpMJFz8MGLAfu3mOBSGByVnVPC9JPASfYubxd/8KbkQK0sYAv8lVQDEQukDX/qXvQ==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-primitive": "2.1.3"
+ "@radix-ui/react-primitive": "2.1.10"
},
"peerDependencies": {
"@types/react": "*",
@@ -4113,9 +3887,9 @@
}
},
"node_modules/@radix-ui/rect": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.1.tgz",
- "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==",
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.3.tgz",
+ "integrity": "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==",
"license": "MIT"
},
"node_modules/@react-pdf/fns": {
@@ -4670,6 +4444,106 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@shikijs/core": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.4.1.tgz",
+ "integrity": "sha512-VeR2CY6Nn9/WbisoYLOQZ7HZOnwTrpBuOw4wExjqLnBCi62BNWynBUO6K2uPIASPFJwAv7cX1fUu+LrPlSstcw==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/primitive": "4.4.1",
+ "@shikijs/types": "4.4.1",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.5",
+ "hast-util-to-html": "^9.0.5"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/engine-javascript": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.4.1.tgz",
+ "integrity": "sha512-6U4lJBh8LTvIkEVqRHv/rr3ruwtO6IweFQt1ME1ntHJMGHS+6N86vfYGO1o8c/DtOCTia2lfhdQBtBrps1sDfQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.4.1",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "oniguruma-to-es": "^4.3.6"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/engine-oniguruma": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.4.1.tgz",
+ "integrity": "sha512-p23RugMKss0r5DAtRJW1yAXUDl60JvhQYV20yuxei//26JyDSJefV3umyWzzwep2weblMnJGDYahuti6XkcMgA==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.4.1",
+ "@shikijs/vscode-textmate": "^10.0.2"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/langs": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.4.1.tgz",
+ "integrity": "sha512-xb2kCMloBCIraIy2fS5MW0t/BxVY3q2nDyQKBoeSeq6KNrQbShHetCFlw2n35fGIJ6t3+hXDLQogP5ir9O9bvA==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.4.1"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/primitive": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.4.1.tgz",
+ "integrity": "sha512-ko2OfDoG89YuQ7xL5LtcQiWKb7NIv1Ephb7g48TVU198OzAMLC8lXVEwaJGHK4sUMYrfAGJDqYmNLOLiW/Kz8w==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.4.1",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.5"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/themes": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.4.1.tgz",
+ "integrity": "sha512-wudOaoFro+/Zl9gQv2W1Ur5XlVduqvTuYLI483Xi0wgc1A+cy1hfB2r6ac6ufBgF+ID7KJEW7L41MHrzQ4wH+w==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/types": "4.4.1"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/types": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.4.1.tgz",
+ "integrity": "sha512-GOwCLQDHM5EjGUWNPrhzJbr6JP8V/Dx/CDVkWvbZ1Avw5JFnNUckrgbLmE07qtg4WlW7Q7QFndhjIkeU9XMPvw==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.5"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shikijs/vscode-textmate": {
+ "version": "10.0.2",
+ "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz",
+ "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==",
+ "license": "MIT"
+ },
"node_modules/@standard-schema/spec": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
@@ -5675,6 +5549,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/hast": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz",
+ "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "*"
+ }
+ },
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@@ -5705,6 +5588,15 @@
"@types/mdurl": "^2"
}
},
+ "node_modules/@types/mdast": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
+ "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "*"
+ }
+ },
"node_modules/@types/mdurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz",
@@ -5758,6 +5650,12 @@
"@types/react": "^19.2.0"
}
},
+ "node_modules/@types/unist": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
+ "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
+ "license": "MIT"
+ },
"node_modules/@types/use-sync-external-store": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
@@ -6036,6 +5934,12 @@
"url": "https://opencollective.com/eslint"
}
},
+ "node_modules/@ungap/structured-clone": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.3.tgz",
+ "integrity": "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==",
+ "license": "ISC"
+ },
"node_modules/@unrs/resolver-binding-android-arm-eabi": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz",
@@ -7249,6 +7153,16 @@
],
"license": "CC-BY-4.0"
},
+ "node_modules/ccount": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",
+ "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/chai": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
@@ -7292,6 +7206,26 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
+ "node_modules/character-entities-html4": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz",
+ "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/character-entities-legacy": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz",
+ "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/chokidar": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
@@ -7411,6 +7345,16 @@
"node": ">=12.20"
}
},
+ "node_modules/comma-separated-tokens": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz",
+ "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -7898,6 +7842,19 @@
"integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==",
"license": "MIT"
},
+ "node_modules/devlop": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz",
+ "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==",
+ "license": "MIT",
+ "dependencies": {
+ "dequal": "^2.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/dfa": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz",
@@ -9429,6 +9386,42 @@
"node": ">= 0.4"
}
},
+ "node_modules/hast-util-to-html": {
+ "version": "9.0.5",
+ "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz",
+ "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "@types/unist": "^3.0.0",
+ "ccount": "^2.0.0",
+ "comma-separated-tokens": "^2.0.0",
+ "hast-util-whitespace": "^3.0.0",
+ "html-void-elements": "^3.0.0",
+ "mdast-util-to-hast": "^13.0.0",
+ "property-information": "^7.0.0",
+ "space-separated-tokens": "^2.0.0",
+ "stringify-entities": "^4.0.0",
+ "zwitch": "^2.0.4"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/hast-util-whitespace": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
+ "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/hono": {
"version": "4.12.32",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.32.tgz",
@@ -9475,6 +9468,16 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/html-void-elements": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",
+ "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/http-errors": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
@@ -10901,6 +10904,27 @@
"node": ">= 0.4"
}
},
+ "node_modules/mdast-util-to-hast": {
+ "version": "13.2.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz",
+ "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/hast": "^3.0.0",
+ "@types/mdast": "^4.0.0",
+ "@ungap/structured-clone": "^1.0.0",
+ "devlop": "^1.0.0",
+ "micromark-util-sanitize-uri": "^2.0.0",
+ "trim-lines": "^3.0.0",
+ "unist-util-position": "^5.0.0",
+ "unist-util-visit": "^5.0.0",
+ "vfile": "^6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/mdurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz",
@@ -10944,6 +10968,95 @@
"node": ">= 8"
}
},
+ "node_modules/micromark-util-character": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz",
+ "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^2.0.0",
+ "micromark-util-types": "^2.0.0"
+ }
+ },
+ "node_modules/micromark-util-encode": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz",
+ "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/micromark-util-sanitize-uri": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz",
+ "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^2.0.0",
+ "micromark-util-encode": "^2.0.0",
+ "micromark-util-symbol": "^2.0.0"
+ }
+ },
+ "node_modules/micromark-util-symbol": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz",
+ "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/micromark-util-types": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz",
+ "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
@@ -11041,9 +11154,9 @@
"license": "MIT"
},
"node_modules/nanoid": {
- "version": "3.3.16",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz",
- "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-6.0.0.tgz",
+ "integrity": "sha512-mkUH+rPkwU2qPadJ0oJZOjeZ5Mxn8Q1UhevwkTRWNuUZzyia3h4rhzK39hxaHTk0o2OxB8W2SQ6A8k23ZDi1pQ==",
"funding": [
{
"type": "github",
@@ -11052,10 +11165,10 @@
],
"license": "MIT",
"bin": {
- "nanoid": "bin/nanoid.cjs"
+ "nanoid": "bin/nanoid.js"
},
"engines": {
- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ "node": "^22 || ^24 || >=26"
}
},
"node_modules/napi-postinstall": {
@@ -11439,6 +11552,23 @@
"wrappy": "1"
}
},
+ "node_modules/oniguruma-parser": {
+ "version": "0.12.2",
+ "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz",
+ "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==",
+ "license": "MIT"
+ },
+ "node_modules/oniguruma-to-es": {
+ "version": "4.3.6",
+ "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz",
+ "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==",
+ "license": "MIT",
+ "dependencies": {
+ "oniguruma-parser": "^0.12.2",
+ "regex": "^6.1.0",
+ "regex-recursion": "^6.0.2"
+ }
+ },
"node_modules/option": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/option/-/option-0.2.4.tgz",
@@ -11800,6 +11930,24 @@
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
"license": "MIT"
},
+ "node_modules/postcss/node_modules/nanoid": {
+ "version": "3.3.16",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz",
+ "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
"node_modules/preact": {
"version": "10.24.3",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.24.3.tgz",
@@ -11878,6 +12026,16 @@
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
"license": "MIT"
},
+ "node_modules/property-information": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz",
+ "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/prosemirror-changeset": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz",
@@ -12416,6 +12574,30 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz",
+ "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==",
+ "license": "MIT",
+ "dependencies": {
+ "regex-utilities": "^2.3.0"
+ }
+ },
+ "node_modules/regex-recursion": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz",
+ "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==",
+ "license": "MIT",
+ "dependencies": {
+ "regex-utilities": "^2.3.0"
+ }
+ },
+ "node_modules/regex-utilities": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz",
+ "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==",
+ "license": "MIT"
+ },
"node_modules/regexp.prototype.flags": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz",
@@ -12892,6 +13074,25 @@
"node": ">=8"
}
},
+ "node_modules/shiki": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.4.1.tgz",
+ "integrity": "sha512-rFP+iYKzjLEIqiMiKANhARqiAbk4deDhWnBtnUO/K0D0dPxMGDH4N0FVfBY/VeI+lPrV4wNGCHQZp7EOr7NNBw==",
+ "license": "MIT",
+ "dependencies": {
+ "@shikijs/core": "4.4.1",
+ "@shikijs/engine-javascript": "4.4.1",
+ "@shikijs/engine-oniguruma": "4.4.1",
+ "@shikijs/langs": "4.4.1",
+ "@shikijs/themes": "4.4.1",
+ "@shikijs/types": "4.4.1",
+ "@shikijs/vscode-textmate": "^10.0.2",
+ "@types/hast": "^3.0.5"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/side-channel": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
@@ -12990,6 +13191,16 @@
"node": ">=0.10.0"
}
},
+ "node_modules/space-separated-tokens": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz",
+ "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -13162,6 +13373,20 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/stringify-entities": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",
+ "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==",
+ "license": "MIT",
+ "dependencies": {
+ "character-entities-html4": "^2.0.0",
+ "character-entities-legacy": "^3.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/strip-indent": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
@@ -13443,6 +13668,16 @@
"node": ">=18"
}
},
+ "node_modules/trim-lines": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
+ "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
"node_modules/ts-api-utils": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz",
@@ -13791,6 +14026,74 @@
"integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==",
"license": "MIT"
},
+ "node_modules/unist-util-is": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
+ "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-position": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz",
+ "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-stringify-position": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
+ "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-visit": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz",
+ "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0",
+ "unist-util-is": "^6.0.0",
+ "unist-util-visit-parents": "^6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/unist-util-visit-parents": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz",
+ "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0",
+ "unist-util-is": "^6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/unpdf": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/unpdf/-/unpdf-1.6.2.tgz",
@@ -13914,6 +14217,21 @@
}
}
},
+ "node_modules/use-stick-to-bottom": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/use-stick-to-bottom/-/use-stick-to-bottom-1.1.6.tgz",
+ "integrity": "sha512-z3Up8jYQGTkUCsGBnwg6/wj70KgXoW5Kz1AAc1j8MtQuYMBo6ZsdhrIXoegxa7gaMMilgQYyTohTrt3p94jHog==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/samdenty"
+ }
+ ],
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
"node_modules/use-sync-external-store": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz",
@@ -13945,6 +14263,34 @@
"node": ">= 0.8"
}
},
+ "node_modules/vfile": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",
+ "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0",
+ "vfile-message": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/vfile-message": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",
+ "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^3.0.0",
+ "unist-util-stringify-position": "^4.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"node_modules/vite": {
"version": "8.1.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-8.1.3.tgz",
@@ -14458,6 +14804,16 @@
"peerDependencies": {
"zod": "^3.25.28 || ^4"
}
+ },
+ "node_modules/zwitch": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
+ "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
}
}
}
diff --git a/package.json b/package.json
index 3c1bd30..d703b83 100644
--- a/package.json
+++ b/package.json
@@ -36,6 +36,7 @@
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-dialog": "^1.1.3",
"@radix-ui/react-dropdown-menu": "^2.1.3",
+ "@radix-ui/react-hover-card": "^1.1.23",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-popover": "^1.1.3",
"@radix-ui/react-progress": "^1.1.1",
@@ -62,6 +63,7 @@
"lucide-react": "^0.469.0",
"mammoth": "^1.12.0",
"markdown-it": "^14.3.0",
+ "nanoid": "^6.0.0",
"next": "^15.5.21",
"next-auth": "^5.0.0-beta.32",
"next-themes": "^0.4.4",
@@ -73,10 +75,12 @@
"react-day-picker": "^9.12.0",
"react-dom": "19.2.4",
"react-hook-form": "^7.54.2",
+ "shiki": "^4.4.1",
"sonner": "^2.0.7",
"tailwind-merge": "^3.6.0",
"tw-animate-css": "^1.4.0",
"unpdf": "^1.6.2",
+ "use-stick-to-bottom": "^1.1.6",
"zod": "^4.3.5"
},
"devDependencies": {
diff --git a/src/components/agent/AgentApprovalCard.tsx b/src/components/agent/AgentApprovalCard.tsx
new file mode 100644
index 0000000..bc5d8ec
--- /dev/null
+++ b/src/components/agent/AgentApprovalCard.tsx
@@ -0,0 +1,182 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+import { getToolName, type ToolUIPart } from "ai";
+import {
+ Confirmation,
+ ConfirmationAction,
+ ConfirmationActions,
+ ConfirmationRequest,
+} from "@/components/ai-elements/confirmation";
+import { Badge } from "@/components/ui/badge";
+import { Textarea } from "@/components/ui/textarea";
+import { classifyDescriptionCompleteness } from "@/lib/jobs/descriptionCompleteness";
+
+type Respond = (r: { id: string; approved: boolean; reason?: string }) => void;
+
+function Row({ label, value }: { label: string; value?: string }) {
+ if (!value) return null;
+ return (
+ <div className="grid grid-cols-[7rem_1fr] gap-2 py-0.5 text-sm">
+ <span className="text-muted-foreground">{label}</span>
+ {/* Text, never an anchor: this value came from an attacker-authorable
+ posting by way of the model. */}
+ <span className="break-words">{value}</span>
+ </div>
+ );
+}
+
+function text(value: unknown): string | undefined {
+ return typeof value === "string" && value ? value : undefined;
+}
+
+function AddJobBody({
+ input,
+ pastedText,
+}: {
+ input: Record<string, unknown>;
+ pastedText?: string;
+}) {
+ const description = pastedText ?? text(input.jobDescription);
+ const source = pastedText ? "pasted verbatim" : "model-supplied";
+ const completeness = description
+ ? classifyDescriptionCompleteness(description)
+ : undefined;
+ const tags = Array.isArray(input.tags) ? input.tags.join(", ") : undefined;
+
+ return (
+ <div>
+ <Row label="Company" value={text(input.company)} />
+ <Row label="Job title" value={text(input.jobTitle)} />
+ <Row label="Location" value={text(input.location)} />
+ <Row label="Source" value={text(input.source)} />
+ <Row label="URL" value={text(input.jobUrl)} />
+ <Row label="Salary" value={text(input.salaryRange)} />
+ <Row label="Tags" value={tags} />
+ {description ? (
+ <div className="mt-2 rounded-sm border bg-muted/20 p-2">
+ <div className="flex items-center gap-2 text-xs text-muted-foreground">
+ <span>
+ Description · {source} · {description.length} chars
+ </span>
+ {completeness && <Badge variant="outline">{completeness}</Badge>}
+ </div>
+ {/* Collapsed to ~200 chars: this is verbatim third-party content
+ the model did not author, so it is the least interesting thing
+ on the card, and a 6KB block would push Confirm below the fold. */}
+ <p className="mt-1 line-clamp-3 text-xs">
+ {description.slice(0, 200)}
+ </p>
+ </div>
+ ) : (
+ <p className="mt-2 text-xs text-muted-foreground">
+ No description — the assistant will ask for one.
+ </p>
+ )}
+ </div>
+ );
+}
+
+export function AgentApprovalCard({
+ part,
+ pastedText,
+ onRespond,
+}: {
+ part: ToolUIPart;
+ pastedText?: string;
+ onRespond: Respond;
+}) {
+ const [declining, setDeclining] = useState(false);
+ const [reason, setReason] = useState("");
+ const cardRef = useRef<HTMLDivElement>(null);
+
+ // A blocking decision: focus moves here when it appears.
+ useEffect(() => {
+ if (part.state === "approval-requested") cardRef.current?.focus();
+ }, [part.state]);
+
+ if (part.state !== "approval-requested" && part.state !== "approval-responded")
+ return null;
+
+ const approvalId = part.approval?.id;
+ const toolName = getToolName(part);
+ const input = (part.input ?? {}) as Record<string, unknown>;
+
+ const body = (() => {
+ switch (toolName) {
+ case "add_job":
+ return <AddJobBody input={input} pastedText={pastedText} />;
+ default:
+ return null;
+ }
+ })();
+
+ return (
+ <Confirmation
+ ref={cardRef}
+ tabIndex={-1}
+ approval={part.approval}
+ state={part.state}
+ className="rounded-sm p-3 outline-hidden"
+ >
+ <div className="flex items-center gap-2">
+ <Badge variant="secondary">Needs approval</Badge>
+ <span className="text-sm font-semibold">{toolName}</span>
+ </div>
+
+ {body}
+
+ {part.state === "approval-responded" && (
+ <p className="text-xs text-muted-foreground">Waiting…</p>
+ )}
+
+ <ConfirmationRequest>
+ {declining && (
+ <div className="space-y-2">
+ <Textarea
+ value={reason}
+ onChange={(e) => setReason(e.target.value)}
+ placeholder="What was wrong? (optional)"
+ rows={2}
+ />
+ <div className="flex gap-2">
+ <ConfirmationAction
+ onClick={() =>
+ approvalId &&
+ onRespond({ id: approvalId, approved: false, reason })
+ }
+ >
+ Send
+ </ConfirmationAction>
+ <ConfirmationAction
+ variant="ghost"
+ onClick={() =>
+ approvalId && onRespond({ id: approvalId, approved: false })
+ }
+ >
+ Skip
+ </ConfirmationAction>
+ </div>
+ </div>
+ )}
+ </ConfirmationRequest>
+
+ {!declining && (
+ <ConfirmationActions>
+ <ConfirmationAction
+ onClick={() =>
+ approvalId && onRespond({ id: approvalId, approved: true })
+ }
+ >
+ Confirm
+ </ConfirmationAction>
+ {/* Client-side and always available — it must not depend on a
+ server round-trip succeeding. */}
+ <ConfirmationAction variant="outline" onClick={() => setDeclining(true)}>
+ Cancel
+ </ConfirmationAction>
+ </ConfirmationActions>
+ )}
+ </Confirmation>
+ );
+}
diff --git a/src/components/agent/AgentResultCard.tsx b/src/components/agent/AgentResultCard.tsx
new file mode 100644
index 0000000..a9cb08f
--- /dev/null
+++ b/src/components/agent/AgentResultCard.tsx
@@ -0,0 +1,111 @@
+"use client";
+
+import Link from "next/link";
+import { getToolName, type ToolUIPart } from "ai";
+import { Badge } from "@/components/ui/badge";
+import type { AgentAddJobResult } from "@/models/agent.model";
+
+// Composed from the tool result's STRUCTURED fields, never from
+// createJobFromNames' message string — that prose is MCP-facing protocol text
+// naming update_job and allowDuplicate, tools this surface does not expose.
+function AddJobResult({
+ output,
+ input,
+}: {
+ output: AgentAddJobResult;
+ input: Record<string, unknown>;
+}) {
+ if (output.validationError) {
+ return <p className="text-sm">Could not add the job — {output.validationError}</p>;
+ }
+
+ if (output.duplicateOf) {
+ return (
+ <div className="text-sm">
+ <p>
+ Already tracked: <strong>{output.duplicateOf.title}</strong> at{" "}
+ <strong>{output.duplicateOf.company}</strong>. No second job was
+ created.
+ </p>
+ <Link
+ className="text-xs underline"
+ href={`/dashboard/myjobs/${output.duplicateOf.id}`}
+ >
+ Open the existing job
+ </Link>
+ </div>
+ );
+ }
+
+ const newEntities = output.resolutions
+ .filter((r) => r.created)
+ .map((r) => r.label);
+ const jobTitle = typeof input.jobTitle === "string" ? input.jobTitle : "job";
+ const company = typeof input.company === "string" ? input.company : undefined;
+
+ return (
+ <div className="text-sm">
+ <p>
+ Added <strong>{jobTitle}</strong>
+ {company ? ` at ${company}` : ""}.
+ </p>
+ {output.jobId && (
+ <Link
+ className="text-xs underline"
+ href={`/dashboard/myjobs/${output.jobId}`}
+ >
+ Open the job
+ </Link>
+ )}
+ {newEntities.length > 0 && (
+ <p className="mt-1 text-xs text-muted-foreground">
+ New: {newEntities.join(", ")}
+ </p>
+ )}
+ {output.descriptionChars !== undefined && (
+ <p className="mt-1 flex items-center gap-2 text-xs text-muted-foreground">
+ <span>
+ Description ·{" "}
+ {output.descriptionSource === "pasted"
+ ? "pasted verbatim"
+ : "model-supplied"}{" "}
+ · {output.descriptionChars} chars
+ </span>
+ {output.descriptionCompleteness && (
+ <Badge variant="outline">{output.descriptionCompleteness}</Badge>
+ )}
+ </p>
+ )}
+ </div>
+ );
+}
+
+export function AgentResultCard({ part }: { part: ToolUIPart }) {
+ if (part.state === "output-denied") {
+ return (
+ <div className="rounded-sm border p-3 text-sm text-muted-foreground">
+ Cancelled — nothing was saved.
+ </div>
+ );
+ }
+
+ if (part.state === "output-error") {
+ return (
+ <div className="rounded-sm border p-3 text-sm">
+ That could not be completed. Try asking again.
+ </div>
+ );
+ }
+
+ if (part.state !== "output-available") return null;
+
+ const body =
+ getToolName(part) === "add_job" ? (
+ <AddJobResult
+ output={part.output as AgentAddJobResult}
+ input={(part.input ?? {}) as Record<string, unknown>}
+ />
+ ) : null;
+
+ return <div className="rounded-sm border p-3">{body}</div>;
+}
diff --git a/src/components/agent/AgentToolRunningCard.tsx b/src/components/agent/AgentToolRunningCard.tsx
new file mode 100644
index 0000000..d4e663c
--- /dev/null
+++ b/src/components/agent/AgentToolRunningCard.tsx
@@ -0,0 +1,24 @@
+"use client";
+
+import { Loader2 } from "lucide-react";
+import { getToolName, type ToolUIPart } from "ai";
+import { useSlowResponseWarning } from "@/hooks/useSlowResponseWarning";
+import { SlowResponseWarning } from "@/components/common/SlowResponseWarning";
+
+// Confirmation renders null for these states, so this is not redundant with
+// it. On a local 8B, deciding on a tool call is the longest phase of a turn.
+export function AgentToolRunningCard({ part }: { part: ToolUIPart }) {
+ const showSlowWarning = useSlowResponseWarning(true, false);
+ const label =
+ getToolName(part) === "add_job" ? "Preparing to add a job…" : "Working…";
+
+ return (
+ <div className="rounded-sm border bg-muted/20 px-3 py-2">
+ <div className="flex items-center gap-2 text-sm text-muted-foreground">
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ <span>{label}</span>
+ </div>
+ {showSlowWarning && <SlowResponseWarning />}
+ </div>
+ );
+}
diff --git a/src/components/ai-elements/attachments.tsx b/src/components/ai-elements/attachments.tsx
new file mode 100644
index 0000000..d4e4e34
--- /dev/null
+++ b/src/components/ai-elements/attachments.tsx
@@ -0,0 +1,426 @@
+"use client";
+
+import { Button } from "@/components/ui/button";
+import {
+ HoverCard,
+ HoverCardContent,
+ HoverCardTrigger,
+} from "@/components/ui/hover-card";
+import { cn } from "@/lib/utils";
+import type { FileUIPart, SourceDocumentUIPart } from "ai";
+import {
+ FileTextIcon,
+ GlobeIcon,
+ ImageIcon,
+ Music2Icon,
+ PaperclipIcon,
+ VideoIcon,
+ XIcon,
+} from "lucide-react";
+import type { ComponentProps, HTMLAttributes, ReactNode } from "react";
+import { createContext, useCallback, useContext, useMemo } from "react";
+
+// ============================================================================
+// Types
+// ============================================================================
+
+export type AttachmentData =
+ | (FileUIPart & { id: string })
+ | (SourceDocumentUIPart & { id: string });
+
+export type AttachmentMediaCategory =
+ | "image"
+ | "video"
+ | "audio"
+ | "document"
+ | "source"
+ | "unknown";
+
+export type AttachmentVariant = "grid" | "inline" | "list";
+
+const mediaCategoryIcons: Record<AttachmentMediaCategory, typeof ImageIcon> = {
+ audio: Music2Icon,
+ document: FileTextIcon,
+ image: ImageIcon,
+ source: GlobeIcon,
+ unknown: PaperclipIcon,
+ video: VideoIcon,
+};
+
+// ============================================================================
+// Utility Functions
+// ============================================================================
+
+export const getMediaCategory = (
+ data: AttachmentData
+): AttachmentMediaCategory => {
+ if (data.type === "source-document") {
+ return "source";
+ }
+
+ const mediaType = data.mediaType ?? "";
+
+ if (mediaType.startsWith("image/")) {
+ return "image";
+ }
+ if (mediaType.startsWith("video/")) {
+ return "video";
+ }
+ if (mediaType.startsWith("audio/")) {
+ return "audio";
+ }
+ if (mediaType.startsWith("application/") || mediaType.startsWith("text/")) {
+ return "document";
+ }
+
+ return "unknown";
+};
+
+export const getAttachmentLabel = (data: AttachmentData): string => {
+ if (data.type === "source-document") {
+ return data.title || data.filename || "Source";
+ }
+
+ const category = getMediaCategory(data);
+ return data.filename || (category === "image" ? "Image" : "Attachment");
+};
+
+const renderAttachmentImage = (
+ url: string,
+ filename: string | undefined,
+ isGrid: boolean
+) =>
+ isGrid ? (
+ <img
+ alt={filename || "Image"}
+ className="size-full object-cover"
+ height={96}
+ src={url}
+ width={96}
+ />
+ ) : (
+ <img
+ alt={filename || "Image"}
+ className="size-full rounded object-cover"
+ height={20}
+ src={url}
+ width={20}
+ />
+ );
+
+// ============================================================================
+// Contexts
+// ============================================================================
+
+interface AttachmentsContextValue {
+ variant: AttachmentVariant;
+}
+
+const AttachmentsContext = createContext<AttachmentsContextValue | null>(null);
+
+interface AttachmentContextValue {
+ data: AttachmentData;
+ mediaCategory: AttachmentMediaCategory;
+ onRemove?: () => void;
+ variant: AttachmentVariant;
+}
+
+const AttachmentContext = createContext<AttachmentContextValue | null>(null);
+
+// ============================================================================
+// Hooks
+// ============================================================================
+
+export const useAttachmentsContext = () =>
+ useContext(AttachmentsContext) ?? { variant: "grid" as const };
+
+export const useAttachmentContext = () => {
+ const ctx = useContext(AttachmentContext);
+ if (!ctx) {
+ throw new Error("Attachment components must be used within <Attachment>");
+ }
+ return ctx;
+};
+
+// ============================================================================
+// Attachments - Container
+// ============================================================================
+
+export type AttachmentsProps = HTMLAttributes<HTMLDivElement> & {
+ variant?: AttachmentVariant;
+};
+
+export const Attachments = ({
+ variant = "grid",
+ className,
+ children,
+ ...props
+}: AttachmentsProps) => {
+ const contextValue = useMemo(() => ({ variant }), [variant]);
+
+ return (
+ <AttachmentsContext.Provider value={contextValue}>
+ <div
+ className={cn(
+ "flex items-start",
+ variant === "list" ? "flex-col gap-2" : "flex-wrap gap-2",
+ variant === "grid" && "ml-auto w-fit",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ </AttachmentsContext.Provider>
+ );
+};
+
+// ============================================================================
+// Attachment - Item
+// ============================================================================
+
+export type AttachmentProps = HTMLAttributes<HTMLDivElement> & {
+ data: AttachmentData;
+ onRemove?: () => void;
+};
+
+export const Attachment = ({
+ data,
+ onRemove,
+ className,
+ children,
+ ...props
+}: AttachmentProps) => {
+ const { variant } = useAttachmentsContext();
+ const mediaCategory = getMediaCategory(data);
+
+ const contextValue = useMemo<AttachmentContextValue>(
+ () => ({ data, mediaCategory, onRemove, variant }),
+ [data, mediaCategory, onRemove, variant]
+ );
+
+ return (
+ <AttachmentContext.Provider value={contextValue}>
+ <div
+ className={cn(
+ "group relative",
+ variant === "grid" && "size-24 overflow-hidden rounded-lg",
+ variant === "inline" && [
+ "flex h-8 cursor-pointer select-none items-center gap-1.5",
+ "rounded-md border border-border px-1.5",
+ "font-medium text-sm transition-all",
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
+ ],
+ variant === "list" && [
+ "flex w-full items-center gap-3 rounded-lg border p-3",
+ "hover:bg-accent/50",
+ ],
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ </AttachmentContext.Provider>
+ );
+};
+
+// ============================================================================
+// AttachmentPreview - Media preview
+// ============================================================================
+
+export type AttachmentPreviewProps = HTMLAttributes<HTMLDivElement> & {
+ fallbackIcon?: ReactNode;
+};
+
+export const AttachmentPreview = ({
+ fallbackIcon,
+ className,
+ ...props
+}: AttachmentPreviewProps) => {
+ const { data, mediaCategory, variant } = useAttachmentContext();
+
+ const iconSize = variant === "inline" ? "size-3" : "size-4";
+
+ const renderIcon = (Icon: typeof ImageIcon) => (
+ <Icon className={cn(iconSize, "text-muted-foreground")} />
+ );
+
+ const renderContent = () => {
+ if (mediaCategory === "image" && data.type === "file" && data.url) {
+ return renderAttachmentImage(data.url, data.filename, variant === "grid");
+ }
+
+ if (mediaCategory === "video" && data.type === "file" && data.url) {
+ return <video className="size-full object-cover" muted src={data.url} />;
+ }
+
+ const Icon = mediaCategoryIcons[mediaCategory];
+ return fallbackIcon ?? renderIcon(Icon);
+ };
+
+ return (
+ <div
+ className={cn(
+ "flex shrink-0 items-center justify-center overflow-hidden",
+ variant === "grid" && "size-full bg-muted",
+ variant === "inline" && "size-5 rounded bg-background",
+ variant === "list" && "size-12 rounded bg-muted",
+ className
+ )}
+ {...props}
+ >
+ {renderContent()}
+ </div>
+ );
+};
+
+// ============================================================================
+// AttachmentInfo - Name and type display
+// ============================================================================
+
+export type AttachmentInfoProps = HTMLAttributes<HTMLDivElement> & {
+ showMediaType?: boolean;
+};
+
+export const AttachmentInfo = ({
+ showMediaType = false,
+ className,
+ ...props
+}: AttachmentInfoProps) => {
+ const { data, variant } = useAttachmentContext();
+ const label = getAttachmentLabel(data);
+
+ if (variant === "grid") {
+ return null;
+ }
+
+ return (
+ <div className={cn("min-w-0 flex-1", className)} {...props}>
+ <span className="block truncate">{label}</span>
+ {showMediaType && data.mediaType && (
+ <span className="block truncate text-muted-foreground text-xs">
+ {data.mediaType}
+ </span>
+ )}
+ </div>
+ );
+};
+
+// ============================================================================
+// AttachmentRemove - Remove button
+// ============================================================================
+
+export type AttachmentRemoveProps = ComponentProps<typeof Button> & {
+ label?: string;
+};
+
+export const AttachmentRemove = ({
+ label = "Remove",
+ className,
+ children,
+ ...props
+}: AttachmentRemoveProps) => {
+ const { onRemove, variant } = useAttachmentContext();
+
+ const handleClick = useCallback(
+ (e: React.MouseEvent) => {
+ e.stopPropagation();
+ onRemove?.();
+ },
+ [onRemove]
+ );
+
+ if (!onRemove) {
+ return null;
+ }
+
+ return (
+ <Button
+ aria-label={label}
+ className={cn(
+ variant === "grid" && [
+ "absolute top-2 right-2 size-6 rounded-full p-0",
+ "bg-background/80 backdrop-blur-sm",
+ "opacity-0 transition-opacity group-hover:opacity-100",
+ "hover:bg-background",
+ "[&>svg]:size-3",
+ ],
+ variant === "inline" && [
+ "size-5 rounded p-0",
+ "opacity-0 transition-opacity group-hover:opacity-100",
+ "[&>svg]:size-2.5",
+ ],
+ variant === "list" && ["size-8 shrink-0 rounded p-0", "[&>svg]:size-4"],
+ className
+ )}
+ onClick={handleClick}
+ type="button"
+ variant="ghost"
+ {...props}
+ >
+ {children ?? <XIcon />}
+ <span className="sr-only">{label}</span>
+ </Button>
+ );
+};
+
+// ============================================================================
+// AttachmentHoverCard - Hover preview
+// ============================================================================
+
+export type AttachmentHoverCardProps = ComponentProps<typeof HoverCard>;
+
+export const AttachmentHoverCard = ({
+ openDelay = 0,
+ closeDelay = 0,
+ ...props
+}: AttachmentHoverCardProps) => (
+ <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />
+);
+
+export type AttachmentHoverCardTriggerProps = ComponentProps<
+ typeof HoverCardTrigger
+>;
+
+export const AttachmentHoverCardTrigger = (
+ props: AttachmentHoverCardTriggerProps
+) => <HoverCardTrigger {...props} />;
+
+export type AttachmentHoverCardContentProps = ComponentProps<
+ typeof HoverCardContent
+>;
+
+export const AttachmentHoverCardContent = ({
+ align = "start",
+ className,
+ ...props
+}: AttachmentHoverCardContentProps) => (
+ <HoverCardContent
+ align={align}
+ className={cn("w-auto p-2", className)}
+ {...props}
+ />
+);
+
+// ============================================================================
+// AttachmentEmpty - Empty state
+// ============================================================================
+
+export type AttachmentEmptyProps = HTMLAttributes<HTMLDivElement>;
+
+export const AttachmentEmpty = ({
+ className,
+ children,
+ ...props
+}: AttachmentEmptyProps) => (
+ <div
+ className={cn(
+ "flex items-center justify-center p-4 text-muted-foreground text-sm",
+ className
+ )}
+ {...props}
+ >
+ {children ?? "No attachments"}
+ </div>
+);
diff --git a/src/components/ai-elements/code-block.tsx b/src/components/ai-elements/code-block.tsx
new file mode 100644
index 0000000..11b45b0
--- /dev/null
+++ b/src/components/ai-elements/code-block.tsx
@@ -0,0 +1,561 @@
+"use client";
+
+import { Button } from "@/components/ui/button";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+import { cn } from "@/lib/utils";
+import { CheckIcon, CopyIcon } from "lucide-react";
+import type { ComponentProps, CSSProperties, HTMLAttributes } from "react";
+import {
+ createContext,
+ memo,
+ useCallback,
+ useContext,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+} from "react";
+import type {
+ BundledLanguage,
+ BundledTheme,
+ HighlighterGeneric,
+ ThemedToken,
+} from "shiki";
+import { createHighlighter } from "shiki";
+
+// Shiki uses bitflags for font styles: 1=italic, 2=bold, 4=underline
+// oxlint-disable-next-line eslint(no-bitwise)
+const isItalic = (fontStyle: number | undefined) => fontStyle && fontStyle & 1;
+// oxlint-disable-next-line eslint(no-bitwise)
+const isBold = (fontStyle: number | undefined) => fontStyle && fontStyle & 2;
+const isUnderline = (fontStyle: number | undefined) =>
+ // oxlint-disable-next-line eslint(no-bitwise)
+ fontStyle && fontStyle & 4;
+
+// Transform tokens to include pre-computed keys to avoid noArrayIndexKey lint
+interface KeyedToken {
+ token: ThemedToken;
+ key: string;
+}
+interface KeyedLine {
+ tokens: KeyedToken[];
+ key: string;
+}
+
+const addKeysToTokens = (lines: ThemedToken[][]): KeyedLine[] =>
+ lines.map((line, lineIdx) => ({
+ key: `line-${lineIdx}`,
+ tokens: line.map((token, tokenIdx) => ({
+ key: `line-${lineIdx}-${tokenIdx}`,
+ token,
+ })),
+ }));
+
+// Token rendering component
+const TokenSpan = ({ token }: { token: ThemedToken }) => (
+ <span
+ className="dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]"
+ style={
+ {
+ backgroundColor: token.bgColor,
+ color: token.color,
+ fontStyle: isItalic(token.fontStyle) ? "italic" : undefined,
+ fontWeight: isBold(token.fontStyle) ? "bold" : undefined,
+ textDecoration: isUnderline(token.fontStyle) ? "underline" : undefined,
+ ...token.htmlStyle,
+ } as CSSProperties
+ }
+ >
+ {token.content}
+ </span>
+);
+
+// Line number styles using CSS counters
+const LINE_NUMBER_CLASSES = cn(
+ "block",
+ "before:content-[counter(line)]",
+ "before:inline-block",
+ "before:[counter-increment:line]",
+ "before:w-8",
+ "before:mr-4",
+ "before:text-right",
+ "before:text-muted-foreground/50",
+ "before:font-mono",
+ "before:select-none"
+);
+
+// Line rendering component
+const LineSpan = ({
+ keyedLine,
+ showLineNumbers,
+}: {
+ keyedLine: KeyedLine;
+ showLineNumbers: boolean;
+}) => (
+ <span className={showLineNumbers ? LINE_NUMBER_CLASSES : "block"}>
+ {keyedLine.tokens.length === 0
+ ? "\n"
+ : keyedLine.tokens.map(({ token, key }) => (
+ <TokenSpan key={key} token={token} />
+ ))}
+ </span>
+);
+
+// Types
+type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {
+ code: string;
+ language: BundledLanguage;
+ showLineNumbers?: boolean;
+};
+
+interface TokenizedCode {
+ tokens: ThemedToken[][];
+ fg: string;
+ bg: string;
+}
+
+interface CodeBlockContextType {
+ code: string;
+}
+
+// Context
+const CodeBlockContext = createContext<CodeBlockContextType>({
+ code: "",
+});
+
+// Highlighter cache (singleton per language)
+const highlighterCache = new Map<
+ string,
+ Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>
+>();
+
+// Token cache
+const tokensCache = new Map<string, TokenizedCode>();
+
+// Subscribers for async token updates
+const subscribers = new Map<string, Set<(result: TokenizedCode) => void>>();
+
+const getTokensCacheKey = (code: string, language: BundledLanguage) => {
+ const start = code.slice(0, 100);
+ const end = code.length > 100 ? code.slice(-100) : "";
+ return `${language}:${code.length}:${start}:${end}`;
+};
+
+const getHighlighter = (
+ language: BundledLanguage
+): Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> => {
+ const cached = highlighterCache.get(language);
+ if (cached) {
+ return cached;
+ }
+
+ const highlighterPromise = createHighlighter({
+ langs: [language],
+ themes: ["github-light", "github-dark"],
+ });
+
+ highlighterCache.set(language, highlighterPromise);
+ return highlighterPromise;
+};
+
+// Create raw tokens for immediate display while highlighting loads
+const createRawTokens = (code: string): TokenizedCode => ({
+ bg: "transparent",
+ fg: "inherit",
+ tokens: code.split("\n").map((line) =>
+ line === ""
+ ? []
+ : [
+ {
+ color: "inherit",
+ content: line,
+ } as ThemedToken,
+ ]
+ ),
+});
+
+// Synchronous highlight with callback for async results
+export const highlightCode = (
+ code: string,
+ language: BundledLanguage,
+ // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-callbacks)
+ callback?: (result: TokenizedCode) => void
+): TokenizedCode | null => {
+ const tokensCacheKey = getTokensCacheKey(code, language);
+
+ // Return cached result if available
+ const cached = tokensCache.get(tokensCacheKey);
+ if (cached) {
+ return cached;
+ }
+
+ // Subscribe callback if provided
+ if (callback) {
+ if (!subscribers.has(tokensCacheKey)) {
+ subscribers.set(tokensCacheKey, new Set());
+ }
+ subscribers.get(tokensCacheKey)?.add(callback);
+ }
+
+ // Start highlighting in background - fire-and-forget async pattern
+ getHighlighter(language)
+ // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then)
+ .then((highlighter) => {
+ const availableLangs = highlighter.getLoadedLanguages();
+ const langToUse = availableLangs.includes(language) ? language : "text";
+
+ const result = highlighter.codeToTokens(code, {
+ lang: langToUse,
+ themes: {
+ dark: "github-dark",
+ light: "github-light",
+ },
+ });
+
+ const tokenized: TokenizedCode = {
+ bg: result.bg ?? "transparent",
+ fg: result.fg ?? "inherit",
+ tokens: result.tokens,
+ };
+
+ // Cache the result
+ tokensCache.set(tokensCacheKey, tokenized);
+
+ // Notify all subscribers
+ const subs = subscribers.get(tokensCacheKey);
+ if (subs) {
+ for (const sub of subs) {
+ sub(tokenized);
+ }
+ subscribers.delete(tokensCacheKey);
+ }
+ })
+ // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then), eslint-plugin-promise(prefer-await-to-callbacks)
+ .catch((error) => {
+ console.error("Failed to highlight code:", error);
+ subscribers.delete(tokensCacheKey);
+ });
+
+ return null;
+};
+
+const CodeBlockBody = memo(
+ ({
+ tokenized,
+ showLineNumbers,
+ className,
+ }: {
+ tokenized: TokenizedCode;
+ showLineNumbers: boolean;
+ className?: string;
+ }) => {
+ const preStyle = useMemo(
+ () => ({
+ backgroundColor: tokenized.bg,
+ color: tokenized.fg,
+ }),
+ [tokenized.bg, tokenized.fg]
+ );
+
+ const keyedLines = useMemo(
+ () => addKeysToTokens(tokenized.tokens),
+ [tokenized.tokens]
+ );
+
+ return (
+ <pre
+ className={cn(
+ "dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm",
+ className
+ )}
+ style={preStyle}
+ >
+ <code
+ className={cn(
+ "font-mono text-sm",
+ showLineNumbers && "[counter-increment:line_0] [counter-reset:line]"
+ )}
+ >
+ {keyedLines.map((keyedLine) => (
+ <LineSpan
+ key={keyedLine.key}
+ keyedLine={keyedLine}
+ showLineNumbers={showLineNumbers}
+ />
+ ))}
+ </code>
+ </pre>
+ );
+ },
+ (prevProps, nextProps) =>
+ prevProps.tokenized === nextProps.tokenized &&
+ prevProps.showLineNumbers === nextProps.showLineNumbers &&
+ prevProps.className === nextProps.className
+);
+
+CodeBlockBody.displayName = "CodeBlockBody";
+
+export const CodeBlockContainer = ({
+ className,
+ language,
+ style,
+ ...props
+}: HTMLAttributes<HTMLDivElement> & { language: string }) => (
+ <div
+ className={cn(
+ "group relative w-full overflow-hidden rounded-md border bg-background text-foreground",
+ className
+ )}
+ data-language={language}
+ style={{
+ containIntrinsicSize: "auto 200px",
+ contentVisibility: "auto",
+ ...style,
+ }}
+ {...props}
+ />
+);
+
+export const CodeBlockHeader = ({
+ children,
+ className,
+ ...props
+}: HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex items-center justify-between border-b bg-muted/80 px-3 py-2 text-muted-foreground text-xs",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+);
+
+export const CodeBlockTitle = ({
+ children,
+ className,
+ ...props
+}: HTMLAttributes<HTMLDivElement>) => (
+ <div className={cn("flex items-center gap-2", className)} {...props}>
+ {children}
+ </div>
+);
+
+export const CodeBlockFilename = ({
+ children,
+ className,
+ ...props
+}: HTMLAttributes<HTMLSpanElement>) => (
+ <span className={cn("font-mono", className)} {...props}>
+ {children}
+ </span>
+);
+
+export const CodeBlockActions = ({
+ children,
+ className,
+ ...props
+}: HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn("-my-1 -mr-1 flex items-center gap-2", className)}
+ {...props}
+ >
+ {children}
+ </div>
+);
+
+export const CodeBlockContent = ({
+ code,
+ language,
+ showLineNumbers = false,
+}: {
+ code: string;
+ language: BundledLanguage;
+ showLineNumbers?: boolean;
+}) => {
+ // Memoized raw tokens for immediate display
+ const rawTokens = useMemo(() => createRawTokens(code), [code]);
+
+ // Synchronous cache lookup — avoids setState in effect for cached results
+ const syncTokens = useMemo(
+ () => highlightCode(code, language) ?? rawTokens,
+ [code, language, rawTokens]
+ );
+
+ // Async highlighting result (populated after shiki loads)
+ const [asyncTokens, setAsyncTokens] = useState<TokenizedCode | null>(null);
+ const asyncKeyRef = useRef({ code, language });
+
+ // Invalidate stale async tokens synchronously during render
+ if (
+ asyncKeyRef.current.code !== code ||
+ asyncKeyRef.current.language !== language
+ ) {
+ asyncKeyRef.current = { code, language };
+ setAsyncTokens(null);
+ }
+
+ useEffect(() => {
+ let cancelled = false;
+
+ highlightCode(code, language, (result) => {
+ if (!cancelled) {
+ setAsyncTokens(result);
+ }
+ });
+
+ return () => {
+ cancelled = true;
+ };
+ }, [code, language]);
+
+ const tokenized = asyncTokens ?? syncTokens;
+
+ return (
+ <div className="relative overflow-auto">
+ <CodeBlockBody showLineNumbers={showLineNumbers} tokenized={tokenized} />
+ </div>
+ );
+};
+
+export const CodeBlock = ({
+ code,
+ language,
+ showLineNumbers = false,
+ className,
+ children,
+ ...props
+}: CodeBlockProps) => {
+ const contextValue = useMemo(() => ({ code }), [code]);
+
+ return (
+ <CodeBlockContext.Provider value={contextValue}>
+ <CodeBlockContainer className={className} language={language} {...props}>
+ {children}
+ <CodeBlockContent
+ code={code}
+ language={language}
+ showLineNumbers={showLineNumbers}
+ />
+ </CodeBlockContainer>
+ </CodeBlockContext.Provider>
+ );
+};
+
+export type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
+ onCopy?: () => void;
+ onError?: (error: Error) => void;
+ timeout?: number;
+};
+
+export const CodeBlockCopyButton = ({
+ onCopy,
+ onError,
+ timeout = 2000,
+ children,
+ className,
+ ...props
+}: CodeBlockCopyButtonProps) => {
+ const [isCopied, setIsCopied] = useState(false);
+ const timeoutRef = useRef<number>(0);
+ const { code } = useContext(CodeBlockContext);
+
+ const copyToClipboard = useCallback(async () => {
+ if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
+ onError?.(new Error("Clipboard API not available"));
+ return;
+ }
+
+ try {
+ if (!isCopied) {
+ await navigator.clipboard.writeText(code);
+ setIsCopied(true);
+ onCopy?.();
+ timeoutRef.current = window.setTimeout(
+ () => setIsCopied(false),
+ timeout
+ );
+ }
+ } catch (error) {
+ onError?.(error as Error);
+ }
+ }, [code, onCopy, onError, timeout, isCopied]);
+
+ useEffect(
+ () => () => {
+ window.clearTimeout(timeoutRef.current);
+ },
+ []
+ );
+
+ const Icon = isCopied ? CheckIcon : CopyIcon;
+
+ return (
+ <Button
+ className={cn("shrink-0", className)}
+ onClick={copyToClipboard}
+ size="icon"
+ variant="ghost"
+ {...props}
+ >
+ {children ?? <Icon size={14} />}
+ </Button>
+ );
+};
+
+export type CodeBlockLanguageSelectorProps = ComponentProps<typeof Select>;
+
+export const CodeBlockLanguageSelector = (
+ props: CodeBlockLanguageSelectorProps
+) => <Select {...props} />;
+
+export type CodeBlockLanguageSelectorTriggerProps = ComponentProps<
+ typeof SelectTrigger
+>;
+
+export const CodeBlockLanguageSelectorTrigger = ({
+ className,
+ ...props
+}: CodeBlockLanguageSelectorTriggerProps) => (
+ <SelectTrigger
+ className={cn(
+ "h-7 border-none bg-transparent px-2 text-xs shadow-none",
+ className
+ )}
+ {...props}
+ />
+);
+
+export type CodeBlockLanguageSelectorValueProps = ComponentProps<
+ typeof SelectValue
+>;
+
+export const CodeBlockLanguageSelectorValue = (
+ props: CodeBlockLanguageSelectorValueProps
+) => <SelectValue {...props} />;
+
+export type CodeBlockLanguageSelectorContentProps = ComponentProps<
+ typeof SelectContent
+>;
+
+export const CodeBlockLanguageSelectorContent = ({
+ align = "end",
+ ...props
+}: CodeBlockLanguageSelectorContentProps) => (
+ <SelectContent align={align} {...props} />
+);
+
+export type CodeBlockLanguageSelectorItemProps = ComponentProps<
+ typeof SelectItem
+>;
+
+export const CodeBlockLanguageSelectorItem = (
+ props: CodeBlockLanguageSelectorItemProps
+) => <SelectItem {...props} />;
diff --git a/src/components/ai-elements/confirmation.tsx b/src/components/ai-elements/confirmation.tsx
new file mode 100644
index 0000000..26aa5c4
--- /dev/null
+++ b/src/components/ai-elements/confirmation.tsx
@@ -0,0 +1,174 @@
+"use client";
+
+import { Alert, AlertDescription } from "@/components/ui/alert";
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+import type { ToolUIPart } from "ai";
+import type { ComponentProps, ReactNode } from "react";
+import { createContext, useContext, useMemo } from "react";
+
+type ToolUIPartApproval =
+ | {
+ id: string;
+ approved?: never;
+ reason?: never;
+ }
+ | {
+ id: string;
+ approved: boolean;
+ reason?: string;
+ }
+ | {
+ id: string;
+ approved: true;
+ reason?: string;
+ }
+ | {
+ id: string;
+ approved: true;
+ reason?: string;
+ }
+ | {
+ id: string;
+ approved: false;
+ reason?: string;
+ }
+ | undefined;
+
+interface ConfirmationContextValue {
+ approval: ToolUIPartApproval;
+ state: ToolUIPart["state"];
+}
+
+const ConfirmationContext = createContext<ConfirmationContextValue | null>(
+ null
+);
+
+const useConfirmation = () => {
+ const context = useContext(ConfirmationContext);
+
+ if (!context) {
+ throw new Error("Confirmation components must be used within Confirmation");
+ }
+
+ return context;
+};
+
+export type ConfirmationProps = ComponentProps<typeof Alert> & {
+ approval?: ToolUIPartApproval;
+ state: ToolUIPart["state"];
+};
+
+export const Confirmation = ({
+ className,
+ approval,
+ state,
+ ...props
+}: ConfirmationProps) => {
+ const contextValue = useMemo(() => ({ approval, state }), [approval, state]);
+
+ if (!approval || state === "input-streaming" || state === "input-available") {
+ return null;
+ }
+
+ return (
+ <ConfirmationContext.Provider value={contextValue}>
+ <Alert className={cn("flex flex-col gap-2", className)} {...props} />
+ </ConfirmationContext.Provider>
+ );
+};
+
+export type ConfirmationTitleProps = ComponentProps<typeof AlertDescription>;
+
+export const ConfirmationTitle = ({
+ className,
+ ...props
+}: ConfirmationTitleProps) => (
+ <AlertDescription className={cn("inline", className)} {...props} />
+);
+
+export interface ConfirmationRequestProps {
+ children?: ReactNode;
+}
+
+export const ConfirmationRequest = ({ children }: ConfirmationRequestProps) => {
+ const { state } = useConfirmation();
+
+ // Only show when approval is requested
+ if (state !== "approval-requested") {
+ return null;
+ }
+
+ return children;
+};
+
+export interface ConfirmationAcceptedProps {
+ children?: ReactNode;
+}
+
+export const ConfirmationAccepted = ({
+ children,
+}: ConfirmationAcceptedProps) => {
+ const { approval, state } = useConfirmation();
+
+ // Only show when approved and in response states
+ if (
+ !approval?.approved ||
+ (state !== "approval-responded" &&
+ state !== "output-denied" &&
+ state !== "output-available")
+ ) {
+ return null;
+ }
+
+ return children;
+};
+
+export interface ConfirmationRejectedProps {
+ children?: ReactNode;
+}
+
+export const ConfirmationRejected = ({
+ children,
+}: ConfirmationRejectedProps) => {
+ const { approval, state } = useConfirmation();
+
+ // Only show when rejected and in response states
+ if (
+ approval?.approved !== false ||
+ (state !== "approval-responded" &&
+ state !== "output-denied" &&
+ state !== "output-available")
+ ) {
+ return null;
+ }
+
+ return children;
+};
+
+export type ConfirmationActionsProps = ComponentProps<"div">;
+
+export const ConfirmationActions = ({
+ className,
+ ...props
+}: ConfirmationActionsProps) => {
+ const { state } = useConfirmation();
+
+ // Only show when approval is requested
+ if (state !== "approval-requested") {
+ return null;
+ }
+
+ return (
+ <div
+ className={cn("flex items-center justify-end gap-2 self-end", className)}
+ {...props}
+ />
+ );
+};
+
+export type ConfirmationActionProps = ComponentProps<typeof Button>;
+
+export const ConfirmationAction = (props: ConfirmationActionProps) => (
+ <Button className="h-8 px-3 text-sm" type="button" {...props} />
+);
diff --git a/src/components/ai-elements/conversation.tsx b/src/components/ai-elements/conversation.tsx
new file mode 100644
index 0000000..21e5d82
--- /dev/null
+++ b/src/components/ai-elements/conversation.tsx
@@ -0,0 +1,168 @@
+"use client";
+
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+import type { UIMessage } from "ai";
+import { ArrowDownIcon, DownloadIcon } from "lucide-react";
+import type { ComponentProps } from "react";
+import { useCallback } from "react";
+import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
+
+export type ConversationProps = ComponentProps<typeof StickToBottom>;
+
+export const Conversation = ({ className, ...props }: ConversationProps) => (
+ <StickToBottom
+ className={cn("relative flex-1 overflow-y-hidden", className)}
+ initial="smooth"
+ resize="smooth"
+ role="log"
+ {...props}
+ />
+);
+
+export type ConversationContentProps = ComponentProps<
+ typeof StickToBottom.Content
+>;
+
+export const ConversationContent = ({
+ className,
+ ...props
+}: ConversationContentProps) => (
+ <StickToBottom.Content
+ className={cn("flex flex-col gap-8 p-4", className)}
+ {...props}
+ />
+);
+
+export type ConversationEmptyStateProps = ComponentProps<"div"> & {
+ title?: string;
+ description?: string;
+ icon?: React.ReactNode;
+};
+
+export const ConversationEmptyState = ({
+ className,
+ title = "No messages yet",
+ description = "Start a conversation to see messages here",
+ icon,
+ children,
+ ...props
+}: ConversationEmptyStateProps) => (
+ <div
+ className={cn(
+ "flex size-full flex-col items-center justify-center gap-3 p-8 text-center",
+ className
+ )}
+ {...props}
+ >
+ {children ?? (
+ <>
+ {icon && <div className="text-muted-foreground">{icon}</div>}
+ <div className="space-y-1">
+ <h3 className="font-medium text-sm">{title}</h3>
+ {description && (
+ <p className="text-muted-foreground text-sm">{description}</p>
+ )}
+ </div>
+ </>
+ )}
+ </div>
+);
+
+export type ConversationScrollButtonProps = ComponentProps<typeof Button>;
+
+export const ConversationScrollButton = ({
+ className,
+ ...props
+}: ConversationScrollButtonProps) => {
+ const { isAtBottom, scrollToBottom } = useStickToBottomContext();
+
+ const handleScrollToBottom = useCallback(() => {
+ scrollToBottom();
+ }, [scrollToBottom]);
+
+ return (
+ !isAtBottom && (
+ <Button
+ className={cn(
+ "absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted",
+ className
+ )}
+ onClick={handleScrollToBottom}
+ size="icon"
+ type="button"
+ variant="outline"
+ {...props}
+ >
+ <ArrowDownIcon className="size-4" />
+ </Button>
+ )
+ );
+};
+
+const getMessageText = (message: UIMessage): string =>
+ message.parts
+ .filter((part) => part.type === "text")
+ .map((part) => part.text)
+ .join("");
+
+export type ConversationDownloadProps = Omit<
+ ComponentProps<typeof Button>,
+ "onClick"
+> & {
+ messages: UIMessage[];
+ filename?: string;
+ formatMessage?: (message: UIMessage, index: number) => string;
+};
+
+const defaultFormatMessage = (message: UIMessage): string => {
+ const roleLabel =
+ message.role.charAt(0).toUpperCase() + message.role.slice(1);
+ return `**${roleLabel}:** ${getMessageText(message)}`;
+};
+
+export const messagesToMarkdown = (
+ messages: UIMessage[],
+ formatMessage: (
+ message: UIMessage,
+ index: number
+ ) => string = defaultFormatMessage
+): string => messages.map((msg, i) => formatMessage(msg, i)).join("\n\n");
+
+export const ConversationDownload = ({
+ messages,
+ filename = "conversation.md",
+ formatMessage = defaultFormatMessage,
+ className,
+ children,
+ ...props
+}: ConversationDownloadProps) => {
+ const handleDownload = useCallback(() => {
+ const markdown = messagesToMarkdown(messages, formatMessage);
+ const blob = new Blob([markdown], { type: "text/markdown" });
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = filename;
+ document.body.append(link);
+ link.click();
+ link.remove();
+ URL.revokeObjectURL(url);
+ }, [messages, filename, formatMessage]);
+
+ return (
+ <Button
+ className={cn(
+ "absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted",
+ className
+ )}
+ onClick={handleDownload}
+ size="icon"
+ type="button"
+ variant="outline"
+ {...props}
+ >
+ {children ?? <DownloadIcon className="size-4" />}
+ </Button>
+ );
+};
diff --git a/src/components/ai-elements/prompt-input.tsx b/src/components/ai-elements/prompt-input.tsx
new file mode 100644
index 0000000..5be6019
--- /dev/null
+++ b/src/components/ai-elements/prompt-input.tsx
@@ -0,0 +1,1463 @@
+"use client";
+
+import {
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+ CommandSeparator,
+} from "@/components/ui/command";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import {
+ HoverCard,
+ HoverCardContent,
+ HoverCardTrigger,
+} from "@/components/ui/hover-card";
+import {
+ InputGroup,
+ InputGroupAddon,
+ InputGroupButton,
+ InputGroupTextarea,
+} from "@/components/ui/input-group";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+import { Spinner } from "@/components/ui/spinner";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { cn } from "@/lib/utils";
+import type { ChatStatus, FileUIPart, SourceDocumentUIPart } from "ai";
+import {
+ CornerDownLeftIcon,
+ ImageIcon,
+ Monitor,
+ PlusIcon,
+ SquareIcon,
+ XIcon,
+} from "lucide-react";
+import { nanoid } from "nanoid";
+import type {
+ ChangeEvent,
+ ChangeEventHandler,
+ ClipboardEventHandler,
+ ComponentProps,
+ FormEvent,
+ FormEventHandler,
+ HTMLAttributes,
+ KeyboardEventHandler,
+ PropsWithChildren,
+ ReactNode,
+ RefObject,
+} from "react";
+import {
+ Children,
+ createContext,
+ useCallback,
+ useContext,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+} from "react";
+
+// ============================================================================
+// Helpers
+// ============================================================================
+
+const convertBlobUrlToDataUrl = async (url: string): Promise<string | null> => {
+ try {
+ const response = await fetch(url);
+ const blob = await response.blob();
+ // FileReader uses callback-based API, wrapping in Promise is necessary
+ // oxlint-disable-next-line eslint-plugin-promise(avoid-new)
+ return new Promise((resolve) => {
+ const reader = new FileReader();
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
+ reader.onloadend = () => resolve(reader.result as string);
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
+ reader.onerror = () => resolve(null);
+ reader.readAsDataURL(blob);
+ });
+ } catch {
+ return null;
+ }
+};
+
+const captureScreenshot = async (): Promise<File | null> => {
+ if (
+ typeof navigator === "undefined" ||
+ !navigator.mediaDevices?.getDisplayMedia
+ ) {
+ return null;
+ }
+
+ let stream: MediaStream | null = null;
+ const video = document.createElement("video");
+ video.muted = true;
+ video.playsInline = true;
+
+ try {
+ stream = await navigator.mediaDevices.getDisplayMedia({
+ audio: false,
+ video: true,
+ });
+
+ video.srcObject = stream;
+
+ // Video element uses callback-based API, wrapping in Promise is necessary
+ // oxlint-disable-next-line eslint-plugin-promise(avoid-new)
+ await new Promise<void>((resolve, reject) => {
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
+ video.onloadedmetadata = () => resolve();
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
+ video.onerror = () => reject(new Error("Failed to load screen stream"));
+ });
+
+ await video.play();
+
+ const width = video.videoWidth;
+ const height = video.videoHeight;
+ if (!width || !height) {
+ return null;
+ }
+
+ const canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ const context = canvas.getContext("2d");
+ if (!context) {
+ return null;
+ }
+
+ context.drawImage(video, 0, 0, width, height);
+ // canvas.toBlob uses callback-based API, wrapping in Promise is necessary
+ // oxlint-disable-next-line eslint-plugin-promise(avoid-new)
+ const blob = await new Promise<Blob | null>((resolve) => {
+ canvas.toBlob(resolve, "image/png");
+ });
+ if (!blob) {
+ return null;
+ }
+
+ const timestamp = new Date()
+ .toISOString()
+ .replaceAll(/[:.]/g, "-")
+ .replace("T", "_")
+ .replace("Z", "");
+
+ return new File([blob], `screenshot-${timestamp}.png`, {
+ lastModified: Date.now(),
+ type: "image/png",
+ });
+ } finally {
+ if (stream) {
+ for (const track of stream.getTracks()) {
+ track.stop();
+ }
+ }
+ video.pause();
+ video.srcObject = null;
+ }
+};
+
+// ============================================================================
+// Provider Context & Types
+// ============================================================================
+
+export interface AttachmentsContext {
+ files: (FileUIPart & { id: string })[];
+ add: (files: File[] | FileList) => void;
+ remove: (id: string) => void;
+ clear: () => void;
+ openFileDialog: () => void;
+ fileInputRef: RefObject<HTMLInputElement | null>;
+}
+
+export interface TextInputContext {
+ value: string;
+ setInput: (v: string) => void;
+ clear: () => void;
+}
+
+export interface PromptInputControllerProps {
+ textInput: TextInputContext;
+ attachments: AttachmentsContext;
+ /** INTERNAL: Allows PromptInput to register its file textInput + "open" callback */
+ __registerFileInput: (
+ ref: RefObject<HTMLInputElement | null>,
+ open: () => void
+ ) => void;
+}
+
+const PromptInputController = createContext<PromptInputControllerProps | null>(
+ null
+);
+const ProviderAttachmentsContext = createContext<AttachmentsContext | null>(
+ null
+);
+
+export const usePromptInputController = () => {
+ const ctx = useContext(PromptInputController);
+ if (!ctx) {
+ throw new Error(
+ "Wrap your component inside <PromptInputProvider> to use usePromptInputController()."
+ );
+ }
+ return ctx;
+};
+
+// Optional variants (do NOT throw). Useful for dual-mode components.
+const useOptionalPromptInputController = () =>
+ useContext(PromptInputController);
+
+export const useProviderAttachments = () => {
+ const ctx = useContext(ProviderAttachmentsContext);
+ if (!ctx) {
+ throw new Error(
+ "Wrap your component inside <PromptInputProvider> to use useProviderAttachments()."
+ );
+ }
+ return ctx;
+};
+
+const useOptionalProviderAttachments = () =>
+ useContext(ProviderAttachmentsContext);
+
+export type PromptInputProviderProps = PropsWithChildren<{
+ initialInput?: string;
+}>;
+
+/**
+ * Optional global provider that lifts PromptInput state outside of PromptInput.
+ * If you don't use it, PromptInput stays fully self-managed.
+ */
+export const PromptInputProvider = ({
+ initialInput: initialTextInput = "",
+ children,
+}: PromptInputProviderProps) => {
+ // ----- textInput state
+ const [textInput, setTextInput] = useState(initialTextInput);
+ const clearInput = useCallback(() => setTextInput(""), []);
+
+ // ----- attachments state (global when wrapped)
+ const [attachmentFiles, setAttachmentFiles] = useState<
+ (FileUIPart & { id: string })[]
+ >([]);
+ const fileInputRef = useRef<HTMLInputElement | null>(null);
+ // oxlint-disable-next-line eslint(no-empty-function)
+ const openRef = useRef<() => void>(() => {});
+
+ const add = useCallback((files: File[] | FileList) => {
+ const incoming = [...files];
+ if (incoming.length === 0) {
+ return;
+ }
+
+ setAttachmentFiles((prev) => [
+ ...prev,
+ ...incoming.map((file) => ({
+ filename: file.name,
+ id: nanoid(),
+ mediaType: file.type,
+ type: "file" as const,
+ url: URL.createObjectURL(file),
+ })),
+ ]);
+ }, []);
+
+ const remove = useCallback((id: string) => {
+ setAttachmentFiles((prev) => {
+ const found = prev.find((f) => f.id === id);
+ if (found?.url) {
+ URL.revokeObjectURL(found.url);
+ }
+ return prev.filter((f) => f.id !== id);
+ });
+ }, []);
+
+ const clear = useCallback(() => {
+ setAttachmentFiles((prev) => {
+ for (const f of prev) {
+ if (f.url) {
+ URL.revokeObjectURL(f.url);
+ }
+ }
+ return [];
+ });
+ }, []);
+
+ // Keep a ref to attachments for cleanup on unmount (avoids stale closure)
+ const attachmentsRef = useRef(attachmentFiles);
+
+ useEffect(() => {
+ attachmentsRef.current = attachmentFiles;
+ }, [attachmentFiles]);
+
+ // Cleanup blob URLs on unmount to prevent memory leaks
+ useEffect(
+ () => () => {
+ for (const f of attachmentsRef.current) {
+ if (f.url) {
+ URL.revokeObjectURL(f.url);
+ }
+ }
+ },
+ []
+ );
+
+ const openFileDialog = useCallback(() => {
+ openRef.current?.();
+ }, []);
+
+ const attachments = useMemo<AttachmentsContext>(
+ () => ({
+ add,
+ clear,
+ fileInputRef,
+ files: attachmentFiles,
+ openFileDialog,
+ remove,
+ }),
+ [attachmentFiles, add, remove, clear, openFileDialog]
+ );
+
+ const __registerFileInput = useCallback(
+ (ref: RefObject<HTMLInputElement | null>, open: () => void) => {
+ fileInputRef.current = ref.current;
+ openRef.current = open;
+ },
+ []
+ );
+
+ const controller = useMemo<PromptInputControllerProps>(
+ () => ({
+ __registerFileInput,
+ attachments,
+ textInput: {
+ clear: clearInput,
+ setInput: setTextInput,
+ value: textInput,
+ },
+ }),
+ [textInput, clearInput, attachments, __registerFileInput]
+ );
+
+ return (
+ <PromptInputController.Provider value={controller}>
+ <ProviderAttachmentsContext.Provider value={attachments}>
+ {children}
+ </ProviderAttachmentsContext.Provider>
+ </PromptInputController.Provider>
+ );
+};
+
+// ============================================================================
+// Component Context & Hooks
+// ============================================================================
+
+const LocalAttachmentsContext = createContext<AttachmentsContext | null>(null);
+
+export const usePromptInputAttachments = () => {
+ // Prefer local context (inside PromptInput) as it has validation, fall back to provider
+ const provider = useOptionalProviderAttachments();
+ const local = useContext(LocalAttachmentsContext);
+ const context = local ?? provider;
+ if (!context) {
+ throw new Error(
+ "usePromptInputAttachments must be used within a PromptInput or PromptInputProvider"
+ );
+ }
+ return context;
+};
+
+// ============================================================================
+// Referenced Sources (Local to PromptInput)
+// ============================================================================
+
+export interface ReferencedSourcesContext {
+ sources: (SourceDocumentUIPart & { id: string })[];
+ add: (sources: SourceDocumentUIPart[] | SourceDocumentUIPart) => void;
+ remove: (id: string) => void;
+ clear: () => void;
+}
+
+export const LocalReferencedSourcesContext =
+ createContext<ReferencedSourcesContext | null>(null);
+
+export const usePromptInputReferencedSources = () => {
+ const ctx = useContext(LocalReferencedSourcesContext);
+ if (!ctx) {
+ throw new Error(
+ "usePromptInputReferencedSources must be used within a LocalReferencedSourcesContext.Provider"
+ );
+ }
+ return ctx;
+};
+
+export type PromptInputActionAddAttachmentsProps = ComponentProps<
+ typeof DropdownMenuItem
+> & {
+ label?: string;
+};
+
+export const PromptInputActionAddAttachments = ({
+ label = "Add photos or files",
+ ...props
+}: PromptInputActionAddAttachmentsProps) => {
+ const attachments = usePromptInputAttachments();
+
+ const handleSelect = useCallback(
+ (e: Event) => {
+ e.preventDefault();
+ attachments.openFileDialog();
+ },
+ [attachments]
+ );
+
+ return (
+ <DropdownMenuItem {...props} onSelect={handleSelect}>
+ <ImageIcon className="mr-2 size-4" /> {label}
+ </DropdownMenuItem>
+ );
+};
+
+export type PromptInputActionAddScreenshotProps = ComponentProps<
+ typeof DropdownMenuItem
+> & {
+ label?: string;
+};
+
+export const PromptInputActionAddScreenshot = ({
+ label = "Take screenshot",
+ onSelect,
+ ...props
+}: PromptInputActionAddScreenshotProps) => {
+ const attachments = usePromptInputAttachments();
+
+ const handleSelect = useCallback(
+ async (event: Event) => {
+ onSelect?.(event);
+ if (event.defaultPrevented) {
+ return;
+ }
+
+ try {
+ const screenshot = await captureScreenshot();
+ if (screenshot) {
+ attachments.add([screenshot]);
+ }
+ } catch (error) {
+ if (
+ error instanceof DOMException &&
+ (error.name === "NotAllowedError" || error.name === "AbortError")
+ ) {
+ return;
+ }
+ throw error;
+ }
+ },
+ [onSelect, attachments]
+ );
+
+ return (
+ <DropdownMenuItem {...props} onSelect={handleSelect}>
+ <Monitor className="mr-2 size-4" />
+ {label}
+ </DropdownMenuItem>
+ );
+};
+
+export interface PromptInputMessage {
+ text: string;
+ files: FileUIPart[];
+}
+
+export type PromptInputProps = Omit<
+ HTMLAttributes<HTMLFormElement>,
+ "onSubmit" | "onError"
+> & {
+ // e.g., "image/*" or leave undefined for any
+ accept?: string;
+ multiple?: boolean;
+ // When true, accepts drops anywhere on document. Default false (opt-in).
+ globalDrop?: boolean;
+ // Render a hidden input with given name and keep it in sync for native form posts. Default false.
+ syncHiddenInput?: boolean;
+ // Minimal constraints
+ maxFiles?: number;
+ // bytes
+ maxFileSize?: number;
+ onError?: (err: {
+ code: "max_files" | "max_file_size" | "accept";
+ message: string;
+ }) => void;
+ onSubmit: (
+ message: PromptInputMessage,
+ event: FormEvent<HTMLFormElement>
+ ) => void | Promise<void>;
+};
+
+export const PromptInput = ({
+ className,
+ accept,
+ multiple,
+ globalDrop,
+ syncHiddenInput,
+ maxFiles,
+ maxFileSize,
+ onError,
+ onSubmit,
+ children,
+ ...props
+}: PromptInputProps) => {
+ // Try to use a provider controller if present
+ const controller = useOptionalPromptInputController();
+ const usingProvider = !!controller;
+
+ // Refs
+ const inputRef = useRef<HTMLInputElement | null>(null);
+ const formRef = useRef<HTMLFormElement | null>(null);
+
+ // ----- Local attachments (only used when no provider)
+ const [items, setItems] = useState<(FileUIPart & { id: string })[]>([]);
+ const files = usingProvider ? controller.attachments.files : items;
+
+ // ----- Local referenced sources (always local to PromptInput)
+ const [referencedSources, setReferencedSources] = useState<
+ (SourceDocumentUIPart & { id: string })[]
+ >([]);
+
+ // Keep a ref to files for cleanup on unmount (avoids stale closure)
+ const filesRef = useRef(files);
+
+ useEffect(() => {
+ filesRef.current = files;
+ }, [files]);
+
+ const openFileDialogLocal = useCallback(() => {
+ inputRef.current?.click();
+ }, []);
+
+ const matchesAccept = useCallback(
+ (f: File) => {
+ if (!accept || accept.trim() === "") {
+ return true;
+ }
+
+ const patterns = accept
+ .split(",")
+ .map((s) => s.trim())
+ .filter(Boolean);
+
+ return patterns.some((pattern) => {
+ if (pattern.endsWith("/*")) {
+ // e.g: image/* -> image/
+ const prefix = pattern.slice(0, -1);
+ return f.type.startsWith(prefix);
+ }
+ return f.type === pattern;
+ });
+ },
+ [accept]
+ );
+
+ const addLocal = useCallback(
+ (fileList: File[] | FileList) => {
+ const incoming = [...fileList];
+ const accepted = incoming.filter((f) => matchesAccept(f));
+ if (incoming.length && accepted.length === 0) {
+ onError?.({
+ code: "accept",
+ message: "No files match the accepted types.",
+ });
+ return;
+ }
+ const withinSize = (f: File) =>
+ maxFileSize ? f.size <= maxFileSize : true;
+ const sized = accepted.filter(withinSize);
+ if (accepted.length > 0 && sized.length === 0) {
+ onError?.({
+ code: "max_file_size",
+ message: "All files exceed the maximum size.",
+ });
+ return;
+ }
+
+ setItems((prev) => {
+ const capacity =
+ typeof maxFiles === "number"
+ ? Math.max(0, maxFiles - prev.length)
+ : undefined;
+ const capped =
+ typeof capacity === "number" ? sized.slice(0, capacity) : sized;
+ if (typeof capacity === "number" && sized.length > capacity) {
+ onError?.({
+ code: "max_files",
+ message: "Too many files. Some were not added.",
+ });
+ }
+ const next: (FileUIPart & { id: string })[] = [];
+ for (const file of capped) {
+ next.push({
+ filename: file.name,
+ id: nanoid(),
+ mediaType: file.type,
+ type: "file",
+ url: URL.createObjectURL(file),
+ });
+ }
+ return [...prev, ...next];
+ });
+ },
+ [matchesAccept, maxFiles, maxFileSize, onError]
+ );
+
+ const removeLocal = useCallback(
+ (id: string) =>
+ setItems((prev) => {
+ const found = prev.find((file) => file.id === id);
+ if (found?.url) {
+ URL.revokeObjectURL(found.url);
+ }
+ return prev.filter((file) => file.id !== id);
+ }),
+ []
+ );
+
+ // Wrapper that validates files before calling provider's add
+ const addWithProviderValidation = useCallback(
+ (fileList: File[] | FileList) => {
+ const incoming = [...fileList];
+ const accepted = incoming.filter((f) => matchesAccept(f));
+ if (incoming.length && accepted.length === 0) {
+ onError?.({
+ code: "accept",
+ message: "No files match the accepted types.",
+ });
+ return;
+ }
+ const withinSize = (f: File) =>
+ maxFileSize ? f.size <= maxFileSize : true;
+ const sized = accepted.filter(withinSize);
+ if (accepted.length > 0 && sized.length === 0) {
+ onError?.({
+ code: "max_file_size",
+ message: "All files exceed the maximum size.",
+ });
+ return;
+ }
+
+ const currentCount = files.length;
+ const capacity =
+ typeof maxFiles === "number"
+ ? Math.max(0, maxFiles - currentCount)
+ : undefined;
+ const capped =
+ typeof capacity === "number" ? sized.slice(0, capacity) : sized;
+ if (typeof capacity === "number" && sized.length > capacity) {
+ onError?.({
+ code: "max_files",
+ message: "Too many files. Some were not added.",
+ });
+ }
+
+ if (capped.length > 0) {
+ controller?.attachments.add(capped);
+ }
+ },
+ [matchesAccept, maxFileSize, maxFiles, onError, files.length, controller]
+ );
+
+ const clearAttachments = useCallback(
+ () =>
+ usingProvider
+ ? controller?.attachments.clear()
+ : setItems((prev) => {
+ for (const file of prev) {
+ if (file.url) {
+ URL.revokeObjectURL(file.url);
+ }
+ }
+ return [];
+ }),
+ [usingProvider, controller]
+ );
+
+ const clearReferencedSources = useCallback(
+ () => setReferencedSources([]),
+ []
+ );
+
+ const add = usingProvider ? addWithProviderValidation : addLocal;
+ const remove = usingProvider ? controller.attachments.remove : removeLocal;
+ const openFileDialog = usingProvider
+ ? controller.attachments.openFileDialog
+ : openFileDialogLocal;
+
+ const clear = useCallback(() => {
+ clearAttachments();
+ clearReferencedSources();
+ }, [clearAttachments, clearReferencedSources]);
+
+ // Let provider know about our hidden file input so external menus can call openFileDialog()
+ useEffect(() => {
+ if (!usingProvider) {
+ return;
+ }
+ controller.__registerFileInput(inputRef, () => inputRef.current?.click());
+ }, [usingProvider, controller]);
+
+ // Note: File input cannot be programmatically set for security reasons
+ // The syncHiddenInput prop is no longer functional
+ useEffect(() => {
+ if (syncHiddenInput && inputRef.current && files.length === 0) {
+ inputRef.current.value = "";
+ }
+ }, [files, syncHiddenInput]);
+
+ // Attach drop handlers on nearest form and document (opt-in)
+ useEffect(() => {
+ const form = formRef.current;
+ if (!form) {
+ return;
+ }
+ if (globalDrop) {
+ // when global drop is on, let the document-level handler own drops
+ return;
+ }
+
+ const onDragOver = (e: DragEvent) => {
+ if (e.dataTransfer?.types?.includes("Files")) {
+ e.preventDefault();
+ }
+ };
+ const onDrop = (e: DragEvent) => {
+ if (e.dataTransfer?.types?.includes("Files")) {
+ e.preventDefault();
+ }
+ if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
+ add(e.dataTransfer.files);
+ }
+ };
+ form.addEventListener("dragover", onDragOver);
+ form.addEventListener("drop", onDrop);
+ return () => {
+ form.removeEventListener("dragover", onDragOver);
+ form.removeEventListener("drop", onDrop);
+ };
+ }, [add, globalDrop]);
+
+ useEffect(() => {
+ if (!globalDrop) {
+ return;
+ }
+
+ const onDragOver = (e: DragEvent) => {
+ if (e.dataTransfer?.types?.includes("Files")) {
+ e.preventDefault();
+ }
+ };
+ const onDrop = (e: DragEvent) => {
+ if (e.dataTransfer?.types?.includes("Files")) {
+ e.preventDefault();
+ }
+ if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
+ add(e.dataTransfer.files);
+ }
+ };
+ document.addEventListener("dragover", onDragOver);
+ document.addEventListener("drop", onDrop);
+ return () => {
+ document.removeEventListener("dragover", onDragOver);
+ document.removeEventListener("drop", onDrop);
+ };
+ }, [add, globalDrop]);
+
+ useEffect(
+ () => () => {
+ if (!usingProvider) {
+ for (const f of filesRef.current) {
+ if (f.url) {
+ URL.revokeObjectURL(f.url);
+ }
+ }
+ }
+ },
+ [usingProvider]
+ );
+
+ const handleChange: ChangeEventHandler<HTMLInputElement> = useCallback(
+ (event) => {
+ if (event.currentTarget.files) {
+ add(event.currentTarget.files);
+ }
+ // Reset input value to allow selecting files that were previously removed
+ event.currentTarget.value = "";
+ },
+ [add]
+ );
+
+ const attachmentsCtx = useMemo<AttachmentsContext>(
+ () => ({
+ add,
+ clear: clearAttachments,
+ fileInputRef: inputRef,
+ files: files.map((item) => ({ ...item, id: item.id })),
+ openFileDialog,
+ remove,
+ }),
+ [files, add, remove, clearAttachments, openFileDialog]
+ );
+
+ const refsCtx = useMemo<ReferencedSourcesContext>(
+ () => ({
+ add: (incoming: SourceDocumentUIPart[] | SourceDocumentUIPart) => {
+ const array = Array.isArray(incoming) ? incoming : [incoming];
+ setReferencedSources((prev) => [
+ ...prev,
+ ...array.map((s) => ({ ...s, id: nanoid() })),
+ ]);
+ },
+ clear: clearReferencedSources,
+ remove: (id: string) => {
+ setReferencedSources((prev) => prev.filter((s) => s.id !== id));
+ },
+ sources: referencedSources,
+ }),
+ [referencedSources, clearReferencedSources]
+ );
+
+ const handleSubmit: FormEventHandler<HTMLFormElement> = useCallback(
+ async (event) => {
+ event.preventDefault();
+
+ const form = event.currentTarget;
+ const text = usingProvider
+ ? controller.textInput.value
+ : (() => {
+ const formData = new FormData(form);
+ return (formData.get("message") as string) || "";
+ })();
+
+ // Reset form immediately after capturing text to avoid race condition
+ // where user input during async blob conversion would be lost
+ if (!usingProvider) {
+ form.reset();
+ }
+
+ try {
+ // Convert blob URLs to data URLs asynchronously
+ const convertedFiles: FileUIPart[] = await Promise.all(
+ files.map(async ({ id: _id, ...item }) => {
+ if (item.url?.startsWith("blob:")) {
+ const dataUrl = await convertBlobUrlToDataUrl(item.url);
+ // If conversion failed, keep the original blob URL
+ return {
+ ...item,
+ url: dataUrl ?? item.url,
+ };
+ }
+ return item;
+ })
+ );
+
+ const result = onSubmit({ files: convertedFiles, text }, event);
+
+ // Handle both sync and async onSubmit
+ if (result instanceof Promise) {
+ try {
+ await result;
+ clear();
+ if (usingProvider) {
+ controller.textInput.clear();
+ }
+ } catch {
+ // Don't clear on error - user may want to retry
+ }
+ } else {
+ // Sync function completed without throwing, clear inputs
+ clear();
+ if (usingProvider) {
+ controller.textInput.clear();
+ }
+ }
+ } catch {
+ // Don't clear on error - user may want to retry
+ }
+ },
+ [usingProvider, controller, files, onSubmit, clear]
+ );
+
+ // Render with or without local provider
+ const inner = (
+ <>
+ <input
+ accept={accept}
+ aria-label="Upload files"
+ className="hidden"
+ multiple={multiple}
+ onChange={handleChange}
+ ref={inputRef}
+ title="Upload files"
+ type="file"
+ />
+ <form
+ className={cn("w-full", className)}
+ onSubmit={handleSubmit}
+ ref={formRef}
+ {...props}
+ >
+ <InputGroup className="overflow-hidden">{children}</InputGroup>
+ </form>
+ </>
+ );
+
+ const withReferencedSources = (
+ <LocalReferencedSourcesContext.Provider value={refsCtx}>
+ {inner}
+ </LocalReferencedSourcesContext.Provider>
+ );
+
+ // Always provide LocalAttachmentsContext so children get validated add function
+ return (
+ <LocalAttachmentsContext.Provider value={attachmentsCtx}>
+ {withReferencedSources}
+ </LocalAttachmentsContext.Provider>
+ );
+};
+
+export type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;
+
+export const PromptInputBody = ({
+ className,
+ ...props
+}: PromptInputBodyProps) => (
+ <div className={cn("contents", className)} {...props} />
+);
+
+export type PromptInputTextareaProps = ComponentProps<
+ typeof InputGroupTextarea
+>;
+
+export const PromptInputTextarea = ({
+ onChange,
+ onKeyDown,
+ className,
+ placeholder = "What would you like to know?",
+ ...props
+}: PromptInputTextareaProps) => {
+ const controller = useOptionalPromptInputController();
+ const attachments = usePromptInputAttachments();
+ const [isComposing, setIsComposing] = useState(false);
+
+ const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = useCallback(
+ (e) => {
+ // Call the external onKeyDown handler first
+ onKeyDown?.(e);
+
+ // If the external handler prevented default, don't run internal logic
+ if (e.defaultPrevented) {
+ return;
+ }
+
+ if (e.key === "Enter") {
+ if (isComposing || e.nativeEvent.isComposing) {
+ return;
+ }
+ if (e.shiftKey) {
+ return;
+ }
+ e.preventDefault();
+
+ // Check if the submit button is disabled before submitting
+ const { form } = e.currentTarget;
+ const submitButton = form?.querySelector(
+ 'button[type="submit"]'
+ ) as HTMLButtonElement | null;
+ if (submitButton?.disabled) {
+ return;
+ }
+
+ form?.requestSubmit();
+ }
+
+ // Remove last attachment when Backspace is pressed and textarea is empty
+ if (
+ e.key === "Backspace" &&
+ e.currentTarget.value === "" &&
+ attachments.files.length > 0
+ ) {
+ e.preventDefault();
+ const lastAttachment = attachments.files.at(-1);
+ if (lastAttachment) {
+ attachments.remove(lastAttachment.id);
+ }
+ }
+ },
+ [onKeyDown, isComposing, attachments]
+ );
+
+ const handlePaste: ClipboardEventHandler<HTMLTextAreaElement> = useCallback(
+ (event) => {
+ const items = event.clipboardData?.items;
+
+ if (!items) {
+ return;
+ }
+
+ const files: File[] = [];
+
+ for (const item of items) {
+ if (item.kind === "file") {
+ const file = item.getAsFile();
+ if (file) {
+ files.push(file);
+ }
+ }
+ }
+
+ if (files.length > 0) {
+ event.preventDefault();
+ attachments.add(files);
+ }
+ },
+ [attachments]
+ );
+
+ const handleCompositionEnd = useCallback(() => setIsComposing(false), []);
+ const handleCompositionStart = useCallback(() => setIsComposing(true), []);
+
+ const controlledProps = controller
+ ? {
+ onChange: (e: ChangeEvent<HTMLTextAreaElement>) => {
+ controller.textInput.setInput(e.currentTarget.value);
+ onChange?.(e);
+ },
+ value: controller.textInput.value,
+ }
+ : {
+ onChange,
+ };
+
+ return (
+ <InputGroupTextarea
+ className={cn("field-sizing-content max-h-48 min-h-16", className)}
+ name="message"
+ onCompositionEnd={handleCompositionEnd}
+ onCompositionStart={handleCompositionStart}
+ onKeyDown={handleKeyDown}
+ onPaste={handlePaste}
+ placeholder={placeholder}
+ {...props}
+ {...controlledProps}
+ />
+ );
+};
+
+export type PromptInputHeaderProps = Omit<
+ ComponentProps<typeof InputGroupAddon>,
+ "align"
+>;
+
+export const PromptInputHeader = ({
+ className,
+ ...props
+}: PromptInputHeaderProps) => (
+ <InputGroupAddon
+ align="block-end"
+ className={cn("order-first flex-wrap gap-1", className)}
+ {...props}
+ />
+);
+
+export type PromptInputFooterProps = Omit<
+ ComponentProps<typeof InputGroupAddon>,
+ "align"
+>;
+
+export const PromptInputFooter = ({
+ className,
+ ...props
+}: PromptInputFooterProps) => (
+ <InputGroupAddon
+ align="block-end"
+ className={cn("justify-between gap-1", className)}
+ {...props}
+ />
+);
+
+export type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;
+
+export const PromptInputTools = ({
+ className,
+ ...props
+}: PromptInputToolsProps) => (
+ <div
+ className={cn("flex min-w-0 items-center gap-1", className)}
+ {...props}
+ />
+);
+
+export type PromptInputButtonTooltip =
+ | string
+ | {
+ content: ReactNode;
+ shortcut?: string;
+ side?: ComponentProps<typeof TooltipContent>["side"];
+ };
+
+export type PromptInputButtonProps = ComponentProps<typeof InputGroupButton> & {
+ tooltip?: PromptInputButtonTooltip;
+};
+
+export const PromptInputButton = ({
+ variant = "ghost",
+ className,
+ size,
+ tooltip,
+ ...props
+}: PromptInputButtonProps) => {
+ const newSize =
+ size ?? (Children.count(props.children) > 1 ? "sm" : "icon-sm");
+
+ const button = (
+ <InputGroupButton
+ className={cn(className)}
+ size={newSize}
+ type="button"
+ variant={variant}
+ {...props}
+ />
+ );
+
+ if (!tooltip) {
+ return button;
+ }
+
+ const tooltipContent =
+ typeof tooltip === "string" ? tooltip : tooltip.content;
+ const shortcut = typeof tooltip === "string" ? undefined : tooltip.shortcut;
+ const side = typeof tooltip === "string" ? "top" : (tooltip.side ?? "top");
+
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>{button}</TooltipTrigger>
+ <TooltipContent side={side}>
+ {tooltipContent}
+ {shortcut && (
+ <span className="ml-2 text-muted-foreground">{shortcut}</span>
+ )}
+ </TooltipContent>
+ </Tooltip>
+ );
+};
+
+export type PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;
+export const PromptInputActionMenu = (props: PromptInputActionMenuProps) => (
+ <DropdownMenu {...props} />
+);
+
+export type PromptInputActionMenuTriggerProps = PromptInputButtonProps;
+
+export const PromptInputActionMenuTrigger = ({
+ className,
+ children,
+ ...props
+}: PromptInputActionMenuTriggerProps) => (
+ <DropdownMenuTrigger asChild>
+ <PromptInputButton className={className} {...props}>
+ {children ?? <PlusIcon className="size-4" />}
+ </PromptInputButton>
+ </DropdownMenuTrigger>
+);
+
+export type PromptInputActionMenuContentProps = ComponentProps<
+ typeof DropdownMenuContent
+>;
+export const PromptInputActionMenuContent = ({
+ className,
+ ...props
+}: PromptInputActionMenuContentProps) => (
+ <DropdownMenuContent align="start" className={cn(className)} {...props} />
+);
+
+export type PromptInputActionMenuItemProps = ComponentProps<
+ typeof DropdownMenuItem
+>;
+export const PromptInputActionMenuItem = ({
+ className,
+ ...props
+}: PromptInputActionMenuItemProps) => (
+ <DropdownMenuItem className={cn(className)} {...props} />
+);
+
+// Note: Actions that perform side-effects (like opening a file dialog)
+// are provided in opt-in modules (e.g., prompt-input-attachments).
+
+export type PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {
+ status?: ChatStatus;
+ onStop?: () => void;
+};
+
+export const PromptInputSubmit = ({
+ className,
+ variant = "default",
+ size = "icon-sm",
+ status,
+ onStop,
+ onClick,
+ children,
+ ...props
+}: PromptInputSubmitProps) => {
+ const isGenerating = status === "submitted" || status === "streaming";
+
+ let Icon = <CornerDownLeftIcon className="size-4" />;
+
+ if (status === "submitted") {
+ Icon = <Spinner />;
+ } else if (status === "streaming") {
+ Icon = <SquareIcon className="size-4" />;
+ } else if (status === "error") {
+ Icon = <XIcon className="size-4" />;
+ }
+
+ const handleClick = useCallback(
+ (e: React.MouseEvent<HTMLButtonElement>) => {
+ if (isGenerating && onStop) {
+ e.preventDefault();
+ onStop();
+ return;
+ }
+ onClick?.(e);
+ },
+ [isGenerating, onStop, onClick]
+ );
+
+ return (
+ <InputGroupButton
+ aria-label={isGenerating ? "Stop" : "Submit"}
+ className={cn(className)}
+ onClick={handleClick}
+ size={size}
+ type={isGenerating && onStop ? "button" : "submit"}
+ variant={variant}
+ {...props}
+ >
+ {children ?? Icon}
+ </InputGroupButton>
+ );
+};
+
+export type PromptInputSelectProps = ComponentProps<typeof Select>;
+
+export const PromptInputSelect = (props: PromptInputSelectProps) => (
+ <Select {...props} />
+);
+
+export type PromptInputSelectTriggerProps = ComponentProps<
+ typeof SelectTrigger
+>;
+
+export const PromptInputSelectTrigger = ({
+ className,
+ ...props
+}: PromptInputSelectTriggerProps) => (
+ <SelectTrigger
+ className={cn(
+ "border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors",
+ "hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground",
+ className
+ )}
+ {...props}
+ />
+);
+
+export type PromptInputSelectContentProps = ComponentProps<
+ typeof SelectContent
+>;
+
+export const PromptInputSelectContent = ({
+ className,
+ ...props
+}: PromptInputSelectContentProps) => (
+ <SelectContent className={cn(className)} {...props} />
+);
+
+export type PromptInputSelectItemProps = ComponentProps<typeof SelectItem>;
+
+export const PromptInputSelectItem = ({
+ className,
+ ...props
+}: PromptInputSelectItemProps) => (
+ <SelectItem className={cn(className)} {...props} />
+);
+
+export type PromptInputSelectValueProps = ComponentProps<typeof SelectValue>;
+
+export const PromptInputSelectValue = ({
+ className,
+ ...props
+}: PromptInputSelectValueProps) => (
+ <SelectValue className={cn(className)} {...props} />
+);
+
+export type PromptInputHoverCardProps = ComponentProps<typeof HoverCard>;
+
+export const PromptInputHoverCard = ({
+ openDelay = 0,
+ closeDelay = 0,
+ ...props
+}: PromptInputHoverCardProps) => (
+ <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />
+);
+
+export type PromptInputHoverCardTriggerProps = ComponentProps<
+ typeof HoverCardTrigger
+>;
+
+export const PromptInputHoverCardTrigger = (
+ props: PromptInputHoverCardTriggerProps
+) => <HoverCardTrigger {...props} />;
+
+export type PromptInputHoverCardContentProps = ComponentProps<
+ typeof HoverCardContent
+>;
+
+export const PromptInputHoverCardContent = ({
+ align = "start",
+ ...props
+}: PromptInputHoverCardContentProps) => (
+ <HoverCardContent align={align} {...props} />
+);
+
+export type PromptInputTabsListProps = HTMLAttributes<HTMLDivElement>;
+
+export const PromptInputTabsList = ({
+ className,
+ ...props
+}: PromptInputTabsListProps) => <div className={cn(className)} {...props} />;
+
+export type PromptInputTabProps = HTMLAttributes<HTMLDivElement>;
+
+export const PromptInputTab = ({
+ className,
+ ...props
+}: PromptInputTabProps) => <div className={cn(className)} {...props} />;
+
+export type PromptInputTabLabelProps = HTMLAttributes<HTMLHeadingElement>;
+
+export const PromptInputTabLabel = ({
+ className,
+ ...props
+}: PromptInputTabLabelProps) => (
+ // Content provided via children in props
+ // oxlint-disable-next-line eslint-plugin-jsx-a11y(heading-has-content)
+ <h3
+ className={cn(
+ "mb-2 px-3 font-medium text-muted-foreground text-xs",
+ className
+ )}
+ {...props}
+ />
+);
+
+export type PromptInputTabBodyProps = HTMLAttributes<HTMLDivElement>;
+
+export const PromptInputTabBody = ({
+ className,
+ ...props
+}: PromptInputTabBodyProps) => (
+ <div className={cn("space-y-1", className)} {...props} />
+);
+
+export type PromptInputTabItemProps = HTMLAttributes<HTMLDivElement>;
+
+export const PromptInputTabItem = ({
+ className,
+ ...props
+}: PromptInputTabItemProps) => (
+ <div
+ className={cn(
+ "flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent",
+ className
+ )}
+ {...props}
+ />
+);
+
+export type PromptInputCommandProps = ComponentProps<typeof Command>;
+
+export const PromptInputCommand = ({
+ className,
+ ...props
+}: PromptInputCommandProps) => <Command className={cn(className)} {...props} />;
+
+export type PromptInputCommandInputProps = ComponentProps<typeof CommandInput>;
+
+export const PromptInputCommandInput = ({
+ className,
+ ...props
+}: PromptInputCommandInputProps) => (
+ <CommandInput className={cn(className)} {...props} />
+);
+
+export type PromptInputCommandListProps = ComponentProps<typeof CommandList>;
+
+export const PromptInputCommandList = ({
+ className,
+ ...props
+}: PromptInputCommandListProps) => (
+ <CommandList className={cn(className)} {...props} />
+);
+
+export type PromptInputCommandEmptyProps = ComponentProps<typeof CommandEmpty>;
+
+export const PromptInputCommandEmpty = ({
+ className,
+ ...props
+}: PromptInputCommandEmptyProps) => (
+ <CommandEmpty className={cn(className)} {...props} />
+);
+
+export type PromptInputCommandGroupProps = ComponentProps<typeof CommandGroup>;
+
+export const PromptInputCommandGroup = ({
+ className,
+ ...props
+}: PromptInputCommandGroupProps) => (
+ <CommandGroup className={cn(className)} {...props} />
+);
+
+export type PromptInputCommandItemProps = ComponentProps<typeof CommandItem>;
+
+export const PromptInputCommandItem = ({
+ className,
+ ...props
+}: PromptInputCommandItemProps) => (
+ <CommandItem className={cn(className)} {...props} />
+);
+
+export type PromptInputCommandSeparatorProps = ComponentProps<
+ typeof CommandSeparator
+>;
+
+export const PromptInputCommandSeparator = ({
+ className,
+ ...props
+}: PromptInputCommandSeparatorProps) => (
+ <CommandSeparator className={cn(className)} {...props} />
+);
diff --git a/src/components/ai-elements/suggestion.tsx b/src/components/ai-elements/suggestion.tsx
new file mode 100644
index 0000000..f037ff4
--- /dev/null
+++ b/src/components/ai-elements/suggestion.tsx
@@ -0,0 +1,57 @@
+"use client";
+
+import { Button } from "@/components/ui/button";
+import {
+ ScrollArea,
+ ScrollBar,
+} from "@/components/ui/scroll-area";
+import { cn } from "@/lib/utils";
+import type { ComponentProps } from "react";
+import { useCallback } from "react";
+
+export type SuggestionsProps = ComponentProps<typeof ScrollArea>;
+
+export const Suggestions = ({
+ className,
+ children,
+ ...props
+}: SuggestionsProps) => (
+ <ScrollArea className="w-full overflow-x-auto whitespace-nowrap" {...props}>
+ <div className={cn("flex w-max flex-nowrap items-center gap-2", className)}>
+ {children}
+ </div>
+ <ScrollBar className="hidden" orientation="horizontal" />
+ </ScrollArea>
+);
+
+export type SuggestionProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
+ suggestion: string;
+ onClick?: (suggestion: string) => void;
+};
+
+export const Suggestion = ({
+ suggestion,
+ onClick,
+ className,
+ variant = "outline",
+ size = "sm",
+ children,
+ ...props
+}: SuggestionProps) => {
+ const handleClick = useCallback(() => {
+ onClick?.(suggestion);
+ }, [onClick, suggestion]);
+
+ return (
+ <Button
+ className={cn("cursor-pointer rounded-full px-4", className)}
+ onClick={handleClick}
+ size={size}
+ type="button"
+ variant={variant}
+ {...props}
+ >
+ {children || suggestion}
+ </Button>
+ );
+};
diff --git a/src/components/ai-elements/task.tsx b/src/components/ai-elements/task.tsx
new file mode 100644
index 0000000..eeb802c
--- /dev/null
+++ b/src/components/ai-elements/task.tsx
@@ -0,0 +1,87 @@
+"use client";
+
+import {
+ Collapsible,
+ CollapsibleContent,
+ CollapsibleTrigger,
+} from "@/components/ui/collapsible";
+import { cn } from "@/lib/utils";
+import { ChevronDownIcon, SearchIcon } from "lucide-react";
+import type { ComponentProps } from "react";
+
+export type TaskItemFileProps = ComponentProps<"div">;
+
+export const TaskItemFile = ({
+ children,
+ className,
+ ...props
+}: TaskItemFileProps) => (
+ <div
+ className={cn(
+ "inline-flex items-center gap-1 rounded-md border bg-secondary px-1.5 py-0.5 text-foreground text-xs",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+);
+
+export type TaskItemProps = ComponentProps<"div">;
+
+export const TaskItem = ({ children, className, ...props }: TaskItemProps) => (
+ <div className={cn("text-muted-foreground text-sm", className)} {...props}>
+ {children}
+ </div>
+);
+
+export type TaskProps = ComponentProps<typeof Collapsible>;
+
+export const Task = ({
+ defaultOpen = true,
+ className,
+ ...props
+}: TaskProps) => (
+ <Collapsible className={cn(className)} defaultOpen={defaultOpen} {...props} />
+);
+
+export type TaskTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
+ title: string;
+};
+
+export const TaskTrigger = ({
+ children,
+ className,
+ title,
+ ...props
+}: TaskTriggerProps) => (
+ <CollapsibleTrigger asChild className={cn("group", className)} {...props}>
+ {children ?? (
+ <div className="flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground">
+ <SearchIcon className="size-4" />
+ <p className="text-sm">{title}</p>
+ <ChevronDownIcon className="size-4 transition-transform group-data-[state=open]:rotate-180" />
+ </div>
+ )}
+ </CollapsibleTrigger>
+);
+
+export type TaskContentProps = ComponentProps<typeof CollapsibleContent>;
+
+export const TaskContent = ({
+ children,
+ className,
+ ...props
+}: TaskContentProps) => (
+ <CollapsibleContent
+ className={cn(
+ "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
+ className
+ )}
+ {...props}
+ >
+ <div className="mt-4 space-y-2 border-muted border-l-2 pl-4">
+ {children}
+ </div>
+ </CollapsibleContent>
+);
diff --git a/src/components/ai-elements/tool.tsx b/src/components/ai-elements/tool.tsx
new file mode 100644
index 0000000..18c4bb8
--- /dev/null
+++ b/src/components/ai-elements/tool.tsx
@@ -0,0 +1,173 @@
+"use client";
+
+import { Badge } from "@/components/ui/badge";
+import {
+ Collapsible,
+ CollapsibleContent,
+ CollapsibleTrigger,
+} from "@/components/ui/collapsible";
+import { cn } from "@/lib/utils";
+import type { DynamicToolUIPart, ToolUIPart } from "ai";
+import {
+ CheckCircleIcon,
+ ChevronDownIcon,
+ CircleIcon,
+ ClockIcon,
+ WrenchIcon,
+ XCircleIcon,
+} from "lucide-react";
+import type { ComponentProps, ReactNode } from "react";
+import { isValidElement } from "react";
+
+import { CodeBlock } from "./code-block";
+
+export type ToolProps = ComponentProps<typeof Collapsible>;
+
+export const Tool = ({ className, ...props }: ToolProps) => (
+ <Collapsible
+ className={cn("group not-prose mb-4 w-full rounded-md border", className)}
+ {...props}
+ />
+);
+
+export type ToolPart = ToolUIPart | DynamicToolUIPart;
+
+export type ToolHeaderProps = {
+ title?: string;
+ className?: string;
+} & (
+ | { type: ToolUIPart["type"]; state: ToolUIPart["state"]; toolName?: never }
+ | {
+ type: DynamicToolUIPart["type"];
+ state: DynamicToolUIPart["state"];
+ toolName: string;
+ }
+);
+
+const statusLabels: Record<ToolPart["state"], string> = {
+ "approval-requested": "Awaiting Approval",
+ "approval-responded": "Responded",
+ "input-available": "Running",
+ "input-streaming": "Pending",
+ "output-available": "Completed",
+ "output-denied": "Denied",
+ "output-error": "Error",
+};
+
+const statusIcons: Record<ToolPart["state"], ReactNode> = {
+ "approval-requested": <ClockIcon className="size-4 text-yellow-600" />,
+ "approval-responded": <CheckCircleIcon className="size-4 text-blue-600" />,
+ "input-available": <ClockIcon className="size-4 animate-pulse" />,
+ "input-streaming": <CircleIcon className="size-4" />,
+ "output-available": <CheckCircleIcon className="size-4 text-green-600" />,
+ "output-denied": <XCircleIcon className="size-4 text-orange-600" />,
+ "output-error": <XCircleIcon className="size-4 text-red-600" />,
+};
+
+export const getStatusBadge = (status: ToolPart["state"]) => (
+ <Badge className="gap-1.5 rounded-full text-xs" variant="secondary">
+ {statusIcons[status]}
+ {statusLabels[status]}
+ </Badge>
+);
+
+export const ToolHeader = ({
+ className,
+ title,
+ type,
+ state,
+ toolName,
+ ...props
+}: ToolHeaderProps) => {
+ const derivedName =
+ type === "dynamic-tool" ? toolName : type.split("-").slice(1).join("-");
+
+ return (
+ <CollapsibleTrigger
+ className={cn(
+ "flex w-full items-center justify-between gap-4 p-3",
+ className
+ )}
+ {...props}
+ >
+ <div className="flex items-center gap-2">
+ <WrenchIcon className="size-4 text-muted-foreground" />
+ <span className="font-medium text-sm">{title ?? derivedName}</span>
+ {getStatusBadge(state)}
+ </div>
+ <ChevronDownIcon className="size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" />
+ </CollapsibleTrigger>
+ );
+};
+
+export type ToolContentProps = ComponentProps<typeof CollapsibleContent>;
+
+export const ToolContent = ({ className, ...props }: ToolContentProps) => (
+ <CollapsibleContent
+ className={cn(
+ "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
+ className
+ )}
+ {...props}
+ />
+);
+
+export type ToolInputProps = ComponentProps<"div"> & {
+ input: ToolPart["input"];
+};
+
+export const ToolInput = ({ className, input, ...props }: ToolInputProps) => (
+ <div className={cn("space-y-2 overflow-hidden", className)} {...props}>
+ <h4 className="font-medium text-muted-foreground text-xs uppercase tracking-wide">
+ Parameters
+ </h4>
+ <div className="rounded-md bg-muted/50">
+ <CodeBlock code={JSON.stringify(input, null, 2)} language="json" />
+ </div>
+ </div>
+);
+
+export type ToolOutputProps = ComponentProps<"div"> & {
+ output: ToolPart["output"];
+ errorText: ToolPart["errorText"];
+};
+
+export const ToolOutput = ({
+ className,
+ output,
+ errorText,
+ ...props
+}: ToolOutputProps) => {
+ if (!(output || errorText)) {
+ return null;
+ }
+
+ let Output = <div>{output as ReactNode}</div>;
+
+ if (typeof output === "object" && !isValidElement(output)) {
+ Output = (
+ <CodeBlock code={JSON.stringify(output, null, 2)} language="json" />
+ );
+ } else if (typeof output === "string") {
+ Output = <CodeBlock code={output} language="json" />;
+ }
+
+ return (
+ <div className={cn("space-y-2", className)} {...props}>
+ <h4 className="font-medium text-muted-foreground text-xs uppercase tracking-wide">
+ {errorText ? "Error" : "Result"}
+ </h4>
+ <div
+ className={cn(
+ "overflow-x-auto rounded-md text-xs [&_table]:w-full",
+ errorText
+ ? "bg-destructive/10 text-destructive"
+ : "bg-muted/50 text-foreground"
+ )}
+ >
+ {errorText && <div>{errorText}</div>}
+ {Output}
+ </div>
+ </div>
+ );
+};
diff --git a/src/components/myjobs/GenerateCoverLetterSection.tsx b/src/components/myjobs/GenerateCoverLetterSection.tsx
index f32224a..9332720 100644
--- a/src/components/myjobs/GenerateCoverLetterSection.tsx
+++ b/src/components/myjobs/GenerateCoverLetterSection.tsx
@@ -19,6 +19,7 @@ import { toastSuccess, toastError } from "@/lib/toast";
import { APP_CONSTANTS } from "@/lib/constants";
import { AiModel, defaultModel } from "@/models/ai.model";
import { useSheetAutoScroll } from "@/hooks/useSheetAutoScroll";
+import { useRightRailPanel } from "@/context/RightRailContext";
import { useResizablePanel } from "@/hooks/useResizablePanel";
import { useSlowResponseWarning } from "@/hooks/useSlowResponseWarning";
import { checkOllamaConnection } from "@/utils/ai.utils";
@@ -63,6 +64,7 @@ export const GenerateCoverLetterSection = ({
const [letter, setLetter] = useState("");
const [savedTitle, setSavedTitle] = useState<string | null>(null);
const [isLoading, setIsLoading] = useState(false);
+ const { claim, release } = useRightRailPanel("cover-letter");
const abortRef = useRef<AbortController | null>(null);
const startedRef = useRef(false);
const { scrollAnchorRef, handleSheetScroll, resetScroll } =
@@ -199,6 +201,8 @@ export const GenerateCoverLetterSection = ({
const onOpenChange = (openState: boolean) => {
triggerChange(openState);
+ if (openState) claim();
+ else release();
if (!openState) {
if (isLoading) stop();
setLetter("");
diff --git a/src/components/profile/AiJobMatchSection.tsx b/src/components/profile/AiJobMatchSection.tsx
index e7896c1..85dc1da 100644
--- a/src/components/profile/AiJobMatchSection.tsx
+++ b/src/components/profile/AiJobMatchSection.tsx
@@ -12,6 +12,7 @@ import {
} from "../ui/sheet";
import { useCallback, useEffect, useRef, useState } from "react";
import { useSheetAutoScroll } from "@/hooks/useSheetAutoScroll";
+import { useRightRailPanel } from "@/context/RightRailContext";
import { useResizablePanel } from "@/hooks/useResizablePanel";
import { Resume } from "@/models/profile.model";
import { toastSuccess, toastError } from "@/lib/toast";
@@ -57,6 +58,7 @@ export const AiJobMatchSection = ({
const [isLoadingSettings, setIsLoadingSettings] = useState(true);
const [result, setResult] = useState<JobMatchResult | undefined>();
const [isLoading, setIsLoading] = useState(false);
+ const { claim, release } = useRightRailPanel("job-match");
const resumesRef = useRef<Resume[]>([]);
const abortRef = useRef<AbortController | null>(null);
const { scrollAnchorRef, handleSheetScroll, resetScroll } = useSheetAutoScroll(isLoading, result);
@@ -185,6 +187,8 @@ export const AiJobMatchSection = ({
const onOpenChange = async (openState: boolean) => {
triggerChange(openState);
+ if (openState) claim();
+ else release();
if (!openState && isLoading) {
stop();
}
diff --git a/src/components/profile/AiResumeReviewSection.tsx b/src/components/profile/AiResumeReviewSection.tsx
index 7599e22..7ea4549 100644
--- a/src/components/profile/AiResumeReviewSection.tsx
+++ b/src/components/profile/AiResumeReviewSection.tsx
@@ -13,6 +13,7 @@ import {
import Loading from "../Loading";
import { useState, useEffect, useCallback, useRef } from "react";
import { useSheetAutoScroll } from "@/hooks/useSheetAutoScroll";
+import { useRightRailPanel } from "@/context/RightRailContext";
import { useResizablePanel } from "@/hooks/useResizablePanel";
import { APP_CONSTANTS } from "@/lib/constants";
import { toastSuccess, toastError } from "@/lib/toast";
@@ -44,6 +45,7 @@ const AiResumeReviewSection = ({ resume, onReviewSaved }: AiSectionProps) => {
const [connectionError, setConnectionError] = useState<string>("");
const [selectedModel, setSelectedModel] = useState<AiModel>(defaultModel);
const [isLoadingSettings, setIsLoadingSettings] = useState(false);
+ const { claim, release } = useRightRailPanel("resume-review");
const checkConnectionStatus = useCallback(async (provider: AiProvider) => {
setOllamaConnected(null);
@@ -162,6 +164,8 @@ const AiResumeReviewSection = ({ resume, onReviewSaved }: AiSectionProps) => {
const triggerSheetChange = (openState: boolean) => {
setAiSectionOpen(openState);
+ if (openState) claim();
+ else release();
if (!openState && isLoading) {
stop();
}
diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx
new file mode 100644
index 0000000..f99164e
--- /dev/null
+++ b/src/components/ui/alert.tsx
@@ -0,0 +1,66 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const alertVariants = cva(
+ "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
+ {
+ variants: {
+ variant: {
+ default: "bg-card text-card-foreground",
+ destructive:
+ "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+function Alert({
+ className,
+ variant,
+ ...props
+}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
+ return (
+ <div
+ data-slot="alert"
+ role="alert"
+ className={cn(alertVariants({ variant }), className)}
+ {...props}
+ />
+ )
+}
+
+function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="alert-title"
+ className={cn(
+ "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function AlertDescription({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="alert-description"
+ className={cn(
+ "col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export { Alert, AlertTitle, AlertDescription }
diff --git a/src/components/ui/hover-card.tsx b/src/components/ui/hover-card.tsx
new file mode 100644
index 0000000..9d6a7b7
--- /dev/null
+++ b/src/components/ui/hover-card.tsx
@@ -0,0 +1,44 @@
+"use client"
+
+import * as React from "react"
+import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
+
+import { cn } from "@/lib/utils"
+
+function HoverCard({
+ ...props
+}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
+ return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
+}
+
+function HoverCardTrigger({
+ ...props
+}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
+ return (
+ <HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
+ )
+}
+
+function HoverCardContent({
+ className,
+ align = "center",
+ sideOffset = 4,
+ ...props
+}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
+ return (
+ <HoverCardPrimitive.Portal data-slot="hover-card-portal">
+ <HoverCardPrimitive.Content
+ data-slot="hover-card-content"
+ align={align}
+ sideOffset={sideOffset}
+ className={cn(
+ "z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
+ className
+ )}
+ {...props}
+ />
+ </HoverCardPrimitive.Portal>
+ )
+}
+
+export { HoverCard, HoverCardTrigger, HoverCardContent }
diff --git a/src/components/ui/input-group.tsx b/src/components/ui/input-group.tsx
new file mode 100644
index 0000000..a7652d9
--- /dev/null
+++ b/src/components/ui/input-group.tsx
@@ -0,0 +1,170 @@
+"use client"
+
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+import { Button } from "@/components/ui/button"
+import { Input } from "@/components/ui/input"
+import { Textarea } from "@/components/ui/textarea"
+
+function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="input-group"
+ role="group"
+ className={cn(
+ "group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30",
+ "h-9 min-w-0 has-[>textarea]:h-auto",
+
+ // Variants based on alignment.
+ "has-[>[data-align=inline-start]]:[&>input]:pl-2",
+ "has-[>[data-align=inline-end]]:[&>input]:pr-2",
+ "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
+
+ // Focus state.
+ "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",
+
+ // Error state.
+ "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
+
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+const inputGroupAddonVariants = cva(
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
+ {
+ variants: {
+ align: {
+ "inline-start":
+ "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
+ "inline-end":
+ "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
+ "block-start":
+ "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
+ "block-end":
+ "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
+ },
+ },
+ defaultVariants: {
+ align: "inline-start",
+ },
+ }
+)
+
+function InputGroupAddon({
+ className,
+ align = "inline-start",
+ ...props
+}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
+ return (
+ <div
+ role="group"
+ data-slot="input-group-addon"
+ data-align={align}
+ className={cn(inputGroupAddonVariants({ align }), className)}
+ onClick={(e) => {
+ if ((e.target as HTMLElement).closest("button")) {
+ return
+ }
+ e.currentTarget.parentElement?.querySelector("input")?.focus()
+ }}
+ {...props}
+ />
+ )
+}
+
+const inputGroupButtonVariants = cva(
+ "flex items-center gap-2 text-sm shadow-none",
+ {
+ variants: {
+ size: {
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
+ sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
+ "icon-xs":
+ "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
+ },
+ },
+ defaultVariants: {
+ size: "xs",
+ },
+ }
+)
+
+function InputGroupButton({
+ className,
+ type = "button",
+ variant = "ghost",
+ size = "xs",
+ ...props
+}: Omit<React.ComponentProps<typeof Button>, "size"> &
+ VariantProps<typeof inputGroupButtonVariants>) {
+ return (
+ <Button
+ type={type}
+ data-size={size}
+ variant={variant}
+ className={cn(inputGroupButtonVariants({ size }), className)}
+ {...props}
+ />
+ )
+}
+
+function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
+ return (
+ <span
+ className={cn(
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function InputGroupInput({
+ className,
+ ...props
+}: React.ComponentProps<"input">) {
+ return (
+ <Input
+ data-slot="input-group-control"
+ className={cn(
+ "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function InputGroupTextarea({
+ className,
+ ...props
+}: React.ComponentProps<"textarea">) {
+ return (
+ <Textarea
+ data-slot="input-group-control"
+ className={cn(
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export {
+ InputGroup,
+ InputGroupAddon,
+ InputGroupButton,
+ InputGroupText,
+ InputGroupInput,
+ InputGroupTextarea,
+}
diff --git a/src/components/ui/sheet.tsx b/src/components/ui/sheet.tsx
index 6f72015..77d251a 100644
--- a/src/components/ui/sheet.tsx
+++ b/src/components/ui/sheet.tsx
@@ -51,14 +51,18 @@ const sheetVariants = cva(
interface SheetContentProps
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
- VariantProps<typeof sheetVariants> {}
+ VariantProps<typeof sheetVariants> {
+ /** Render the dimming scrim. Defaults true so every existing sheet is
+ * unchanged; the docked, non-modal agent chat panel passes false. */
+ overlay?: boolean;
+}
const SheetContent = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Content>,
SheetContentProps
->(({ side = "right", className, children, ...props }, ref) => (
+>(({ side = "right", className, children, overlay = true, ...props }, ref) => (
<SheetPortal>
- <SheetOverlay />
+ {overlay && <SheetOverlay />}
<SheetPrimitive.Content
ref={ref}
className={cn(sheetVariants({ side }), className)}
diff --git a/src/components/ui/spinner.tsx b/src/components/ui/spinner.tsx
new file mode 100644
index 0000000..a70e713
--- /dev/null
+++ b/src/components/ui/spinner.tsx
@@ -0,0 +1,16 @@
+import { Loader2Icon } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+ <Loader2Icon
+ role="status"
+ aria-label="Loading"
+ className={cn("size-4 animate-spin", className)}
+ {...props}
+ />
+ )
+}
+
+export { Spinner }
diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx
new file mode 100644
index 0000000..e67d8fe
--- /dev/null
+++ b/src/components/ui/textarea.tsx
@@ -0,0 +1,18 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
+ return (
+ <textarea
+ data-slot="textarea"
+ className={cn(
+ "flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export { Textarea }
diff --git a/src/context/RightRailContext.tsx b/src/context/RightRailContext.tsx
new file mode 100644
index 0000000..90b88f6
--- /dev/null
+++ b/src/context/RightRailContext.tsx
@@ -0,0 +1,55 @@
+"use client";
+
+import { createContext, useCallback, useContext, useMemo, useState } from "react";
+
+// There is one right rail. Opening any panel closes whichever holds it, so
+// the stacking, scrim and pointer-events collisions between the chat panel
+// and the three modal AI sheets never arise.
+type RightRail = {
+ holder: string | null;
+ requestOpen: (id: string) => void;
+ close: (id: string) => void;
+};
+
+const RightRailContext = createContext<RightRail | null>(null);
+
+export function RightRailProvider({ children }: { children: React.ReactNode }) {
+ const [holder, setHolder] = useState<string | null>(null);
+
+ // Unconditional in v1: no busy state, no refusal, no veto. All three
+ // collisions this exists for are collisions of presence.
+ const requestOpen = useCallback((id: string) => setHolder(id), []);
+
+ const close = useCallback((id: string) => {
+ setHolder((current) => (current === id ? null : current));
+ }, []);
+
+ const value = useMemo(
+ () => ({ holder, requestOpen, close }),
+ [holder, requestOpen, close],
+ );
+
+ return (
+ <RightRailContext.Provider value={value}>
+ {children}
+ </RightRailContext.Provider>
+ );
+}
+
+export function useRightRail(): RightRail {
+ const ctx = useContext(RightRailContext);
+ if (!ctx) {
+ throw new Error("useRightRail must be used within a RightRailProvider");
+ }
+ return ctx;
+}
+
+// Convenience for a panel that only cares about its own turn on the rail.
+export function useRightRailPanel(id: string) {
+ const { holder, requestOpen, close } = useRightRail();
+ return {
+ isHolder: holder === id,
+ claim: useCallback(() => requestOpen(id), [requestOpen, id]),
+ release: useCallback(() => close(id), [close, id]),
+ };
+}