mirror of
https://github.com/luxfi/dao.git
synced 2026-07-27 02:51:24 +00:00
4.1 KiB
4.1 KiB
UI Library Extraction Plan
✅ Completed
-
Created package structure (
@luxdao/ui)- Set up package.json with proper dependencies
- Created TypeScript configuration
- Added README with usage instructions
-
Extracted theme system
- Copied theme files from app (colors, breakpoints, text styles, components)
- Created luxTheme export for ChakraProvider
-
Started component extraction
- Extracted Badge component (renamed from DAO references)
- Extracted Tooltip component (renamed from DAOTooltip to Tooltip)
- Set up proper exports structure
🔄 In Progress
Replacing "DAO" References
Components that need renaming:
DAOLogo→LogoDAOSignature→SignatureDAOHourGlass→HourGlassDAOTooltip→Tooltip✅useDAOModal→useModalDAOModule→Module(type)
Component Extraction Priority
-
Basic UI Elements (High Priority)
- ✅ Badge
- ✅ Tooltip
- Card
- ContentBox
- InfoBox
- Divider
- ProgressBar
-
Form Components (High Priority)
- AddressInput (EthAddressInput)
- BigIntInput
- DatePicker
- LabelWrapper
- InputComponent
- NumberStepperInput
-
Navigation & Layout (Medium Priority)
- Breadcrumbs
- NavigationLink
- PageHeader
- Footer
-
Loaders & Feedback (Medium Priority)
- BarLoader
- CircleLoader
- InfoBoxLoader
- AlertBanner
-
Utility Components (Medium Priority)
- AddressCopier
- DisplayAddress
- ExternalLink
- EtherscanLink
-
Complex Components (Low Priority - May need refactoring)
- Modals (ModalBase, ModalProvider, useModal hook)
- Menus (DropdownMenu, OptionMenu)
- Complex forms (requires removing app-specific logic)
📋 Next Steps
-
Continue extracting components
- Focus on components with minimal dependencies first
- Remove app-specific imports (types, hooks, stores)
- Make components more generic and reusable
-
Handle translations
- Either remove i18n dependencies or make them optional
- Consider passing labels as props instead
-
Add Storybook stories
- Create stories for each extracted component
- Document component props and usage
-
Build and test
- Set up build process with tsup
- Test the package can be imported correctly
- Add unit tests for components
-
Update app to use @luxdao/ui
- Replace local component imports with package imports
- Ensure backward compatibility
🚧 Challenges to Address
-
Type Dependencies
- Many components depend on app-specific types
- Need to either extract shared types or make components more generic
-
Hook Dependencies
- Components use app-specific hooks
- Need to either extract hooks or refactor components
-
Translation System
- Components use react-i18next
- Consider making translations optional or prop-based
-
Store Dependencies
- Some components access app stores directly
- Need to refactor to accept props instead
📦 Package Structure
packages/ui/
├── src/
│ ├── components/
│ │ ├── badges/ ✅
│ │ ├── cards/ 🔄
│ │ ├── containers/ 🔄
│ │ ├── forms/ 🔄
│ │ ├── layout/ 🔄
│ │ ├── loaders/ 🔄
│ │ ├── modals/ 🔄
│ │ └── utils/ ✅
│ ├── theme/ ✅
│ ├── hooks/ 🔄
│ ├── utils/ 🔄
│ └── index.ts ✅
├── package.json ✅
├── tsconfig.json ✅
├── README.md ✅
└── .gitignore ✅
🎯 Success Criteria
- All basic UI components extracted and working
- No "DAO" references remain (only "Lux" or generic names)
- Package builds successfully
- Package can be imported in the app
- Storybook documentation available
- Tests passing
- App successfully uses @luxdao/ui package