Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component Library Updates and Enhancements #3

Merged
merged 17 commits into from
Jan 26, 2025

Conversation

Nittarab
Copy link
Owner

@Nittarab Nittarab commented Jan 23, 2025

This PR introduces several updates and enhancements to the component library, focusing on improved functionality, testing, and documentation. Key changes include:

  • Added icon support for buttons with icon_start and icon_end parameters
  • Updated DropdownComponent with new position, hover, and trigger configurations
  • Enhanced SwapComponent with states, value, and effect attributes
  • Improved AccordionComponent with html_attributes handling
  • Updated AvatarComponent with size, shape, and status validation
  • Added AvatarGroupComponent for grouped avatar display
  • Enhanced CardComponent with new attributes and rendering logic
  • Added coverage reporting and parsing functionality
  • Updated tests for all components to include new features and HTML attributes handling
  • Improved Lookbook previews with playground methods and detailed documentation

Refactors the CardComponent to support a simpler, more direct API while
maintaining backwards compatibility:

- Add direct props for title, description, button_text, button_class,
and image_url
- Auto-render figure and body components when props are provided
- Delegate props from card to nested components
- Update tests to cover new functionality
- Simplify preview examples using new direct props
- Maintain slot-based API as override option

This change reduces boilerplate while keeping the flexibility of the
slot-based API.
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 98.61687% with 10 lines in your changes missing coverage. Please review.

Project coverage is 99.34%. Comparing base (8d2f2d6) to head (aac237c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...isy_components/actions/button_component_preview.rb 83.87% 5 Missing ⚠️
...omponents/data_display/avatar_component_preview.rb 81.81% 2 Missing ⚠️
..._components/data_display/avatar_group_component.rb 97.14% 1 Missing ⚠️
...ts/daisy_components/actions/swap_component_test.rb 99.23% 1 Missing ⚠️
...y_components/actions/dropdown_component_preview.rb 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main       #3      +/-   ##
===========================================
- Coverage   100.00%   99.34%   -0.66%     
===========================================
  Files           15       35      +20     
  Lines          284     1516    +1232     
  Branches        24       59      +35     
===========================================
+ Hits           284     1506    +1222     
- Misses           0       10      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

fix avatar html

Improve placeholder
Fix component

Improve test

Improvements
Fix Dropdown component
- Added `html_attributes` method to components for better handling of
HTML attributes
- Updated components to use `tag.div(**html_attributes)` pattern
- Added tests for HTML attributes handling in:
  - AccordionComponent
  - AccordionItemComponent
  - AvatarComponent
  - AvatarGroupComponent
  - BadgeComponent
  - CardComponent
  - Card::ActionsComponent
- Added coverage report parsing script
- Added development dependencies for coverage reporting
@Nittarab Nittarab marked this pull request as ready for review January 26, 2025 18:25
@Nittarab Nittarab merged commit 00efb91 into main Jan 26, 2025
2 of 4 checks passed
@Nittarab Nittarab deleted the improve-card-component-apis branch January 26, 2025 18:27
@Nittarab Nittarab changed the title Improve components apis Component Library Updates and Enhancements Jan 26, 2025
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