feat(ui): add Type color, icon, and sidebar section group
- Add Type to color maps (accent-blue) in typeColors.ts - Add StackSimple icon for Type in NoteList, Inspector, and Sidebar - Add "Types" section group to sidebar navigation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import type { VaultEntry, GitCommit } from '../types'
|
||||
import { cn } from '@/lib/utils'
|
||||
import {
|
||||
SlidersHorizontal, X, Wrench, Flask, Target, ArrowsClockwise,
|
||||
Users, CalendarBlank, Tag, FileText,
|
||||
Users, CalendarBlank, Tag, FileText, StackSimple,
|
||||
} from '@phosphor-icons/react'
|
||||
import { parseFrontmatter, type ParsedFrontmatter } from '../utils/frontmatter'
|
||||
import { DynamicPropertiesPanel, RELATIONSHIP_KEYS, containsWikilinks } from './DynamicPropertiesPanel'
|
||||
@@ -18,6 +18,7 @@ const TYPE_ICON_MAP: Record<string, ComponentType<SVGAttributes<SVGSVGElement>>>
|
||||
Person: Users,
|
||||
Event: CalendarBlank,
|
||||
Topic: Tag,
|
||||
Type: StackSimple,
|
||||
}
|
||||
|
||||
function getTypeIcon(isA: string | undefined): ComponentType<SVGAttributes<SVGSVGElement>> {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { cn } from '@/lib/utils'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import {
|
||||
MagnifyingGlass, Plus, Wrench, Flask, Target, ArrowsClockwise,
|
||||
Users, CalendarBlank, Tag, FileText, CaretDown, CaretRight,
|
||||
Users, CalendarBlank, Tag, FileText, CaretDown, CaretRight, StackSimple,
|
||||
} from '@phosphor-icons/react'
|
||||
import type { ComponentType, SVGAttributes } from 'react'
|
||||
import { getTypeColor, getTypeLightColor } from '../utils/typeColors'
|
||||
@@ -18,6 +18,7 @@ const TYPE_ICON_MAP: Record<string, ComponentType<SVGAttributes<SVGSVGElement>>>
|
||||
Person: Users,
|
||||
Event: CalendarBlank,
|
||||
Topic: Tag,
|
||||
Type: StackSimple,
|
||||
}
|
||||
|
||||
function getTypeIcon(isA: string | null): ComponentType<SVGAttributes<SVGSVGElement>> {
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
Tag,
|
||||
TagSimple,
|
||||
Trash,
|
||||
StackSimple,
|
||||
type IconProps,
|
||||
} from '@phosphor-icons/react'
|
||||
|
||||
@@ -40,6 +41,7 @@ const SECTION_GROUPS: { label: string; type: string; Icon: ComponentType<IconPro
|
||||
{ label: 'People', type: 'Person', Icon: Users },
|
||||
{ label: 'Events', type: 'Event', Icon: CalendarBlank },
|
||||
{ label: 'Topics', type: 'Topic', Icon: Tag },
|
||||
{ label: 'Types', type: 'Type', Icon: StackSimple },
|
||||
]
|
||||
|
||||
export const Sidebar = memo(function Sidebar({ entries, selection, onSelect, onSelectNote, modifiedCount = 0, onCommitPush }: SidebarProps) {
|
||||
|
||||
@@ -11,6 +11,7 @@ const TYPE_COLOR_MAP: Record<string, string> = {
|
||||
Person: 'var(--accent-yellow)',
|
||||
Event: 'var(--accent-yellow)',
|
||||
Topic: 'var(--accent-green)',
|
||||
Type: 'var(--accent-blue)',
|
||||
}
|
||||
|
||||
const TYPE_LIGHT_COLOR_MAP: Record<string, string> = {
|
||||
@@ -21,6 +22,7 @@ const TYPE_LIGHT_COLOR_MAP: Record<string, string> = {
|
||||
Person: 'var(--accent-yellow-light)',
|
||||
Event: 'var(--accent-yellow-light)',
|
||||
Topic: 'var(--accent-green-light)',
|
||||
Type: 'var(--accent-blue-light)',
|
||||
}
|
||||
|
||||
const DEFAULT_COLOR = 'var(--accent-blue)'
|
||||
|
||||
Reference in New Issue
Block a user