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

Accordion Component #739

Closed
buseselvi opened this issue Nov 2, 2023 · 15 comments · Fixed by #818
Closed

Accordion Component #739

buseselvi opened this issue Nov 2, 2023 · 15 comments · Fixed by #818
Assignees
Labels
ADR-required An Architectural Design Record is needed for this issue released on @beta released
Milestone

Comments

@buseselvi
Copy link
Contributor

buseselvi commented Nov 2, 2023

Here is the design documentation link: https://www.figma.com/file/RrcLH0mWpIUy4vwuTlDeKN/Baklava-Design-Guide?type=design&node-id=15548%3A20910&mode=design&t=25ieOea9LEuP8Yzk-1

@buseselvi buseselvi self-assigned this Nov 2, 2023
@fatihhayri
Copy link
Contributor

@buseselvi, is the title any hover action?

@buseselvi
Copy link
Contributor Author

@fatihhayri yes, I added hover in the accordion list variant at the bottom of the document.

@fatihhayri
Copy link
Contributor

I made accordion component with native HTML element <details> and <summary>.

https://codepen.io/fatihhayri/pen/bGzYYWv?editors=1100

Note: name attribute only Chrome 120, Safari 17.2. support. (this time)

@buseselvi buseselvi removed their assignment Nov 29, 2023
@leventozen leventozen added this to the Q1/2024 milestone Dec 25, 2023
@leventozen leventozen added the ADR-required An Architectural Design Record is needed for this issue label Jan 29, 2024
@AykutSarac
Copy link
Member

@Enes5519 do we have progress on this issue?

@Enes5519
Copy link
Contributor

Enes5519 commented Feb 26, 2024

Figma Design Document

https://www.figma.com/file/RrcLH0mWpIUy4vwuTlDeKN/Baklava-Design-Guide?type=design&node-id=15548%3A20910&mode=design&t=25ieOea9LEuP8Yzk-1

General Usage Example

<!--   STANDALONE   -->
<bl-accordion caption="Deneme"> Merhaba </bl-accordion>

<!--   LIST VARIANT   -->
<bl-accordion-group>
  <bl-accordion caption="Deneme"> Merhaba </bl-accordion>

  <bl-accordion icon="eye_on" caption="Deneme"> Merhaba </bl-accordion>
</bl-accordion-group>

Rules

  • Accordion is a component that allows the user to show and hide sections of related content on a page.
  • The accordion component includes a free content area.
  • The caption can be set either via attribute or slot.
  • An icon can be added to the beginning of the caption.
  • Accordion can be disabled.
  • The accordion group component combines accordions and only allows one accordion to be open by default

API Reference

bl-accordion-group

Attribute Type Description Default Value
multiple boolean Allow multiple accordions to be open at once false

bl-accordion

Attribute Type Description Default Value
open boolean Whether the accordion is expanded false
caption string Sets accordion caption. null
icon string Add icon to beginning of the title null
disabled boolean Whether the accordion is expanded false

Slots

Slot Name Description
title Setting the accordion title as a slot disables the title attribute.
default Free content area

Events

Event Description
bl-toggle Triggered when the accordion expands or collapses

@AykutSarac
Copy link
Member

Great work, Enes! Here are some suggestions for the ADR:

  • The 'accordion' prefix is not needed for the event name bl-accordion-toggle.
  • I believe we can omit the variant for bl-accordion-group. In instances of standalone usage, there doesn't seem to be a need to enclose accordions within the accordion group. We can simply use bl-accordion-group for lists and bl-accordion for standalone scenarios.
  • The option to make an accordion either standalone or within a list may be marked as disabled, although this detail is not reflected in the Figma. We can explore this further during the design meeting with @buseselvi.
  • We could consider renaming auto-collapse to a shorter alternative like multiplefor simplicity.

@buseselvi
Copy link
Contributor Author

I added the disabled versions to the design guide. Thank you @AykutSarac 🙏🏻

@Enes5519
Copy link
Contributor

Enes5519 commented Mar 4, 2024

Thx for review @AykutSarac

  1. Done ✅
  2. I added it in case you want auto-collapse in your accordions and also want them to stand apart. We can change the name of the standalone variant if it creates confusion.
  3. Done ✅ (Thx @buseselvi )
  4. multiple does not explain what it does, I can update it if there is an alternative.

@AykutSarac
Copy link
Member

Thx for review @AykutSarac
2. I added it in case you want auto-collapse in your accordions and also want them to stand apart. We can change the name of the standalone variant if it creates confusion.
4. multiple does not explain what it does, I can update it if there is an alternative.

  1. I'm not sure if it makes sense to auto-collapse if they are standing apart, I mean they should be using the list in this case. So, I offered to use bl-accordion-group only for lists without the variant. We can discuss this further at the weekly update.
  2. Agreed, couldn't think of anything better. auto-collapse sounds ok.

@Enes5519
Copy link
Contributor

  1. Separate accordions will need to write their own for auto-collapse. We talked with @buseselvi, but we can also bring it to the weekly agenda.
  2. thx

@Enes5519
Copy link
Contributor

I updated it as we discussed at the weekly meeting.

  • Remove standalone variant from bl-accordion-group.

@Enes5519
Copy link
Contributor

Since auto-collapse is enabled by default, it is not possible to turn it off as an attribute, so I will change the name to keep-open. @buseselvi @AykutSarac

buseselvi pushed a commit that referenced this issue Apr 25, 2024
Closes #739

---------

Co-authored-by: Levent Anil Ozen <leventanilozen@gmail.com>
Co-authored-by: Enes Yıldırım <enes.yildirim@trendyol.com>
Co-authored-by: Erbil <erbilnas071@gmail.com>
Copy link

🎉 This issue has been resolved in version 3.0.0-beta.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented May 2, 2024

🎉 This issue has been resolved in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADR-required An Architectural Design Record is needed for this issue released on @beta released
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants