Prompt file imported from 21-DOT-DEV/websites (
.windsurf/workflows/44-designsystem-management.md). Copyright stays with the author.
DesignSystem Management
Icons Management
-
Add new social icon:
// In Sources/DesignSystem/Icons/SocialIcon.swift public enum SocialIcon { case github, twitter, linkedin, newPlatform public var svgPath: String { switch self { case .newPlatform: return "M... // SVG path data" } } } -
Add custom icon component:
touch Sources/DesignSystem/Icons/<IconName>Icon.swift -
Test icon rendering:
- Add test case in
Tests/DesignSystemTests/Components/ - Verify SVG output with TestUtils
- Add test case in
Models Management
-
Add new component model:
touch Sources/DesignSystem/Models/<ComponentName>Models.swift -
Model structure pattern:
import Foundation /// Models for ComponentName configuration @available(iOS 17.0, macOS 14.0, *) public struct ComponentNameConfiguration { public let title: String public let style: ComponentNameStyle public init(title: String, style: ComponentNameStyle = .default) { self.title = title self.style = style } } @available(iOS 17.0, macOS 14.0, *) public enum ComponentNameStyle { case `default`, primary, secondary }
Tokens Management
-
Update design tokens:
// In Sources/DesignSystem/Tokens/StyleTokens.swift public enum StyleTokens { public static let newColorToken = "new-color-class" public static let newSpacingToken = "spacing-value" } -
Add layout tokens:
// In Sources/DesignSystem/Tokens/LayoutTokens.swift public enum LayoutTokens { public static let newBreakpoint = "breakpoint-class" public static let newGridToken = "grid-configuration" }
Verification Steps
-
Build and test changes:
nocorrect swift build nocorrect swift test --filter DesignSystemTests -
Update documentation:
- Add doc comments to new public APIs
- Update component usage examples
- Verify imports work across targets