mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 07:17:39 +00:00
Merge pull request #46 from shumaiOne/feat/system-colors-sidebar-settings
feat(ui): migrate settings, sidebar, and cards to system colors
This commit is contained in:
@@ -3,11 +3,11 @@ import type { UserInfo } from '@/dtos/team'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/ui/components/ui/dialog'
|
||||
import { Separator } from '@/ui/components/ui/separator'
|
||||
import { formatTimeAgo } from '@/ui/lib/time'
|
||||
|
||||
@@ -72,7 +72,7 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={toggleMobileMenu}
|
||||
className="md:hidden fixed top-4 left-4 z-50 rounded-md bg-white/50 dark:bg-slate-800/50 backdrop-blur-sm text-slate-800 dark:text-slate-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"
|
||||
className="md:hidden fixed top-4 left-4 z-50 rounded-md bg-sidebar/50 backdrop-blur-sm text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"
|
||||
aria-label="Open navigation menu"
|
||||
aria-expanded={isMobileMenuOpen}
|
||||
>
|
||||
@@ -100,9 +100,9 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
||||
<aside
|
||||
className={`fixed inset-y-0 left-0 z-40 flex transition-transform duration-300 ease-in-out ${isMobileMenuOpen ? 'translate-x-0' : '-translate-x-full'} md:translate-x-0`}
|
||||
>
|
||||
<div className="absolute bottom-0 w-full h-[70dvh] bg-linear-to-t from-orange-400/10 to-transparent"></div>
|
||||
<div className="absolute bottom-0 w-full h-[70dvh] bg-linear-to-t from-sidebar-primary/10 to-transparent"></div>
|
||||
{/* Level 1: Icon Bar */}
|
||||
<nav className="w-16 bg-slate-100 dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col items-center pb-4 pt-0 space-y-2 flex-shrink-0">
|
||||
<nav className="w-16 bg-sidebar border-r border-sidebar-border flex flex-col items-center pb-4 pt-0 space-y-2 flex-shrink-0">
|
||||
<div className="flex-1 w-full flex flex-col items-center space-y-5 pt-1">
|
||||
<TooltipProvider>
|
||||
{sidebarItems.map((item, index) => (
|
||||
@@ -116,8 +116,8 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
||||
aria-expanded={activeItem === index}
|
||||
className={`relative w-12 h-12 [&_svg:not([class*='size-'])]:size-6 transition-all duration-200 ${
|
||||
activeItem === index
|
||||
? 'bg-blue-600 text-white shadow-lg hover:bg-blue-600 hover:text-white'
|
||||
: 'text-slate-400 hover:text-slate-500 dark:hover:text-slate-400 dark:text-slate-500 hover:bg-slate-200 dark:hover:bg-slate-800'
|
||||
? 'bg-sidebar-primary text-sidebar-primary-foreground shadow-lg hover:bg-sidebar-primary hover:text-sidebar-primary-foreground'
|
||||
: 'text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent'
|
||||
}`}
|
||||
>
|
||||
{item.props.icon}
|
||||
@@ -127,7 +127,7 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
||||
<TooltipContent
|
||||
side="right"
|
||||
sideOffset={16}
|
||||
className="bg-slate-800 text-white border-slate-700"
|
||||
className="bg-popover text-popover-foreground border border-border"
|
||||
>
|
||||
<p>{item.props.label}</p>
|
||||
</TooltipContent>
|
||||
@@ -142,16 +142,16 @@ export const DualSidebar: React.FC<DualSidebarProps> = ({ children }) => {
|
||||
|
||||
{/* Level 2: Content Panel */}
|
||||
<div
|
||||
className={`transition-all duration-300 ease-in-out bg-white dark:bg-slate-900/95 backdrop-blur-sm shadow-lg overflow-hidden ${
|
||||
className={`transition-all duration-300 ease-in-out bg-sidebar/95 backdrop-blur-sm shadow-lg overflow-hidden ${
|
||||
activeItem !== null
|
||||
? 'w-[calc(100vw-4rem)] md:w-100 border-r border-slate-200 dark:border-slate-800'
|
||||
? 'w-[calc(100vw-4rem)] md:w-100 border-r border-sidebar-border'
|
||||
: 'w-0'
|
||||
}`}
|
||||
>
|
||||
<div className="w-[calc(100vw-4rem)] md:w-100 h-full flex flex-col">
|
||||
{activeItemContent && (
|
||||
<>
|
||||
<header className="h-16 flex items-center px-4 font-bold text-lg border-b border-slate-200 dark:border-slate-800 flex-shrink-0">
|
||||
<header className="h-16 flex items-center px-4 font-bold text-lg border-b border-sidebar-border flex-shrink-0">
|
||||
<h2>{activeItemContent.label}</h2>
|
||||
</header>
|
||||
<div className="flex-1 overflow-y-auto p-2">{activeItemContent.children}</div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { type FieldInfo as MetadataFieldInfo, type FieldInfo, FieldType } from '@/dtos/metadata'
|
||||
import { FieldType, type FieldInfo, type FieldInfo as MetadataFieldInfo } from '@/dtos/metadata'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
import { InferRequestType, InferResponseType } from 'hono/client'
|
||||
import { useFieldStore } from '@/ui/stores/fields'
|
||||
import { DragDropProvider, KeyboardSensor, PointerSensor, type DragEndEvent } from '@dnd-kit/react'
|
||||
import { useSortable } from '@dnd-kit/react/sortable'
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
import { InferRequestType, InferResponseType } from 'hono/client'
|
||||
|
||||
import { Button } from '@/ui/components/ui/button'
|
||||
import {
|
||||
|
||||
@@ -3,31 +3,23 @@ import { client } from '@/ui/api/client'
|
||||
import type { InferRequestType, InferResponseType } from 'hono/client'
|
||||
|
||||
import type { AssetInfo } from '@/dtos/asset'
|
||||
import type { SearchCondition, SearchSort } from '@/dtos/search'
|
||||
import type { CreateUploadTaskRequest } from '@/dtos/upload'
|
||||
import type { ShareLinkInfo } from '@/dtos/share'
|
||||
import type { CollectionInfo } from '@/dtos/collection'
|
||||
import type { SearchCondition, SearchSort } from '@/dtos/search'
|
||||
import type { ShareLinkInfo } from '@/dtos/share'
|
||||
import type { CreateUploadTaskRequest } from '@/dtos/upload'
|
||||
import { formatSize } from '@/ui/lib/format'
|
||||
import { useFieldStore } from '@/ui/stores/fields'
|
||||
import { useUploadStore } from '@/ui/stores/upload'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { Download } from 'lucide-react'
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useInView } from 'react-intersection-observer'
|
||||
import { toast } from 'sonner'
|
||||
import { formatSize } from '@/ui/lib/format'
|
||||
import type { DragState } from '../dnd-types'
|
||||
import { FileBrowserContextMenu } from './context-menu'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { MoveCopyDialog } from '../move-copy-dialog'
|
||||
import { FileBrowserContextMenu } from './context-menu'
|
||||
|
||||
import { FileBrowserGridView } from './grid-view'
|
||||
import { FileBrowserListView } from './list-view'
|
||||
import { FileBrowserToolbar } from './toolbar'
|
||||
import { FileCard } from './file-card'
|
||||
import { FileListItem } from './file-list-item'
|
||||
import { FolderCard } from './folder-card'
|
||||
import { Button } from '../ui/button'
|
||||
import { ContextMenu, ContextMenuTrigger } from '../ui/context-menu'
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -38,6 +30,14 @@ import {
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from '../ui/alert-dialog'
|
||||
import { Button } from '../ui/button'
|
||||
import { ContextMenu, ContextMenuTrigger } from '../ui/context-menu'
|
||||
import { FileCard } from './file-card'
|
||||
import { FileListItem } from './file-list-item'
|
||||
import { FolderCard } from './folder-card'
|
||||
import { FileBrowserGridView } from './grid-view'
|
||||
import { FileBrowserListView } from './list-view'
|
||||
import { FileBrowserToolbar } from './toolbar'
|
||||
import { useFileActions } from './use-file-actions'
|
||||
|
||||
interface FileBrowserProps {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { AssetInfo, ChildPreview } from '@/dtos/asset'
|
||||
import { Checkbox } from '@/ui/components/ui/checkbox'
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
@@ -6,14 +7,13 @@ import {
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/ui/components/ui/dropdown-menu'
|
||||
import { EditableText } from '@/ui/components/ui/editable-text'
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
import { useDraggable, useDroppable } from '@dnd-kit/react'
|
||||
import { Download, Edit, History, MoreHorizontal, Trash2 } from 'lucide-react'
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import type { DragState } from '../dnd-types'
|
||||
import { FilePreview } from './file-preview'
|
||||
import { Checkbox } from '@/ui/components/ui/checkbox'
|
||||
import { EditableText } from '@/ui/components/ui/editable-text'
|
||||
|
||||
interface FolderCardProps {
|
||||
item: AssetInfo
|
||||
@@ -51,21 +51,17 @@ const FolderPreviewGrid = ({ items }: { items: ChildPreview[] }) => {
|
||||
|
||||
// 1 Item
|
||||
if (count === 1) {
|
||||
return (
|
||||
<div className="w-full h-full bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
||||
{renderItem(safeChildren[0])}
|
||||
</div>
|
||||
)
|
||||
return <div className="w-full h-full bg-muted/50 rounded-sm">{renderItem(safeChildren[0])}</div>
|
||||
}
|
||||
|
||||
// 2 Items
|
||||
if (count === 2) {
|
||||
return (
|
||||
<div className="grid grid-cols-2 gap-0.5 h-full w-full">
|
||||
<div className="overflow-hidden h-full bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
||||
<div className="overflow-hidden h-full bg-muted/50 rounded-sm">
|
||||
{renderItem(safeChildren[0])}
|
||||
</div>
|
||||
<div className="overflow-hidden h-full bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
||||
<div className="overflow-hidden h-full bg-muted/50 rounded-sm">
|
||||
{renderItem(safeChildren[1])}
|
||||
</div>
|
||||
</div>
|
||||
@@ -75,14 +71,14 @@ const FolderPreviewGrid = ({ items }: { items: ChildPreview[] }) => {
|
||||
// 3 Items
|
||||
return (
|
||||
<div className="grid grid-cols-3 gap-0.5 h-full w-full">
|
||||
<div className="col-span-1 overflow-hidden h-full relative bg-zinc-200 dark:bg-zinc-800/50 rounded-sm col-span-2">
|
||||
<div className="col-span-1 overflow-hidden h-full relative bg-muted/50 rounded-sm col-span-2">
|
||||
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[0])}</div>
|
||||
</div>
|
||||
<div className="col-span-1 grid grid-rows-2 gap-0.5 h-full col-span-1">
|
||||
<div className="overflow-hidden h-full relative bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
||||
<div className="overflow-hidden h-full relative bg-muted/50 rounded-sm">
|
||||
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[1])}</div>
|
||||
</div>
|
||||
<div className="overflow-hidden h-full relative bg-zinc-200 dark:bg-zinc-800/50 rounded-sm">
|
||||
<div className="overflow-hidden h-full relative bg-muted/50 rounded-sm">
|
||||
<div className="absolute inset-0 w-full h-full">{renderItem(safeChildren[2])}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -195,8 +191,8 @@ export function FolderCard({
|
||||
const tabHeight = 8
|
||||
const config = {
|
||||
cornerRadius: 4,
|
||||
tabRadius: 3,
|
||||
tabSlope: 10,
|
||||
tabRadius: 0,
|
||||
tabSlope: 15,
|
||||
tabBaseWidth: 150,
|
||||
}
|
||||
const folderPath = useMemo(() => {
|
||||
@@ -223,6 +219,27 @@ export function FolderCard({
|
||||
'group relative w-full max-w-[340px] select-none cursor-pointer isolate flex flex-col items-center h-full',
|
||||
)}
|
||||
>
|
||||
<div className="absolute inset-0 z-10 pointer-events-none">
|
||||
<svg
|
||||
width="100%"
|
||||
height="100%"
|
||||
viewBox={`0 0 ${width} ${height}`}
|
||||
preserveAspectRatio="none"
|
||||
className="overflow-visible"
|
||||
>
|
||||
<path
|
||||
d={folderPath}
|
||||
vectorEffect="non-scaling-stroke"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth={showDropFeedback ? 3 : 1}
|
||||
className={cn(
|
||||
'transition-colors duration-200 fill-none group-hover:stroke-primary',
|
||||
(isSelected || isChecked || showDropFeedback) && 'stroke-primary',
|
||||
)}
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div className="absolute inset-0 -z-10 drop-shadow-sm pointer-events-none">
|
||||
<svg
|
||||
width="100%"
|
||||
@@ -235,23 +252,19 @@ export function FolderCard({
|
||||
d={folderPath}
|
||||
vectorEffect="non-scaling-stroke"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth={showDropFeedback ? 3 : 2}
|
||||
className={cn(
|
||||
'transition-colors duration-200 fill-foreground/10 dark:fill-slate-800 dark:stroke-slate-600 group-hover:stroke-indigo-400 dark:group-hover:stroke-indigo-400',
|
||||
(isSelected || isChecked || showDropFeedback) &&
|
||||
'stroke-indigo-500 dark:stroke-indigo-400',
|
||||
)}
|
||||
strokeWidth={showDropFeedback ? 3 : 1}
|
||||
className={cn('transition-colors duration-200 fill-foreground/15')}
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div className="relative w-[calc(100%-0.2rem)] mb-[0.1rem] flex flex-1 flex-col p-2 mt-4 bg-secondary rounded-sm">
|
||||
<div className="relative w-full flex flex-1 flex-col p-2 mt-5 bg-muted dark:bg-card rounded-sm">
|
||||
<div className="relative w-full aspect-video shrink-0 overflow-hidden">
|
||||
<div className="absolute top-1 left-1 z-30 transition-all duration-200">
|
||||
<Checkbox
|
||||
checked={isChecked}
|
||||
onClick={(e) => e.stopPropagation()} // Let parent handler deal with it
|
||||
className="w-5 h-5 border-1 border-black/30 bg-black/5 data-[state=checked]:bg-indigo-600 data-[state=checked]:border-indigo-600"
|
||||
className="w-5 h-5 border-1 border-foreground/20 bg-background/50 data-[state=checked]:bg-primary data-[state=checked]:border-primary"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -268,11 +281,11 @@ export function FolderCard({
|
||||
onBlur={handleRename}
|
||||
onKeyDown={handleKeyDown}
|
||||
disabled={!isEditing}
|
||||
className="font-semibold text-slate-800 dark:text-slate-100 text-lg leading-tight truncate h-auto p-0"
|
||||
className="font-semibold text-foreground text-lg leading-tight truncate h-auto p-0 !bg-transparent"
|
||||
title={name}
|
||||
/>
|
||||
|
||||
<div className="flex items-center justify-between text-slate-500 dark:text-slate-400">
|
||||
<div className="flex items-center justify-between text-muted-foreground">
|
||||
<span className="text-xs tracking-wide opacity-80">
|
||||
{item.fileCount || 0} {(item.fileCount || 0) === 1 ? 'Item' : 'Items'}
|
||||
</span>
|
||||
@@ -280,7 +293,7 @@ export function FolderCard({
|
||||
<DropdownMenuTrigger asChild>
|
||||
<button
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className="p-1.5 -mr-2 rounded-full hover:bg-slate-200/50 dark:hover:bg-slate-700/50 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors cursor-pointer"
|
||||
className="p-1.5 -mr-2 rounded-full hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer"
|
||||
>
|
||||
<MoreHorizontal size={18} />
|
||||
</button>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import type { AssetInfo, AssetInfoPaginatedList } from '@/dtos/asset'
|
||||
import type { CollectionInfo } from '@/dtos/collection'
|
||||
import { type FieldInfo as MetadataFieldInfo } from '@/dtos/metadata'
|
||||
import type { SearchCondition, SearchSort } from '@/dtos/search'
|
||||
import type { CollectionInfo } from '@/dtos/collection'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
import { InferRequestType, InferResponseType } from 'hono/client'
|
||||
|
||||
import { useFieldStore } from '@/ui/stores/fields'
|
||||
import { useMemberStore } from '@/ui/stores/members'
|
||||
import { useTopNavStore } from '@/ui/stores/top-nav'
|
||||
import { useUiStore } from '@/ui/stores/ui'
|
||||
import { useUserMetadataStore } from '@/ui/stores/user-metadata'
|
||||
import { useTopNavStore } from '@/ui/stores/top-nav'
|
||||
import { PointerActivationConstraints } from '@dnd-kit/dom'
|
||||
import { DragDropProvider, DragOverlay, KeyboardSensor, PointerSensor } from '@dnd-kit/react'
|
||||
import { useInfiniteQuery, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { cn } from '../lib/utils'
|
||||
import { SnapToPointer } from './dnd-modifiers'
|
||||
import { FileBrowser } from './file-browser/file-browser'
|
||||
import { FileViewerRightSidebar } from './file-viewer-right-sidebar'
|
||||
import { FolderTree } from './folder-tree'
|
||||
import { ResizeHandle } from './resize-handle'
|
||||
import { useFileSystemDnd } from './use-file-system-dnd'
|
||||
import { PointerActivationConstraints } from '@dnd-kit/dom'
|
||||
import { DragDropProvider, DragOverlay, KeyboardSensor, PointerSensor } from '@dnd-kit/react'
|
||||
import { SnapToPointer } from './dnd-modifiers'
|
||||
import { cn } from '../lib/utils'
|
||||
|
||||
type FileSystemManagerProps = {
|
||||
teamId: string
|
||||
|
||||
@@ -85,21 +85,19 @@ export const NotificationCard = ({ notification }: NotificationCardProps) => {
|
||||
<div
|
||||
className={cn(
|
||||
'w-1.5 h-1.5 rounded-full shadow-xs',
|
||||
isRead ? 'bg-transparent' : 'bg-red-500',
|
||||
isRead ? 'bg-transparent' : 'bg-destructive',
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="flex-1 min-w-0 flex flex-col justify-center pl-2">
|
||||
<div className="text-sm text-slate-800 dark:text-slate-200 break-all leading-snug">
|
||||
{message}
|
||||
</div>
|
||||
<div className="text-[11px] text-slate-500 dark:text-slate-400 mt-1">
|
||||
<div className="text-sm text-foreground break-all leading-snug">{message}</div>
|
||||
<div className="text-[11px] text-muted-foreground mt-1">
|
||||
{formatTimeAgo(createdAt || '')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{hasPreview && (
|
||||
<div className="w-18 h-18 ml-2 rounded-md overflow-hidden flex-shrink-0 bg-slate-100 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 flex items-center justify-center mt-0.5">
|
||||
<div className="w-18 h-18 ml-2 rounded-md overflow-hidden flex-shrink-0 bg-muted border border-border flex items-center justify-center mt-0.5">
|
||||
<img src={asset!.preview} alt={asset!.name} className="w-full h-full object-cover" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -116,7 +116,7 @@ export const NotificationList = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full w-full bg-white dark:bg-slate-900">
|
||||
<div className="flex flex-col h-full w-full bg-transparent">
|
||||
<div className="flex-none pb-1">
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
@@ -136,7 +136,7 @@ export const NotificationList = () => {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-8 px-2 text-slate-500 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-100"
|
||||
className="h-8 px-2 text-muted-foreground hover:text-foreground"
|
||||
onClick={handleMarkAllRead}
|
||||
disabled={notifications.length === 0 || markReadMutation.isPending}
|
||||
title="Mark all as read"
|
||||
@@ -150,12 +150,12 @@ export const NotificationList = () => {
|
||||
<div className="flex-1 overflow-y-auto p-2 min-h-0">
|
||||
{isLoading && (
|
||||
<div className="flex justify-center p-4">
|
||||
<Loader2 className="w-6 h-6 animate-spin text-slate-400" />
|
||||
<Loader2 className="w-6 h-6 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!isLoading && notifications.length === 0 && (
|
||||
<div className="flex flex-col items-center justify-center h-40 text-slate-500 dark:text-slate-400">
|
||||
<div className="flex flex-col items-center justify-center h-40 text-muted-foreground">
|
||||
<p className="text-sm">No notifications</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -168,7 +168,7 @@ export const NotificationList = () => {
|
||||
|
||||
{/* Infinite Scroll Trigger */}
|
||||
<div ref={ref} className="h-4 w-full flex justify-center p-1">
|
||||
{isFetchingNextPage && <Loader2 className="w-4 h-4 animate-spin text-slate-400" />}
|
||||
{isFetchingNextPage && <Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -171,7 +171,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className="bg-red-600 hover:bg-red-700"
|
||||
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||
onClick={(e) => {
|
||||
if (deleteAgentMutation.isPending) {
|
||||
e.preventDefault()
|
||||
@@ -194,13 +194,13 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
|
||||
{isLoading && agents.length === 0 ? (
|
||||
<div className="flex items-center justify-center p-12">
|
||||
<Loader2 className="w-8 h-8 animate-spin text-slate-400" />
|
||||
<Loader2 className="w-8 h-8 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="space-y-6 max-w-5xl mx-auto relative">
|
||||
{isLoading && (
|
||||
<div className="absolute top-0 right-0 p-2">
|
||||
<Loader2 className="w-4 h-4 animate-spin text-slate-400" />
|
||||
<Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
)}
|
||||
{AGENT_TYPES.map((section) => {
|
||||
@@ -210,16 +210,14 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
return (
|
||||
<div
|
||||
key={section.type}
|
||||
className="bg-white dark:bg-slate-900/50 rounded-xl border border-slate-200 dark:border-slate-800 overflow-hidden"
|
||||
className="bg-card rounded-xl border border-border overflow-hidden"
|
||||
>
|
||||
<div
|
||||
className="px-6 py-4 flex items-center justify-between cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors"
|
||||
className="px-6 py-4 flex items-center justify-between cursor-pointer hover:bg-muted/50 transition-colors"
|
||||
onClick={() => toggleSection(section.type)}
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<h3 className="font-semibold text-slate-900 dark:text-white">
|
||||
{section.label} Agents
|
||||
</h3>
|
||||
<h3 className="font-semibold text-foreground">{section.label} Agents</h3>
|
||||
<Badge variant="secondary" className="h-5 px-1.5 min-w-[1.25rem] text-[10px]">
|
||||
{typeAgents.length}
|
||||
</Badge>
|
||||
@@ -232,7 +230,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 rounded-full bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/40"
|
||||
className="h-8 w-8 rounded-full bg-primary/10 text-primary hover:bg-primary/20"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
setCreateType(section.type)
|
||||
@@ -244,7 +242,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
)}
|
||||
<ChevronDown
|
||||
className={cn(
|
||||
'w-5 h-5 text-slate-400 transition-transform duration-200',
|
||||
'w-5 h-5 text-muted-foreground transition-transform duration-200',
|
||||
expandedSections[section.type] ? 'rotate-180' : '',
|
||||
)}
|
||||
/>
|
||||
@@ -257,12 +255,12 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
{typeAgents.map((agent) => (
|
||||
<Card
|
||||
key={agent.id}
|
||||
className="group relative overflow-hidden border-slate-200 dark:border-slate-800 hover:border-blue-500/50 dark:hover:border-blue-400/50 transition-all duration-200 cursor-pointer"
|
||||
className="group relative overflow-hidden border-border hover:border-primary/50 transition-all duration-200 cursor-pointer"
|
||||
onClick={() => setAgentToEdit(agent)}
|
||||
>
|
||||
<CardContent className="p-4 flex items-center justify-between">
|
||||
<div className="flex items-center gap-3 min-w-0 flex-1">
|
||||
<div className="w-10 h-10 rounded-full bg-slate-100 dark:bg-slate-800 flex items-center justify-center overflow-hidden">
|
||||
<div className="w-10 h-10 rounded-full bg-muted flex items-center justify-center overflow-hidden">
|
||||
{agent.avatar ? (
|
||||
<img
|
||||
src={agent.avatar}
|
||||
@@ -270,14 +268,14 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
alt=""
|
||||
/>
|
||||
) : (
|
||||
<Bot className="w-6 h-6 text-slate-400" />
|
||||
<Bot className="w-6 h-6 text-muted-foreground" />
|
||||
)}
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<span className="font-bold text-slate-900 dark:text-white block truncate">
|
||||
<span className="font-bold text-foreground block truncate">
|
||||
{agent.name}
|
||||
</span>
|
||||
<div className="flex items-center gap-2 text-xs text-slate-500 mt-0.5">
|
||||
<div className="flex items-center gap-2 text-xs text-muted-foreground mt-0.5">
|
||||
<span className="flex items-center gap-1">
|
||||
<Puzzle className="w-3 h-3" />
|
||||
{agent.skills?.length || 0} Skills
|
||||
@@ -312,7 +310,7 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
<MoreVertical className="w-4 h-4" />
|
||||
</Button>
|
||||
@@ -335,15 +333,17 @@ export function AgentsSettings({ teamId }: AgentsSettingsProps) {
|
||||
</Card>
|
||||
))}
|
||||
{typeAgents.length === 0 && (
|
||||
<div className="col-span-full py-8 flex flex-col items-center justify-center border-2 border-dashed border-slate-200 dark:border-slate-800 rounded-xl bg-slate-50/50 dark:bg-slate-900/20">
|
||||
<div className="w-10 h-10 rounded-full bg-white dark:bg-slate-800 flex items-center justify-center shadow-sm mb-3">
|
||||
<Icon className="w-5 h-5 text-slate-400" />
|
||||
<div className="col-span-full py-8 flex flex-col items-center justify-center border-2 border-dashed border-border rounded-xl bg-muted/30">
|
||||
<div className="w-10 h-10 rounded-full bg-card flex items-center justify-center shadow-sm mb-3">
|
||||
<Icon className="w-5 h-5 text-muted-foreground" />
|
||||
</div>
|
||||
<p className="text-sm text-slate-500">No {section.label} agents found</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
No {section.label} agents found
|
||||
</p>
|
||||
<Button
|
||||
variant="link"
|
||||
size="sm"
|
||||
className="text-blue-600 font-medium h-auto p-0 mt-1"
|
||||
className="text-primary font-medium h-auto p-0 mt-1"
|
||||
onClick={() => {
|
||||
setCreateType(section.type)
|
||||
setIsCreateDialogOpen(true)
|
||||
|
||||
@@ -194,7 +194,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex h-64 items-center justify-center">
|
||||
<Loader2 className="h-8 w-8 animate-spin text-blue-600" />
|
||||
<Loader2 className="h-8 w-8 animate-spin text-primary" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -203,13 +203,13 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
<div className="h-full flex flex-col space-y-0">
|
||||
<div className="flex-none space-y-4 pb-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<h3 className="text-lg font-semibold text-slate-900 dark:text-white flex items-center gap-2">
|
||||
<Cpu className="w-5 h-5 text-blue-600" />
|
||||
<h3 className="text-lg font-semibold text-foreground flex items-center gap-2">
|
||||
<Cpu className="w-5 h-5 text-primary" />
|
||||
Configured AI Providers
|
||||
</h3>
|
||||
<Button
|
||||
onClick={() => setIsCreateDialogOpen(true)}
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white gap-2"
|
||||
className="bg-primary hover:bg-primary/90 text-primary-foreground gap-2"
|
||||
>
|
||||
<Plus className="w-4 h-4" />
|
||||
Add Provider
|
||||
@@ -217,12 +217,12 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
</div>
|
||||
|
||||
<div className="relative px-0.5">
|
||||
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" />
|
||||
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
||||
<Input
|
||||
placeholder="Search providers..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="pl-10 bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-800 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-0"
|
||||
className="pl-10 bg-card border-border focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -232,19 +232,17 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
{filteredProviders.map((provider) => (
|
||||
<Card
|
||||
key={provider.id}
|
||||
className="group cursor-pointer hover:border-blue-300 dark:hover:border-blue-700 transition-all hover:shadow-md overflow-hidden"
|
||||
className="group cursor-pointer hover:border-primary/50 transition-all hover:shadow-md overflow-hidden"
|
||||
onClick={() => setEditingProviderId(provider.id)}
|
||||
>
|
||||
<CardContent className="p-5 flex items-center justify-between gap-4">
|
||||
<div className="flex items-center gap-4 min-w-0 flex-1">
|
||||
<div className="flex-none p-3 bg-slate-100 dark:bg-slate-800 rounded-xl group-hover:bg-blue-50 dark:group-hover:bg-blue-900/20 transition-colors">
|
||||
<Globe className="w-6 h-6 text-slate-600 dark:text-slate-400 group-hover:text-blue-600 dark:group-hover:text-blue-400" />
|
||||
<div className="flex-none p-3 bg-muted rounded-xl group-hover:bg-primary/10 transition-colors">
|
||||
<Globe className="w-6 h-6 text-muted-foreground group-hover:text-primary" />
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-bold text-slate-900 dark:text-white truncate">
|
||||
{provider.name}
|
||||
</span>
|
||||
<span className="font-bold text-foreground truncate">{provider.name}</span>
|
||||
{provider.isBuiltin && (
|
||||
<Badge
|
||||
variant="secondary"
|
||||
@@ -254,14 +252,14 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-slate-500 mt-1">
|
||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-muted-foreground mt-1">
|
||||
<span className="flex items-center gap-1 flex-none">
|
||||
<Zap className="w-3 h-3" />
|
||||
{provider.config.api}
|
||||
</span>
|
||||
{provider.config.baseUrl && (
|
||||
<span className="flex items-center gap-1 min-w-0">
|
||||
<span className="h-1 w-1 rounded-full bg-slate-300 dark:bg-slate-700 flex-none" />
|
||||
<span className="h-1 w-1 rounded-full bg-muted-foreground/30 flex-none" />
|
||||
<Info className="w-3 h-3 flex-none" />
|
||||
<span className="truncate max-w-[200px] md:max-w-[300px]">
|
||||
{provider.config.baseUrl}
|
||||
@@ -269,7 +267,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
</span>
|
||||
)}
|
||||
<span className="flex items-center gap-1 flex-none">
|
||||
<span className="h-1 w-1 rounded-full bg-slate-300 dark:bg-slate-700 flex-none" />
|
||||
<span className="h-1 w-1 rounded-full bg-muted-foreground/30 flex-none" />
|
||||
<Maximize2 className="w-3 h-3" />
|
||||
{provider.modelsCount} Models
|
||||
{editingProviderId === provider.id && isModelsLoading && (
|
||||
@@ -286,7 +284,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-8 w-8 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300"
|
||||
className="h-8 w-8 text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
<MoreVertical className="w-4 h-4" />
|
||||
</Button>
|
||||
@@ -299,25 +297,23 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
setProviderToDelete(provider)
|
||||
setIsDeleteDialogOpen(true)
|
||||
}}
|
||||
className="text-red-500 focus:text-red-500 gap-2 cursor-pointer"
|
||||
className="text-destructive focus:text-destructive gap-2 cursor-pointer"
|
||||
>
|
||||
<Trash2 className="w-4 h-4" /> Delete
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<ChevronRight className="flex-none w-5 h-5 text-slate-300 group-hover:text-blue-500 transition-colors" />
|
||||
<ChevronRight className="flex-none w-5 h-5 text-muted-foreground/50 group-hover:text-primary transition-colors" />
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
))}
|
||||
|
||||
{providers?.length === 0 && (
|
||||
<div className="text-center py-12 bg-slate-50 dark:bg-slate-900/50 rounded-2xl border-2 border-dashed border-slate-200 dark:border-slate-800">
|
||||
<Cpu className="w-12 h-12 text-slate-300 mx-auto mb-4" />
|
||||
<h4 className="text-slate-900 dark:text-white font-medium">
|
||||
No Providers Configured
|
||||
</h4>
|
||||
<p className="text-sm text-slate-500 mt-1">
|
||||
<div className="text-center py-12 bg-muted/30 rounded-2xl border-2 border-dashed border-border">
|
||||
<Cpu className="w-12 h-12 text-muted-foreground/50 mx-auto mb-4" />
|
||||
<h4 className="text-foreground font-medium">No Providers Configured</h4>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Add your first AI provider to get started.
|
||||
</p>
|
||||
</div>
|
||||
@@ -325,16 +321,16 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
|
||||
{providers && providers.length > 0 && filteredProviders.length === 0 && (
|
||||
<div className="text-center py-12">
|
||||
<Search className="w-12 h-12 text-slate-300 mx-auto mb-4" />
|
||||
<h4 className="text-slate-900 dark:text-white font-medium">No matches found</h4>
|
||||
<p className="text-sm text-slate-500 mt-1">
|
||||
<Search className="w-12 h-12 text-muted-foreground/50 mx-auto mb-4" />
|
||||
<h4 className="text-foreground font-medium">No matches found</h4>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Try adjusting your search for "{searchQuery}"
|
||||
</p>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setSearchQuery('')}
|
||||
className="mt-4 text-blue-600 hover:text-blue-700 hover:bg-blue-50 dark:hover:bg-blue-900/20"
|
||||
className="mt-4 text-primary hover:text-primary/90 hover:bg-primary/10"
|
||||
>
|
||||
Clear search
|
||||
</Button>
|
||||
@@ -383,7 +379,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel onClick={() => setProviderToDelete(null)}>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className="bg-red-600 hover:bg-red-700 text-white"
|
||||
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||
onClick={() => {
|
||||
if (providerToDelete) {
|
||||
deleteMutation.mutate(providerToDelete.id)
|
||||
|
||||
@@ -89,10 +89,10 @@ export const SkillsConfigCard: React.FC<SkillsConfigCardProps> = ({ teamId }) =>
|
||||
const skills = data?.skills || []
|
||||
|
||||
return (
|
||||
<Card className="border-slate-200 dark:border-slate-800">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-7">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="p-2 bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 rounded-lg">
|
||||
<div className="p-2 bg-primary/10 text-primary rounded-lg">
|
||||
<Puzzle className="w-6 h-6" />
|
||||
</div>
|
||||
<div>
|
||||
@@ -109,17 +109,15 @@ export const SkillsConfigCard: React.FC<SkillsConfigCardProps> = ({ teamId }) =>
|
||||
<CardContent>
|
||||
{isLoading ? (
|
||||
<div className="flex justify-center py-10">
|
||||
<Loader2 className="w-8 h-8 animate-spin text-blue-500" />
|
||||
<Loader2 className="w-8 h-8 animate-spin text-primary" />
|
||||
</div>
|
||||
) : skills.length === 0 ? (
|
||||
<div className="text-center py-12 border-2 border-dashed border-slate-200 dark:border-slate-800 rounded-xl">
|
||||
<div className="mx-auto w-12 h-12 bg-slate-50 dark:bg-slate-900 rounded-full flex items-center justify-center mb-4 text-slate-400">
|
||||
<div className="text-center py-12 border-2 border-dashed border-border rounded-xl">
|
||||
<div className="mx-auto w-12 h-12 bg-muted rounded-full flex items-center justify-center mb-4 text-muted-foreground">
|
||||
<Puzzle className="w-6 h-6" />
|
||||
</div>
|
||||
<h3 className="text-lg font-medium text-slate-900 dark:text-white">
|
||||
No skills installed
|
||||
</h3>
|
||||
<p className="text-slate-500 dark:text-slate-400 mt-1 max-w-xs mx-auto">
|
||||
<h3 className="text-lg font-medium text-foreground">No skills installed</h3>
|
||||
<p className="text-muted-foreground mt-1 max-w-xs mx-auto">
|
||||
Add a skill via GitHub URL or upload a ZIP file to get started.
|
||||
</p>
|
||||
</div>
|
||||
@@ -174,7 +172,7 @@ export const SkillsConfigCard: React.FC<SkillsConfigCardProps> = ({ teamId }) =>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className="bg-red-600 hover:bg-red-700 text-white"
|
||||
className="bg-destructive hover:bg-destructive/90 text-white"
|
||||
onClick={() => {
|
||||
if (selectedSkill) {
|
||||
deleteMutation.mutate(selectedSkill.id)
|
||||
@@ -206,14 +204,12 @@ const SkillItem = ({
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className="p-4 bg-white dark:bg-slate-900 rounded-xl border border-slate-200 dark:border-slate-800 flex flex-col justify-between hover:shadow-md transition-all group cursor-pointer"
|
||||
className="p-4 bg-card rounded-xl border border-border flex flex-col justify-between hover:shadow-md transition-all group cursor-pointer"
|
||||
onClick={onConfigure}
|
||||
>
|
||||
<div>
|
||||
<div className="flex items-start justify-between mb-2">
|
||||
<h4 className="font-bold text-slate-900 dark:text-white flex items-center gap-2">
|
||||
{skill.name}
|
||||
</h4>
|
||||
<h4 className="font-bold text-foreground flex items-center gap-2">{skill.name}</h4>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild onClick={(e) => e.stopPropagation()}>
|
||||
<Button variant="ghost" size="icon" className="h-8 w-8">
|
||||
@@ -233,15 +229,13 @@ const SkillItem = ({
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400 line-clamp-2">
|
||||
<p className="text-sm text-muted-foreground line-clamp-2">
|
||||
{skill.description || 'No description provided.'}
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-4 flex items-center justify-between text-[10px] text-slate-400 dark:text-slate-500 uppercase tracking-wider font-semibold">
|
||||
<div className="mt-4 flex items-center justify-between text-[10px] text-muted-foreground uppercase tracking-wider font-semibold">
|
||||
<span>Updated {new Date(skill.updatedAt).toLocaleDateString()}</span>
|
||||
<div className="px-2 py-0.5 rounded-full bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400">
|
||||
Installed
|
||||
</div>
|
||||
<div className="px-2 py-0.5 rounded-full bg-primary/10 text-primary">Installed</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -10,15 +10,15 @@ function UploadTaskItem({ task }: { task: TaskInfo }) {
|
||||
const progress =
|
||||
task.total && task.total > 0 ? `${((task.uploaded ?? 0) / task.total) * 100}%` : '0%'
|
||||
return (
|
||||
<div className="p-2 rounded-md transition-colors hover:bg-slate-100 dark:hover:bg-slate-800">
|
||||
<div className="p-2 rounded-md transition-colors hover:bg-sidebar-accent">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm font-medium truncate">{task.name ?? 'unknown'}</span>
|
||||
<span className="text-xs text-slate-500 dark:text-slate-400">
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{task.uploaded}/{task.total}
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-1 h-1 w-full bg-slate-200 dark:bg-slate-700 rounded-full">
|
||||
<div className="h-1 bg-blue-600 rounded-full" style={{ width: progress }} />
|
||||
<div className="mt-1 h-1 w-full bg-muted rounded-full">
|
||||
<div className="h-1 bg-primary rounded-full" style={{ width: progress }} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
+60
-52
@@ -8,64 +8,72 @@
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
:root {
|
||||
--background: oklch(0.98 0 0);
|
||||
--foreground: oklch(0.15 0 0);
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.153 0.006 107.1);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.15 0 0);
|
||||
--card-foreground: oklch(0.153 0.006 107.1);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.15 0 0);
|
||||
--primary: oklch(0.58 0.18 252);
|
||||
--primary-foreground: oklch(1 0 0);
|
||||
--secondary: oklch(0.96 0 0);
|
||||
--secondary-foreground: oklch(0.15 0 0);
|
||||
--muted: oklch(0.94 0 0);
|
||||
--muted-foreground: oklch(0.5 0 0);
|
||||
--accent: oklch(0.96 0 0);
|
||||
--accent-foreground: oklch(0.15 0 0);
|
||||
--popover-foreground: oklch(0.153 0.006 107.1);
|
||||
--primary: oklch(0.553 0.195 38.402);
|
||||
--primary-foreground: oklch(0.98 0.016 73.684);
|
||||
--secondary: oklch(0.967 0.001 286.375);
|
||||
--secondary-foreground: oklch(0.21 0.006 285.885);
|
||||
--muted: oklch(0.966 0.005 106.5);
|
||||
--muted-foreground: oklch(0.58 0.031 107.3);
|
||||
--accent: oklch(0.966 0.005 106.5);
|
||||
--accent-foreground: oklch(0.228 0.013 107.4);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--border: oklch(0.88 0 0);
|
||||
--input: oklch(0.92 0 0);
|
||||
--ring: oklch(0.58 0.18 252);
|
||||
--radius: 0.5rem;
|
||||
--sidebar: oklch(0.97 0 0);
|
||||
--sidebar-foreground: oklch(0.2 0 0);
|
||||
--sidebar-primary: oklch(0.58 0.18 252);
|
||||
--sidebar-primary-foreground: oklch(1 0 0);
|
||||
--sidebar-accent: oklch(0.93 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.15 0 0);
|
||||
--sidebar-border: oklch(0.88 0 0);
|
||||
--sidebar-ring: oklch(0.58 0.18 252);
|
||||
--border: oklch(0.93 0.007 106.5);
|
||||
--input: oklch(0.93 0.007 106.5);
|
||||
--ring: oklch(0.737 0.021 106.9);
|
||||
--chart-1: oklch(0.879 0.169 91.605);
|
||||
--chart-2: oklch(0.769 0.188 70.08);
|
||||
--chart-3: oklch(0.666 0.179 58.318);
|
||||
--chart-4: oklch(0.555 0.163 48.998);
|
||||
--chart-5: oklch(0.473 0.137 46.201);
|
||||
--radius: 0.625rem;
|
||||
--sidebar: oklch(0.988 0.003 106.5);
|
||||
--sidebar-foreground: oklch(0.153 0.006 107.1);
|
||||
--sidebar-primary: oklch(0.646 0.222 41.116);
|
||||
--sidebar-primary-foreground: oklch(0.98 0.016 73.684);
|
||||
--sidebar-accent: oklch(0.966 0.005 106.5);
|
||||
--sidebar-accent-foreground: oklch(0.228 0.013 107.4);
|
||||
--sidebar-border: oklch(0.93 0.007 106.5);
|
||||
--sidebar-ring: oklch(0.737 0.021 106.9);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.12 0 0);
|
||||
--foreground: oklch(0.92 0 0);
|
||||
--card: oklch(0.15 0 0);
|
||||
--card-foreground: oklch(0.92 0 0);
|
||||
--popover: oklch(0.18 0 0);
|
||||
--popover-foreground: oklch(0.92 0 0);
|
||||
--primary: oklch(0.58 0.18 252);
|
||||
--primary-foreground: oklch(1 0 0);
|
||||
--secondary: oklch(0.22 0 0);
|
||||
--secondary-foreground: oklch(0.92 0 0);
|
||||
--muted: oklch(0.2 0 0);
|
||||
--muted-foreground: oklch(0.6 0 0);
|
||||
--accent: oklch(0.25 0 0);
|
||||
--accent-foreground: oklch(0.92 0 0);
|
||||
--destructive: oklch(0.48 0.2 25);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--border: oklch(0.25 0 0);
|
||||
--input: oklch(0.22 0 0);
|
||||
--ring: oklch(0.58 0.18 252);
|
||||
--sidebar: oklch(0.16 0 0);
|
||||
--sidebar-foreground: oklch(0.85 0 0);
|
||||
--sidebar-primary: oklch(0.58 0.18 252);
|
||||
--sidebar-primary-foreground: oklch(1 0 0);
|
||||
--sidebar-accent: oklch(0.22 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.92 0 0);
|
||||
--sidebar-border: oklch(0.25 0 0);
|
||||
--sidebar-ring: oklch(0.58 0.18 252);
|
||||
--background: oklch(0.153 0.006 107.1);
|
||||
--foreground: oklch(0.988 0.003 106.5);
|
||||
--card: oklch(0.228 0.013 107.4);
|
||||
--card-foreground: oklch(0.988 0.003 106.5);
|
||||
--popover: oklch(0.228 0.013 107.4);
|
||||
--popover-foreground: oklch(0.988 0.003 106.5);
|
||||
--primary: oklch(0.47 0.157 37.304);
|
||||
--primary-foreground: oklch(0.98 0.016 73.684);
|
||||
--secondary: oklch(0.274 0.006 286.033);
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.286 0.016 107.4);
|
||||
--muted-foreground: oklch(0.737 0.021 106.9);
|
||||
--accent: oklch(0.286 0.016 107.4);
|
||||
--accent-foreground: oklch(0.988 0.003 106.5);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--border: oklch(1 0 0 / 10%);
|
||||
--input: oklch(1 0 0 / 15%);
|
||||
--ring: oklch(0.58 0.031 107.3);
|
||||
--chart-1: oklch(0.879 0.169 91.605);
|
||||
--chart-2: oklch(0.769 0.188 70.08);
|
||||
--chart-3: oklch(0.666 0.179 58.318);
|
||||
--chart-4: oklch(0.555 0.163 48.998);
|
||||
--chart-5: oklch(0.473 0.137 46.201);
|
||||
--sidebar: oklch(0.228 0.013 107.4);
|
||||
--sidebar-foreground: oklch(0.988 0.003 106.5);
|
||||
--sidebar-primary: oklch(0.705 0.213 47.604);
|
||||
--sidebar-primary-foreground: oklch(0.98 0.016 73.684);
|
||||
--sidebar-accent: oklch(0.286 0.016 107.4);
|
||||
--sidebar-accent-foreground: oklch(0.988 0.003 106.5);
|
||||
--sidebar-border: oklch(1 0 0 / 10%);
|
||||
--sidebar-ring: oklch(0.58 0.031 107.3);
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { client } from '@/ui/api/client'
|
||||
import { DualSidebar, DualSidebarItem } from '@/ui/components/dual-sidebar'
|
||||
import { NotificationList } from '@/ui/components/notification-list'
|
||||
import { TopNav } from '@/ui/components/top-nav'
|
||||
@@ -7,14 +8,13 @@ import { UploadTasks } from '@/ui/components/upload-tasks'
|
||||
import { useAuthStore } from '@/ui/stores/auth'
|
||||
import { useTeamContextStore } from '@/ui/stores/team-context'
|
||||
import { useUploadStore } from '@/ui/stores/upload'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import {
|
||||
createRootRouteWithContext,
|
||||
Outlet,
|
||||
useNavigate,
|
||||
useRouterState,
|
||||
} from '@tanstack/react-router'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { client } from '@/ui/api/client'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
function RootComponent() {
|
||||
|
||||
@@ -103,12 +103,12 @@ function TeamSettingsPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-full bg-slate-50 dark:bg-slate-950 font-sans selection:bg-blue-100 dark:selection:bg-blue-900 transition-colors duration-300">
|
||||
<div className="h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300">
|
||||
<div className="flex flex-col md:flex-row h-full">
|
||||
{/* Sidebar */}
|
||||
<div className="w-full h-full md:w-72 bg-white dark:bg-slate-900 border-b md:border-b-0 md:border-r border-slate-200 dark:border-slate-800 z-10 md:left-16 overflow-y-auto transition-colors duration-300">
|
||||
<div className="w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300">
|
||||
<nav className="p-4 space-y-1 mt-4">
|
||||
<div className="mb-2 px-4 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider">
|
||||
<div className="mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider">
|
||||
Settings
|
||||
</div>
|
||||
|
||||
@@ -117,14 +117,14 @@ function TeamSettingsPage() {
|
||||
className={cn(
|
||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||
activeTab === 'general'
|
||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
||||
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||
)}
|
||||
>
|
||||
<User className="w-5 h-5" />
|
||||
General
|
||||
{activeTab === 'general' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
@@ -133,14 +133,14 @@ function TeamSettingsPage() {
|
||||
className={cn(
|
||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||
activeTab === 'transcode'
|
||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
||||
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||
)}
|
||||
>
|
||||
<Film className="w-5 h-5" />
|
||||
Media Processing
|
||||
{activeTab === 'transcode' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
@@ -149,18 +149,18 @@ function TeamSettingsPage() {
|
||||
className={cn(
|
||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||
activeTab === 'notifications'
|
||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
||||
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||
)}
|
||||
>
|
||||
<Bell className="w-5 h-5" />
|
||||
Notifications
|
||||
{activeTab === 'notifications' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider pt-4 border-t border-slate-100 dark:border-slate-800">
|
||||
<div className="mt-6 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border">
|
||||
AI
|
||||
</div>
|
||||
|
||||
@@ -169,14 +169,14 @@ function TeamSettingsPage() {
|
||||
className={cn(
|
||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||
activeTab === 'providers'
|
||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
||||
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||
)}
|
||||
>
|
||||
<Cpu className="w-5 h-5" />
|
||||
Providers
|
||||
{activeTab === 'providers' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
@@ -185,14 +185,14 @@ function TeamSettingsPage() {
|
||||
className={cn(
|
||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||
activeTab === 'skills'
|
||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
||||
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||
)}
|
||||
>
|
||||
<Puzzle className="w-5 h-5" />
|
||||
Skills
|
||||
{activeTab === 'skills' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
@@ -201,14 +201,14 @@ function TeamSettingsPage() {
|
||||
className={cn(
|
||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||
activeTab === 'agents'
|
||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
||||
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||
)}
|
||||
>
|
||||
<Bot className="w-5 h-5" />
|
||||
Agents
|
||||
{activeTab === 'agents' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
@@ -217,25 +217,25 @@ function TeamSettingsPage() {
|
||||
className={cn(
|
||||
'w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all',
|
||||
activeTab === 'sandbox'
|
||||
? 'bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-1 ring-blue-200 dark:ring-blue-800'
|
||||
: 'text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800 hover:text-slate-900 dark:hover:text-white',
|
||||
? 'bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border'
|
||||
: 'text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
||||
)}
|
||||
>
|
||||
<Shield className="w-5 h-5" />
|
||||
Agent Sandbox
|
||||
{activeTab === 'sandbox' && (
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-blue-600 dark:bg-blue-400" />
|
||||
<div className="ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary" />
|
||||
)}
|
||||
</button>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
{/* Main Content Area */}
|
||||
<main className="flex-1 bg-slate-50/50 dark:bg-slate-950 h-full flex flex-col transition-colors duration-300 overflow-y-hidden">
|
||||
<main className="flex-1 bg-background/50 h-full flex flex-col transition-colors duration-300 overflow-y-hidden">
|
||||
<div className="flex-1 flex flex-col max-w-4xl w-full mx-auto p-6 md:p-10 overflow-hidden">
|
||||
<div className="flex-none flex items-center justify-between mb-6">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-slate-900 dark:text-white">
|
||||
<h2 className="text-2xl font-bold text-foreground">
|
||||
{activeTab === 'general' && 'General Settings'}
|
||||
{activeTab === 'transcode' && 'Media Processing'}
|
||||
{activeTab === 'skills' && 'Skills Management'}
|
||||
@@ -244,7 +244,7 @@ function TeamSettingsPage() {
|
||||
{activeTab === 'sandbox' && 'Agent Sandbox Settings'}
|
||||
{activeTab === 'notifications' && 'Notification Settings'}
|
||||
</h2>
|
||||
<p className="text-sm text-slate-500 dark:text-slate-400 mt-1">
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
{activeTab === 'general' && 'View your personal information and team role.'}
|
||||
{activeTab === 'transcode' &&
|
||||
"Manage your team's media transcoding configurations."}
|
||||
|
||||
Reference in New Issue
Block a user