Repository navigation
Closed
Description
Create type-safe SVG icon component and integrate text node icon for professional node type indicators.
Dependencies
Related Issues
Requirements
- Icon Component: Svelte component with props:
name: IconName,size?: number,className?: string,color?: string - SVG Specs: viewBox
"0 -960 960 960",currentColorfill support, default 20px size - Text Icon: Document with pencil SVG path:
"M160-400v-80h280v80H160Zm0-160v-80h440v80H160Zm0-160v-80h440v80H160Zm360 560v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" - File Structure:
src/lib/design/icons/Icon.svelte,src/lib/design/icons/ui/text.ts,src/lib/design/icons/index.ts - Type Safety: Export
IconNameunion type, currently'text'(expandable for future) - Tree Shaking: Modular exports for optimal bundle size
- Documentation: Clean comments describing icon purpose (no external design system references)
Technical Implementation
- Icon Component: Create in
src/lib/design/icons/Icon.svelte - SVG Structure: Standard
<svg>element with<path>child, responsive sizing - Type Definition: Create
IconNameunion type inindex.tsfor autocomplete - Export Pattern: Follow design system modular export structure
- Theme Integration: Use
currentColorfor automatic theme color inheritance - Reference: Follow existing design system component patterns
Example Implementation
<\!-- Icon.svelte -->
<script lang="ts">
import type { IconName } from './index.js';
export let name: IconName;
export let size: number = 20;
export let className: string = '';
export let color: string = 'currentColor';
// Icon path lookup logic
</script>
<svg width={size} height={size} viewBox="0 -960 960 960" class="ns-icon {className}" style:fill={color}>
<path d={iconPath} />
</svg>Acceptance Criteria
- Icon component renders SVG with proper viewBox and sizing
- Text icon displays correctly at various sizes (16px, 20px, 24px)
- TypeScript provides autocomplete for icon names
- Icons support theme color changes through
currentColor - Component ready for additional icons (infrastructure in place)
- Icons render crisply at different zoom levels
Metadata
Metadata
Assignees
Labels
No labels
Activity
Implement SVG Icon System with Text Icon (addresses #16)
Implement SVG Icon System with Text Icon (addresses #16) (#23)
Implement SVG Icon System with Text Icon (addresses #16) (#23)
Implement SVG Icon System with Text Icon (addresses #16) (#23)