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
25 changes: 25 additions & 0 deletions apps/web/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "base-nova",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"rtl": false,
"aliases": {
"components": "@/components",
"utils": "@iguide/ui/lib/utils",
"ui": "@iguide/ui/components",
"lib": "@iguide/ui/lib",
"hooks": "@/hooks"
},
"menuColor": "default",
"menuAccent": "subtle",
"registries": {}
}
8 changes: 7 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
"dependencies": {
"@assistant-ui/react": "^0.15.22",
"@assistant-ui/react-markdown": "0.14.17",
"@base-ui/react": "^1.8.0",
"@fontsource-variable/geist": "^5.3.0",
"@headlessui/react": "^2.2.10",
"@iguide/dorm": "workspace:*",
"@iguide/ui": "workspace:*",
"@supabase/supabase-js": "^2.117.2",
"class-variance-authority": "^0.7.1",
"cn": "^0.4.0",
"framer-motion": "^13.4.4",
"hono": "^4.13.12",
"lucide-react": "^1.48.0",
Expand All @@ -23,7 +27,9 @@
"react-map-gl": "^8.1.3",
"react-markdown": "^10.1.0",
"react-router-dom": "^7.18.4",
"remark-gfm": "^4.0.1"
"remark-gfm": "^4.0.1",
"shadcn": "^4.21.1",
"tw-animate-css": "^1.4.0"
},
"devDependencies": {
"@cloudflare/vite-plugin": "^2.0.0-beta.sha-238e489d5",
Expand Down
10 changes: 5 additions & 5 deletions apps/web/src/components/housing/AIChat.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ChatMessage } from "@iguide/dorm"
import { Typewriter } from "@iguide/ui"
import { motion, AnimatePresence } from "framer-motion"
import { MessageCircle, X, Send, Sparkles, Loader2 } from "lucide-react"
import React, { useState, useRef, useEffect } from "react"
import { Typewriter } from "@iguide/ui/components/typewriter"
import { AnimatePresence, motion } from "framer-motion"
import { Loader2, MessageCircle, Send, Sparkles, X } from "lucide-react"
import React, { useEffect, useRef, useState } from "react"
import ReactMarkdown from "react-markdown"
import { useNavigate } from "react-router-dom"
import remarkGfm from "remark-gfm"

import { streamChatResponse } from "../../services/ai"
import { Language } from "../../types"
import { isDormMention, findMentionedDorms } from "../../utils/housingUtils"
import { findMentionedDorms, isDormMention } from "../../utils/housingUtils"
import { aiChatTexts } from "./i18n/dormTexts"

interface AIChatProps {
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/components/layout/ConversationSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typewriter } from "@iguide/ui"
import { Typewriter } from "@iguide/ui/components/typewriter"
import * as React from "react"
import { useEffect, useState } from "react"

Expand All @@ -8,13 +8,13 @@ import { localConversationService } from "../../services/localConversationServic
import { ConversationSummary } from "../../types"
import {
BaseSidebar,
SidebarItem,
PinButton,
DeleteButton,
SidebarLoadingSpinner,
SidebarEmptyState,
groupByCategory,
getCategoryOrder,
groupByCategory,
PinButton,
SidebarEmptyState,
SidebarItem,
SidebarLoadingSpinner,
TimeCategoryLabels,
} from "./BaseSidebar"

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/layout/DormSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Dorm } from "@iguide/dorm"
import { Typewriter } from "@iguide/ui"
import { Typewriter } from "@iguide/ui/components/typewriter"
import { AnimatePresence, motion } from "framer-motion"
import { Clock, Heart, Trash2 } from "lucide-react"
import React, { useMemo } from "react"
Expand Down
10 changes: 5 additions & 5 deletions apps/web/src/components/layout/LibrarySidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typewriter } from "@iguide/ui"
import { Typewriter } from "@iguide/ui/components/typewriter"
import React, { useEffect, useState } from "react"
import { useNavigate } from "react-router-dom"

Expand All @@ -7,12 +7,12 @@ import { supabase } from "../../services/supabase"
import { LibraryHistoryItem } from "../../types"
import {
BaseSidebar,
SidebarItem,
PinButton,
DeleteButton,
SidebarEmptyState,
groupByCategory,
getCategoryOrder,
groupByCategory,
PinButton,
SidebarEmptyState,
SidebarItem,
TimeCategoryLabels,
} from "./BaseSidebar"

Expand Down
57 changes: 57 additions & 0 deletions apps/web/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { Button as ButtonPrimitive } from "@base-ui/react/button"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "cn"

const buttonVariants = cva(
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/80",
outline:
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
secondary:
"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
ghost:
"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
destructive:
"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default:
"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
icon: "size-8",
"icon-xs":
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
"icon-sm":
"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
"icon-lg": "size-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
)

function Button({
className,
variant = "default",
size = "default",
...props
}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
return (
<ButtonPrimitive
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
{...props}
/>
)
}

export { Button, buttonVariants }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React Doctor · react-doctor/only-export-components (warning)

This file exports non-components, so Fast Refresh can't safely preserve component state.

Fix → Move non-component exports out of component files so Fast Refresh can preserve component state instead of full-reloading.

Docs

126 changes: 126 additions & 0 deletions apps/web/src/index.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* [ROOT] Global styles and Tailwind CSS directives. */
/* [根组件] 全局样式和 Tailwind CSS 指令。 */
@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "@fontsource-variable/geist";

@custom-variant dark (&:is(.dark *));

/* Workspace UI packages sit outside this app's root, so Tailwind won't find their classes on its own. */
@source "../../../packages/ui/src";
Expand Down Expand Up @@ -330,6 +335,38 @@ html {
--illini-orange: #ff5f05;
--illini-blue-light: #1e3a5f;
--illini-orange-light: #ff7a30;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}

/* Custom Scrollbar Styles - Thin & Fashionable */
Expand Down Expand Up @@ -557,3 +594,92 @@ html {
.modal-scroll-smooth .rc-slider-handle:active {
transform: scale(1.05) !important;
}

@theme inline {
--font-heading: var(--font-sans);
--font-sans: "Geist Variable", sans-serif;
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar);
--color-chart-5: var(--chart-5);
--color-chart-4: var(--chart-4);
--color-chart-3: var(--chart-3);
--color-chart-2: var(--chart-2);
--color-chart-1: var(--chart-1);
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
--color-destructive: var(--destructive);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
--color-muted: var(--muted);
--color-secondary-foreground: var(--secondary-foreground);
--color-secondary: var(--secondary);
--color-primary-foreground: var(--primary-foreground);
--color-primary: var(--primary);
--color-popover-foreground: var(--popover-foreground);
--color-popover: var(--popover);
--color-card-foreground: var(--card-foreground);
--color-card: var(--card);
--color-foreground: var(--foreground);
--color-background: var(--background);
--radius-sm: calc(var(--radius) * 0.6);
--radius-md: calc(var(--radius) * 0.8);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) * 1.4);
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
}

.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}

@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
html {
@apply font-sans;
}
}
1 change: 1 addition & 0 deletions apps/web/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { cn } from "cn"
25 changes: 25 additions & 0 deletions packages/ui/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "base-nova",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"rtl": false,
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components",
"lib": "@/lib",
"hooks": "@/hooks"
},
"menuColor": "default",
"menuAccent": "subtle",
"registries": {}
}
13 changes: 11 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@
"description": "Business-agnostic UI primitives shared by IlliniGuide apps and feature packages.",
"type": "module",
"exports": {
".": "./src/index.ts"
"./globals.css": "./src/styles/globals.css",
"./components/*": "./src/components/*.tsx",
"./lib/*": "./src/lib/*.ts"
},
"dependencies": {
"@base-ui/react": "^1.8.0",
"class-variance-authority": "^0.7.1",
"cn": "^0.4.0",
"framer-motion": "^13.4.4",
"lucide-react": "^1.49.0",
"react-markdown": "^10.1.0",
"remark-gfm": "^4.0.1"
"remark-gfm": "^4.0.1",
"shadcn": "^4.21.1",
"tailwindcss": "^4.3.3",
"tw-animate-css": "^1.4.0"
},
"devDependencies": {
"@types/react": "^19.3.0",
Expand Down
Loading
Loading