Skip to content

Commit f613172

Browse files
committed
Fix mos lookup, add chat ui, add env variable to GH workflow
1 parent 8b688f6 commit f613172

31 files changed

+5499
-805
lines changed

package-lock.json

Lines changed: 1774 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
"dependencies": {
2222
"@ai-sdk/azure": "^1.0.7",
2323
"@ai-sdk/google": "^1.2.19",
24+
"@ai-sdk/openai": "^1.3.22",
2425
"@ai-sdk/react": "^1.2.12",
26+
"@assistant-ui/react": "^0.10.24",
27+
"@assistant-ui/react-ai-sdk": "^0.10.14",
28+
"@assistant-ui/react-markdown": "^0.10.5",
2529
"@googlemaps/react-wrapper": "^1.1.35",
2630
"@googlemaps/typescript-guards": "^2.0.1",
2731
"@neondatabase/serverless": "^1.0.1",
@@ -31,6 +35,9 @@
3135
"@prisma/client": "^6.9.0",
3236
"@radix-ui/react-dialog": "^1.1.4",
3337
"@radix-ui/react-icons": "^1.3.0",
38+
"@radix-ui/react-separator": "^1.1.7",
39+
"@radix-ui/react-slot": "^1.2.3",
40+
"@radix-ui/react-tooltip": "^1.2.7",
3441
"@radix-ui/themes": "^1.1.0",
3542
"@types/express": "^4.17.17",
3643
"@vercel/analytics": "^1.4.1",
@@ -47,7 +54,7 @@
4754
"fast-equals": "3.0.3",
4855
"framer-motion": "^12.18.1",
4956
"gray-matter": "^4.0.3",
50-
"lucide-react": "^0.378.0",
57+
"lucide-react": "^0.523.0",
5158
"mailchimp-api-v3": "^1.15.0",
5259
"marked": "^4.0.18",
5360
"motion": "^11.13.3",
@@ -63,6 +70,7 @@
6370
"react-dom": "^18.3.1",
6471
"react-hook-form": "^7.45.0",
6572
"react-simple-typewriter": "^3.0.1",
73+
"remark-gfm": "^4.0.1",
6674
"swiper": "^8.3.1",
6775
"tailwind-merge": "^2.3.0",
6876
"tailwindcss-animate": "^1.0.7",
File renamed without changes.

src/app/layout.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export const metadata = {
2+
title: "Next.js",
3+
description: "Generated by Next.js",
4+
};
5+
6+
export const RootLayout = ({ children }: { children: React.ReactNode }) => {
7+
return (
8+
<html lang="en">
9+
<body>{children}</body>
10+
</html>
11+
);
12+
};
13+
14+
export default RootLayout;

src/app/vetsai/layout.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import "@assets/css/tailwind.css";
2+
import "@assets/css/vetsai.css";
3+
4+
export const metadata = {
5+
title: "Next.js",
6+
description: "Generated by Next.js",
7+
};
8+
9+
export const RootLayout = ({ children }: { children: React.ReactNode }) => {
10+
return (
11+
<html lang="en">
12+
<body>{children}</body>
13+
</html>
14+
);
15+
};
16+
17+
export default RootLayout;

src/app/vetsai/page.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"use client";
2+
3+
import { AssistantRuntimeProvider } from "@assistant-ui/react";
4+
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
5+
import { Thread } from "@/components/vetsai/assistant-ui/thread";
6+
import { SidebarInset, SidebarProvider, SidebarTrigger } from "@/components/vetsai/ui/sidebar";
7+
import { AppSidebar } from "@/components/vetsai/app-sidebar";
8+
import { Separator } from "@/components/vetsai/ui/separator";
9+
import {
10+
Breadcrumb,
11+
BreadcrumbItem,
12+
BreadcrumbLink,
13+
BreadcrumbList,
14+
BreadcrumbPage,
15+
BreadcrumbSeparator,
16+
} from "@/components/vetsai/ui/breadcrumb";
17+
18+
export const Assistant = () => {
19+
const runtime = useChatRuntime({
20+
api: "/api/chat",
21+
});
22+
23+
return (
24+
<AssistantRuntimeProvider runtime={runtime}>
25+
<SidebarProvider>
26+
<AppSidebar />
27+
<SidebarInset>
28+
<header className="tw-flex tw-h-16 tw-shrink-0 tw-items-center tw-gap-2 tw-border-b tw-px-4">
29+
<SidebarTrigger />
30+
<Separator orientation="vertical" className="tw-mr-2 tw-h-4" />
31+
<Breadcrumb>
32+
<BreadcrumbList>
33+
<BreadcrumbItem className="tw-hidden md:tw-block">
34+
<BreadcrumbLink href="#">
35+
Build Your Own ChatGPT UX
36+
</BreadcrumbLink>
37+
</BreadcrumbItem>
38+
<BreadcrumbSeparator className="tw-hidden md:tw-block" />
39+
<BreadcrumbItem>
40+
<BreadcrumbPage>Starter Template</BreadcrumbPage>
41+
</BreadcrumbItem>
42+
</BreadcrumbList>
43+
</Breadcrumb>
44+
</header>
45+
<Thread />
46+
</SidebarInset>
47+
</SidebarProvider>
48+
</AssistantRuntimeProvider>
49+
);
50+
};
51+
52+
export default Assistant;

src/assets/css/vetsai.css

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
@custom-variant dark (&:is(.dark *));
6+
7+
@theme inline {
8+
--color-background: var(--background);
9+
--color-foreground: var(--foreground);
10+
--font-sans: var(--font-geist-sans);
11+
--font-mono: var(--font-geist-mono);
12+
--color-sidebar-ring: var(--sidebar-ring);
13+
--color-sidebar-border: var(--sidebar-border);
14+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
15+
--color-sidebar-accent: var(--sidebar-accent);
16+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
17+
--color-sidebar-primary: var(--sidebar-primary);
18+
--color-sidebar-foreground: var(--sidebar-foreground);
19+
--color-sidebar: var(--sidebar);
20+
--color-chart-5: var(--chart-5);
21+
--color-chart-4: var(--chart-4);
22+
--color-chart-3: var(--chart-3);
23+
--color-chart-2: var(--chart-2);
24+
--color-chart-1: var(--chart-1);
25+
--color-ring: var(--ring);
26+
--color-input: var(--input);
27+
--color-border: var(--border);
28+
--color-destructive: var(--destructive);
29+
--color-accent-foreground: var(--accent-foreground);
30+
--color-accent: var(--accent);
31+
--color-muted-foreground: var(--muted-foreground);
32+
--color-muted: var(--muted);
33+
--color-secondary-foreground: var(--secondary-foreground);
34+
--color-secondary: var(--secondary);
35+
--color-primary-foreground: var(--primary-foreground);
36+
--color-primary: var(--primary);
37+
--color-popover-foreground: var(--popover-foreground);
38+
--color-popover: var(--popover);
39+
--color-card-foreground: var(--card-foreground);
40+
--color-card: var(--card);
41+
--radius-sm: calc(var(--radius) - 4px);
42+
--radius-md: calc(var(--radius) - 2px);
43+
--radius-lg: var(--radius);
44+
--radius-xl: calc(var(--radius) + 4px);
45+
}
46+
47+
:root {
48+
--radius: 0.625rem;
49+
--background: oklch(1 0 0);
50+
--foreground: oklch(0.141 0.005 285.823);
51+
--card: oklch(1 0 0);
52+
--card-foreground: oklch(0.141 0.005 285.823);
53+
--popover: oklch(1 0 0);
54+
--popover-foreground: oklch(0.141 0.005 285.823);
55+
--primary: oklch(0.21 0.006 285.885);
56+
--primary-foreground: oklch(0.985 0 0);
57+
--secondary: oklch(0.967 0.001 286.375);
58+
--secondary-foreground: oklch(0.21 0.006 285.885);
59+
--muted: oklch(0.967 0.001 286.375);
60+
--muted-foreground: oklch(0.552 0.016 285.938);
61+
--accent: oklch(0.967 0.001 286.375);
62+
--accent-foreground: oklch(0.21 0.006 285.885);
63+
--destructive: oklch(0.577 0.245 27.325);
64+
--border: oklch(0.92 0.004 286.32);
65+
--input: oklch(0.92 0.004 286.32);
66+
--ring: oklch(0.705 0.015 286.067);
67+
--chart-1: oklch(0.646 0.222 41.116);
68+
--chart-2: oklch(0.6 0.118 184.704);
69+
--chart-3: oklch(0.398 0.07 227.392);
70+
--chart-4: oklch(0.828 0.189 84.429);
71+
--chart-5: oklch(0.769 0.188 70.08);
72+
--sidebar: oklch(0.985 0 0);
73+
--sidebar-foreground: oklch(0.141 0.005 285.823);
74+
--sidebar-primary: oklch(0.21 0.006 285.885);
75+
--sidebar-primary-foreground: oklch(0.985 0 0);
76+
--sidebar-accent: oklch(0.967 0.001 286.375);
77+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
78+
--sidebar-border: oklch(0.92 0.004 286.32);
79+
--sidebar-ring: oklch(0.705 0.015 286.067);
80+
}
81+
82+
.dark {
83+
--background: oklch(0.141 0.005 285.823);
84+
--foreground: oklch(0.985 0 0);
85+
--card: oklch(0.21 0.006 285.885);
86+
--card-foreground: oklch(0.985 0 0);
87+
--popover: oklch(0.21 0.006 285.885);
88+
--popover-foreground: oklch(0.985 0 0);
89+
--primary: oklch(0.92 0.004 286.32);
90+
--primary-foreground: oklch(0.21 0.006 285.885);
91+
--secondary: oklch(0.274 0.006 286.033);
92+
--secondary-foreground: oklch(0.985 0 0);
93+
--muted: oklch(0.274 0.006 286.033);
94+
--muted-foreground: oklch(0.705 0.015 286.067);
95+
--accent: oklch(0.274 0.006 286.033);
96+
--accent-foreground: oklch(0.985 0 0);
97+
--destructive: oklch(0.704 0.191 22.216);
98+
--border: oklch(1 0 0 / 10%);
99+
--input: oklch(1 0 0 / 15%);
100+
--ring: oklch(0.552 0.016 285.938);
101+
--chart-1: oklch(0.488 0.243 264.376);
102+
--chart-2: oklch(0.696 0.17 162.48);
103+
--chart-3: oklch(0.769 0.188 70.08);
104+
--chart-4: oklch(0.627 0.265 303.9);
105+
--chart-5: oklch(0.645 0.246 16.439);
106+
--sidebar: oklch(0.21 0.006 285.885);
107+
--sidebar-foreground: oklch(0.985 0 0);
108+
--sidebar-primary: oklch(0.488 0.243 264.376);
109+
--sidebar-primary-foreground: oklch(0.985 0 0);
110+
--sidebar-accent: oklch(0.274 0.006 286.033);
111+
--sidebar-accent-foreground: oklch(0.985 0 0);
112+
--sidebar-border: oklch(1 0 0 / 10%);
113+
--sidebar-ring: oklch(0.552 0.016 285.938);
114+
}
115+
116+
@layer base {
117+
* {
118+
@apply tw-border-[var(--border)] tw-outline-[var(--ring)];
119+
}
120+
body {
121+
@apply tw-bg-[var(--background)] tw-text-[var(--foreground)];
122+
}
123+
}

src/components/ui/swiper/index.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { forwardRef } from "react";
22
import cn from "clsx";
3-
import SwiperCore, { Navigation, Pagination, Autoplay, A11y } from "swiper";
3+
import { Navigation, Pagination, Autoplay, A11y } from "swiper";
44
// eslint-disable-next-line import/no-unresolved
55
import { Swiper, SwiperSlide } from "swiper/react";
6+
import type { Swiper as SwiperInstance } from "swiper/types";
67

78
type TOptions = {
89
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -37,9 +38,9 @@ type TOptions = {
3738
[x: string]: number | string;
3839
};
3940
};
40-
onSlideChange?: (swiper: SwiperCore) => void;
41-
onSlideChangeTransitionStart?: (swiper: SwiperCore) => void;
42-
onSlideChangeTransitionEnd?: (swiper: SwiperCore) => void;
41+
onSlideChange?: (swiper: SwiperInstance) => void;
42+
onSlideChangeTransitionStart?: (swiper: SwiperInstance) => void;
43+
onSlideChangeTransitionEnd?: (swiper: SwiperInstance) => void;
4344
};
4445

4546
type TProps = {
@@ -54,9 +55,9 @@ type TProps = {
5455
children: React.ReactNode;
5556
className?: string;
5657
navClass?: string;
57-
onSlideChange?: (swiper: SwiperCore) => void;
58-
onSlideChangeTransitionStart?: (swiper: SwiperCore) => void;
59-
onSlideChangeTransitionEnd?: (swiper: SwiperCore) => void;
58+
onSlideChange?: (swiper: SwiperInstance) => void;
59+
onSlideChangeTransitionStart?: (swiper: SwiperInstance) => void;
60+
onSlideChangeTransitionEnd?: (swiper: SwiperInstance) => void;
6061
};
6162

6263
const SwiperSlider = forwardRef<HTMLDivElement, TProps>(
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import * as React from "react";
2+
import { Github, MessagesSquare } from "lucide-react";
3+
import Link from "next/link";
4+
import {
5+
Sidebar,
6+
SidebarContent,
7+
SidebarFooter,
8+
SidebarHeader,
9+
SidebarMenu,
10+
SidebarMenuButton,
11+
SidebarMenuItem,
12+
SidebarRail,
13+
} from "@/components/vetsai/ui/sidebar";
14+
import { ThreadList } from "./assistant-ui/thread-list";
15+
16+
export const AppSidebar = ({ ...props }: React.ComponentProps<typeof Sidebar>) => {
17+
return (
18+
<Sidebar {...props}>
19+
<SidebarHeader>
20+
<SidebarMenu>
21+
<SidebarMenuItem>
22+
<SidebarMenuButton size="lg" asChild>
23+
<Link href="https://assistant-ui.com" target="_blank">
24+
<div className="tw-bg-sidebar-primary tw-text-sidebar-primary-foreground tw-flex tw-aspect-square tw-size-8 tw-items-center tw-justify-center tw-rounded-lg">
25+
<MessagesSquare className="size-4" />
26+
</div>
27+
<div className="tw-flex tw-flex-col tw-gap-0.5 tw-leading-none">
28+
<span className="tw-font-semibold">assistant-ui</span>
29+
</div>
30+
</Link>
31+
</SidebarMenuButton>
32+
</SidebarMenuItem>
33+
</SidebarMenu>
34+
</SidebarHeader>
35+
<SidebarContent>
36+
<ThreadList />
37+
</SidebarContent>
38+
39+
<SidebarRail />
40+
<SidebarFooter>
41+
<SidebarMenu>
42+
<SidebarMenuItem>
43+
<SidebarMenuButton size="lg" asChild>
44+
<Link
45+
href="https://github.com/assistant-ui/assistant-ui"
46+
target="_blank"
47+
>
48+
<div className="tw-bg-sidebar-primary text-sidebar-primary-foreground tw-flex tw-aspect-square tw-size-8 tw-items-center tw-justify-center tw-rounded-lg">
49+
<Github className="size-4" />
50+
</div>
51+
<div className="tw-flex tw-flex-col tw-gap-0.5 tw-leading-none">
52+
<span className="tw-font-semibold">GitHub</span>
53+
<span className="">View Source</span>
54+
</div>
55+
</Link>
56+
</SidebarMenuButton>
57+
</SidebarMenuItem>
58+
</SidebarMenu>
59+
</SidebarFooter>
60+
</Sidebar>
61+
);
62+
};

0 commit comments

Comments
 (0)