Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/docs/app/global.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "tailwindcss";
@import "shadcn/tailwind.css";
@import "./styles/geistdocs.css";

@source "../**/*.{ts,tsx,mdx}";
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"style": "radix-vega",
"rsc": true,
"tsx": true,
"tailwind": {
Expand Down
3 changes: 1 addition & 2 deletions apps/docs/components/custom/elements-installer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { readFile } from "node:fs/promises";
// oxlint-disable-next-line eslint-plugin-import(no-nodejs-modules)
import { join } from "node:path";

import { codeToHtml } from "shiki";

import { CodeBlock } from "@/components/geistdocs/code-block";
Expand All @@ -30,7 +29,7 @@ const loadSourceCode = async (componentPath: string): Promise<string> => {
"src",
`${componentPath}.tsx`
),
"utf8"
"utf-8"
);
return code
.replaceAll("@ai-studio/shadcn-ui/", "@/")
Expand Down
15 changes: 7 additions & 8 deletions apps/docs/components/custom/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Server component - Node.js modules are valid here
// oxlint-disable-next-line eslint-plugin-import(no-nodejs-modules)
import { readFile } from "node:fs/promises";
// oxlint-disable-next-line eslint-plugin-import(no-nodejs-modules)
import { join } from "node:path";

import { CodeBlock } from "@repo/elements/src/code-block";
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@repo/shadcn-ui/components/ui/resizable";
import { cn } from "@repo/shadcn-ui/lib/utils";
// Server component - Node.js modules are valid here
// oxlint-disable-next-line eslint-plugin-import(no-nodejs-modules)
import { readFile } from "node:fs/promises";
// oxlint-disable-next-line eslint-plugin-import(no-nodejs-modules)
import { join } from "node:path";

import {
CodeBlockTab,
Expand All @@ -35,7 +34,7 @@ export const Preview = async ({ path, className }: ComponentPreviewProps) => {
"src",
`${path}.tsx`
),
"utf8"
"utf-8"
);

const Component = await import(`@repo/examples/src/${path}.tsx`).then(
Expand All @@ -59,7 +58,7 @@ export const Preview = async ({ path, className }: ComponentPreviewProps) => {
<CodeBlockTabsTrigger value="code">Code</CodeBlockTabsTrigger>
</CodeBlockTabsList>
<CodeBlockTab className="not-prose p-0" value="preview">
<ResizablePanelGroup direction="horizontal" id={`preview-${path}`}>
<ResizablePanelGroup orientation="horizontal" id={`preview-${path}`}>
<ResizablePanel defaultSize={100}>
<div className={cn("h-[600px] overflow-auto p-4", className)}>
<Component />
Expand Down
5 changes: 2 additions & 3 deletions apps/docs/components/custom/source-code.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { cn } from "@repo/shadcn-ui/lib/utils";
// Server component - Node.js modules are valid here
// oxlint-disable-next-line eslint-plugin-import(no-nodejs-modules)
import { readFile } from "node:fs/promises";
// oxlint-disable-next-line eslint-plugin-import(no-nodejs-modules)
import { join } from "node:path";

import { cn } from "@repo/shadcn-ui/lib/utils";
import { codeToHtml } from "shiki";

import { CodeBlock } from "../geistdocs/code-block";
Expand All @@ -25,7 +24,7 @@ export const SourceCode = async ({ path, className }: SourceCodeProps) => {
"src",
`${path}.tsx`
),
"utf8"
"utf-8"
);

const parsedCode = code
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/content/components/(chatbot)/confirmation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ A styled description element for displaying a title or label within the confirma
<TypeTable
type={{
"...props": {
description: "Any other props are spread to the underlying AlertDescription component.",
description:
"Any other props are spread to the underlying AlertDescription component.",
type: "React.ComponentProps<typeof AlertDescription>",
},
}}
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/content/components/(chatbot)/message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ export default ActionsDemo;
<TypeTable
type={{
"...props": {
description: "Any other props are spread to the underlying ButtonGroup component.",
description:
"Any other props are spread to the underlying ButtonGroup component.",
type: "React.ComponentProps<typeof ButtonGroup>",
},
}}
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/content/components/(chatbot)/model-selector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ The `ModelSelector` component provides a searchable command palette interface fo

<TypeTable
type={{
checked: {
description:
"Whether this item is the currently selected model. Shows the built-in check indicator.",
type: "boolean",
optional: true,
},
"...props": {
description:
"Any other props are spread to the underlying CommandItem component.",
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"remark": "^15.0.1",
"remark-gfm": "^4.0.1",
"remark-mdx": "^3.1.1",
"shadcn": "^3.8.2",
"shiki": "3.22.0",
"sonner": "^2.0.7",
"streamdown": "^2.1.0",
Expand All @@ -60,8 +59,9 @@
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"postcss": "^8.5.6",
"shadcn": "^3.8.2",
"tailwindcss": "^4.1.17",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.3"
}
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"test:coverage": "turbo run test:coverage",
"check": "ultracite check",
"fix": "ultracite fix",
"bump-deps": "npx npm-check-updates --deep -u -x recharts,react-resizable-panels && pnpm install",
"bump-ui": "npx shadcn@latest add --all --overwrite -c packages/shadcn-ui && npx shadcn@latest migrate radix -c packages/shadcn-ui",
"bump-deps": "npx npm-check-updates --deep -u && pnpm install",
"bump-ui": "npx shadcn@latest add --all --overwrite -c packages/shadcn-ui",
"changeset": "changeset",
"generate-skills": "pnpm --filter @repo/scripts generate-skills"
},
Expand All @@ -21,7 +21,7 @@
"oxlint": "^1.43.0",
"turbo": "2.8.14",
"typescript": "5.9.3",
"ultracite": "7.1.4",
"ultracite": "7.4.4",
"vitest": "^4.0.17"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions packages/elements/__tests__/jsx-preview.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { render, screen } from "@testing-library/react";

import type { JSXPreviewProps } from "../src/jsx-preview";

import {
JSXPreview,
JSXPreviewContent,
Expand Down
23 changes: 23 additions & 0 deletions packages/elements/__tests__/model-selector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,29 @@ describe("modelSelectorItem", () => {
"true"
);
});

it("marks the selected model as checked", () => {
render(
<ModelSelector open={true}>
<ModelSelectorContent aria-describedby="test-description">
<ModelSelectorList>
<ModelSelectorItem checked value="gpt-4">
GPT-4
</ModelSelectorItem>
<ModelSelectorItem value="gpt-3.5">GPT-3.5</ModelSelectorItem>
</ModelSelectorList>
</ModelSelectorContent>
</ModelSelector>
);
const checkedItem = screen.getByText("GPT-4").closest('[role="option"]');
expect(checkedItem).toHaveAttribute("aria-checked", "true");
expect(checkedItem).toHaveAttribute("data-checked", "true");
const uncheckedItem = screen
.getByText("GPT-3.5")
.closest('[role="option"]');
expect(uncheckedItem).not.toHaveAttribute("aria-checked");
expect(uncheckedItem).not.toHaveAttribute("data-checked");
});
});

describe("modelSelectorShortcut", () => {
Expand Down
1 change: 1 addition & 0 deletions packages/elements/__tests__/prompt-input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { userEvent } from "@testing-library/user-event";
import React from "react";

import type { AttachmentData } from "../src/attachments";

import {
Attachment,
AttachmentInfo,
Expand Down
3 changes: 2 additions & 1 deletion packages/elements/__tests__/transcription.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Experimental_TranscriptionResult as TranscriptionResult } from "ai";

import { render, screen } from "@testing-library/react";
import { userEvent } from "@testing-library/user-event";
import type { Experimental_TranscriptionResult as TranscriptionResult } from "ai";

import { Transcription, TranscriptionSegment } from "../src/transcription";

Expand Down
5 changes: 3 additions & 2 deletions packages/elements/src/agent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use client";

import type { Tool } from "ai";
import type { ComponentProps } from "react";

import {
Accordion,
AccordionContent,
Expand All @@ -8,9 +11,7 @@ import {
} from "@repo/shadcn-ui/components/ui/accordion";
import { Badge } from "@repo/shadcn-ui/components/ui/badge";
import { cn } from "@repo/shadcn-ui/lib/utils";
import type { Tool } from "ai";
import { BotIcon } from "lucide-react";
import type { ComponentProps } from "react";
import { memo } from "react";

import { CodeBlock } from "./code-block";
Expand Down
5 changes: 3 additions & 2 deletions packages/elements/src/artifact.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use client";

import type { LucideIcon } from "lucide-react";
import type { ComponentProps, HTMLAttributes } from "react";

import { Button } from "@repo/shadcn-ui/components/ui/button";
import {
Tooltip,
Expand All @@ -8,9 +11,7 @@ import {
TooltipTrigger,
} from "@repo/shadcn-ui/components/ui/tooltip";
import { cn } from "@repo/shadcn-ui/lib/utils";
import type { LucideIcon } from "lucide-react";
import { XIcon } from "lucide-react";
import type { ComponentProps, HTMLAttributes } from "react";

export type ArtifactProps = HTMLAttributes<HTMLDivElement>;

Expand Down
5 changes: 3 additions & 2 deletions packages/elements/src/attachments.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"use client";

import type { FileUIPart, SourceDocumentUIPart } from "ai";
import type { ComponentProps, HTMLAttributes, ReactNode } from "react";

import { Button } from "@repo/shadcn-ui/components/ui/button";
import {
HoverCard,
HoverCardContent,
HoverCardTrigger,
} from "@repo/shadcn-ui/components/ui/hover-card";
import { cn } from "@repo/shadcn-ui/lib/utils";
import type { FileUIPart, SourceDocumentUIPart } from "ai";
import {
FileTextIcon,
GlobeIcon,
Expand All @@ -17,7 +19,6 @@ import {
VideoIcon,
XIcon,
} from "lucide-react";
import type { ComponentProps, HTMLAttributes, ReactNode } from "react";
import { createContext, useCallback, useContext, useMemo } from "react";

// ============================================================================
Expand Down
5 changes: 3 additions & 2 deletions packages/elements/src/audio-player.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"use client";

import type { Experimental_SpeechResult as SpeechResult } from "ai";
import type { ComponentProps, CSSProperties } from "react";

import { Button } from "@repo/shadcn-ui/components/ui/button";
import {
ButtonGroup,
ButtonGroupText,
} from "@repo/shadcn-ui/components/ui/button-group";
import { cn } from "@repo/shadcn-ui/lib/utils";
import type { Experimental_SpeechResult as SpeechResult } from "ai";
import {
MediaControlBar,
MediaController,
Expand All @@ -19,7 +21,6 @@ import {
MediaTimeRange,
MediaVolumeRange,
} from "media-chrome/react";
import type { ComponentProps, CSSProperties } from "react";

export type AudioPlayerProps = Omit<
ComponentProps<typeof MediaController>,
Expand Down
2 changes: 1 addition & 1 deletion packages/elements/src/canvas.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ReactFlowProps } from "@xyflow/react";
import { Background, ReactFlow } from "@xyflow/react";
import type { ReactNode } from "react";

import { Background, ReactFlow } from "@xyflow/react";
import "@xyflow/react/dist/style.css";

type CanvasProps = ReactFlowProps & {
Expand Down
5 changes: 3 additions & 2 deletions packages/elements/src/chain-of-thought.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use client";

import type { LucideIcon } from "lucide-react";
import type { ComponentProps, ReactNode } from "react";

import { useControllableState } from "@radix-ui/react-use-controllable-state";
import { Badge } from "@repo/shadcn-ui/components/ui/badge";
import {
Expand All @@ -8,9 +11,7 @@ import {
CollapsibleTrigger,
} from "@repo/shadcn-ui/components/ui/collapsible";
import { cn } from "@repo/shadcn-ui/lib/utils";
import type { LucideIcon } from "lucide-react";
import { BrainIcon, ChevronDownIcon, DotIcon } from "lucide-react";
import type { ComponentProps, ReactNode } from "react";
import { createContext, memo, useContext, useMemo } from "react";

interface ChainOfThoughtContextValue {
Expand Down
5 changes: 3 additions & 2 deletions packages/elements/src/checkpoint.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use client";

import type { LucideProps } from "lucide-react";
import type { ComponentProps, HTMLAttributes } from "react";

import { Button } from "@repo/shadcn-ui/components/ui/button";
import { Separator } from "@repo/shadcn-ui/components/ui/separator";
import {
Expand All @@ -8,9 +11,7 @@ import {
TooltipTrigger,
} from "@repo/shadcn-ui/components/ui/tooltip";
import { cn } from "@repo/shadcn-ui/lib/utils";
import type { LucideProps } from "lucide-react";
import { BookmarkIcon } from "lucide-react";
import type { ComponentProps, HTMLAttributes } from "react";

export type CheckpointProps = HTMLAttributes<HTMLDivElement>;

Expand Down
15 changes: 8 additions & 7 deletions packages/elements/src/code-block.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
"use client";

import type { ComponentProps, CSSProperties, HTMLAttributes } from "react";
import type {
BundledLanguage,
BundledTheme,
HighlighterGeneric,
ThemedToken,
} from "shiki";

import { Button } from "@repo/shadcn-ui/components/ui/button";
import {
Select,
Expand All @@ -10,7 +18,6 @@ import {
} from "@repo/shadcn-ui/components/ui/select";
import { cn } from "@repo/shadcn-ui/lib/utils";
import { CheckIcon, CopyIcon } from "lucide-react";
import type { ComponentProps, CSSProperties, HTMLAttributes } from "react";
import {
createContext,
memo,
Expand All @@ -21,12 +28,6 @@ import {
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
Expand Down
Loading
Loading