Skip to content

Refactor UI components to support multiple design themes#4

Open
GeneralJerel wants to merge 2 commits intomainfrom
claude/add-shadcn-luma-1Iyw9
Open

Refactor UI components to support multiple design themes#4
GeneralJerel wants to merge 2 commits intomainfrom
claude/add-shadcn-luma-1Iyw9

Conversation

@GeneralJerel
Copy link
Copy Markdown
Collaborator

Summary

This PR refactors the UI component library to support multiple design themes (default and luma) through a style context system. Components are now organized into theme-specific directories with a unified interface layer that dynamically selects the appropriate implementation based on the active theme.

Key Changes

  • Theme Architecture: Created ui-default/ and ui-luma/ directories containing theme-specific component implementations
  • Style Context System: Added style-context.tsx to manage theme selection and provide a useStyle() hook for accessing the active theme
  • Component Refactoring: Converted 80+ UI components from direct implementations to context-aware wrappers that delegate to theme-specific versions
  • Sidebar Component: Added comprehensive sidebar component with collapsible state management, mobile responsiveness, and keyboard shortcuts
  • Chart Components: Added chart components with theme-aware color configuration supporting both light and dark modes
  • Consistent Imports: Updated component imports to use relative paths within theme directories while maintaining backward compatibility through the main ui/ layer

Implementation Details

  • Components in ui/ now use useStyle() hook to determine which theme implementation to render
  • Theme-specific components maintain their original implementations with minimal modifications
  • The refactoring maintains the same public API, ensuring no breaking changes for consumers
  • Added support for dynamic theme switching at runtime through the style context
  • All components properly handle both "default" and "luma" theme variants

Files Modified

  • 80+ UI component files refactored to support theme switching
  • New theme-specific directories created with complete component implementations
  • Style context system added for centralized theme management

https://claude.ai/code/session_01HFKFcR8tEaXjvTVe3XVC3c

claude added 2 commits April 1, 2026 12:26
Add support for the new shadcn/ui v4 "radix-luma" style alongside the
existing "new-york" style, with a runtime toggle in the app header.

Architecture:
- ui-default/: current "new-york" style components (moved from ui/)
- ui-luma/: new "luma" style components (fetched from upstream)
- ui/: proxy layer that switches between styles via React context
- StyleProvider + useStyle hook for runtime style switching

The Luma style features pill-shaped corners (rounded-4xl), filled inputs,
soft destructive variants, press animations, and ring-based card borders.

https://claude.ai/code/session_01HFKFcR8tEaXjvTVe3XVC3c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants