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

feat: adding toggle text as an option for accordion component #1537

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

evilelam
Copy link
Collaborator

@evilelam evilelam commented Nov 27, 2024

  • Accordion: Added useToggleText prop to allow customization of the toggle element. When set to true, the default arrow will be replaced with "More" and "Less" text

  • Accordion.Trigger: Fixed a bug where the hoverBg prop was not being applied correctly

@evilelam evilelam self-assigned this Nov 27, 2024
@evilelam evilelam force-pushed the accordion-toggle-text-option branch from 68e9b80 to 94be876 Compare November 27, 2024 16:01
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.84%. Comparing base (f7eb2b3) to head (333e691).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/core/src/Flag/Flag.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1537      +/-   ##
==========================================
+ Coverage   93.74%   93.84%   +0.10%     
==========================================
  Files         154      154              
  Lines       11391    11408      +17     
  Branches      701      704       +3     
==========================================
+ Hits        10678    10706      +28     
+ Misses        692      680      -12     
- Partials       21       22       +1     

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

@evilelam evilelam force-pushed the accordion-toggle-text-option branch from 94be876 to bbf2cc8 Compare November 27, 2024 16:57
<Text.span textStyle='captionBold' color='primary.base' data-text-toggle='open'>
Less
</Text.span>
<Text.span textStyle='captionBold' color='primary.base' data-text-toggle='closed'>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the whole header is interactive, i don't think you need to include this 'data-text-toggle' stuff, it should just work anyway shouldn't it?
can you not just use the existing
&[data-state='closed/open'] { }
state in the css and target a class on this span, rather than having now 2 state for open/close?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'm using [data-state='closed/open'] to check if the accordion is open or closed, I added data-text-toggle just to keep track of which span should I show More/Less, but I can change it for a class, no problem

@evilelam evilelam force-pushed the accordion-toggle-text-option branch from bbf2cc8 to 333e691 Compare November 29, 2024 15:22
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.

3 participants