goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.22k stars 133 forks source link

refactor(accordion): new helm api #127

Closed thatsamsonkid closed 7 months ago

thatsamsonkid commented 7 months ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Which package are you modifying?

What is the current behavior?

Current hlm accordion api is this

<div hlmAccordion>
    <div hlmAccordionItem>
          <button hlmAccordionTrigger>
            Is it accessible?
            <hlm-icon hlmAccIcon />
          </button>
          <brn-accordion-content hlm>
             Yes. It adheres to the WAI-ARIA design pattern.
          </brn-accordion-content>
      </div>
     ...
</div>

What is the new behavior?

This PR simply expands on the above to provide a slightly simpler hlm api with the option to do something like the below. Looks a little cleaner and a little more consistent from a selector/tag perspective. But you can still continue to do either implementation depending on preference or use case

<hlm-accordion>
      <hlm-accordion-item>
        <button hlmAccordionTrigger>
          Is it accessible?
          <hlm-icon hlmAccIcon />
        </button>
        <hlm-accordion-content>
          Yes. It adheres to the WAI-ARIA design pattern.
        </hlm-accordion-content>
      </hlm-accordion-item>
     ...
</hlm-accordion>

Does this PR introduce a breaking change?

Other information

thatsamsonkid commented 7 months ago

Oh no, you know I thought I remembered having kept that selector for hlm-accordion-item.directive. Shoot do we want to add it back? @goetzrobin @elite-benni I really meant to keep it none breaking

goetzrobin commented 7 months ago

Haha all good! Let's add it back! Nothing's released yet 😃

elite-benni commented 7 months ago

Its already merged and we are in alpha ;) We do many breaking changes, while reworking the api. I don't think it is a problem, just wanted to point out that it is a breaking change.