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

Improved API for tabs by making brn an hostdirective of hlm #75

Closed
wants to merge 4 commits into from

Conversation

elite-benni
Copy link
Collaborator

@elite-benni elite-benni commented Dec 12, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Improved API

Which package are you modifying?

  • tabs

What is the current behavior?

You have to add brn and hlm directives to all the tabs components.

Closes #

What is the new behavior?

As we decided to make the hlm dependand on brn, we can simplify the api.

tabs

old:
<brn-tabs value="account">
new:
<div brnTabs value="account">

tabs-list

old:
<brn-tabs-list hlm>
new:
<div hlmTabsList>

tabs-trigger

The brn is a hostdirective of the hlm and does not need to be provided.
old:
<button hlmTabsTrigger brnTabsTrigger="account">
new:
<button hlmTabsTrigger="account">

tabs-content

Same as trigger.
old:
<div hlmTabsContent brnTabsContent="password">
new:
<div hlmTabsContent="password">

Does this PR introduce a breaking change?

  • Yes
  • No

You will get the following error for tabs-list, trigger and content:
Directive BrnTabsTriggerDirective matches multiple times on the same element. Directives can only match an element once.

In this case, brnTabsTrigger should be removed. See "new behavior part" of this PR.

Other information

We also added tests for brn-only to make sure @input of brn also still works correctly.

Copy link
Collaborator

@goetzrobin goetzrobin left a comment

Choose a reason for hiding this comment

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

Looks good overall! Left a couple suggestions & questions! Excited to improve another one!!

@elite-benni
Copy link
Collaborator Author

Thanks for feedback and improvement suggestions!
Changed the requested parts.

Copy link
Collaborator

@goetzrobin goetzrobin left a comment

Choose a reason for hiding this comment

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

Left a comment. Let me know what you think! Overall, really like this improvement! Excited for it to land!

</brn-tabs-list>
<div hlmTabsContent brnTabsContent="account">
<div brnTabs="account" class="mx-auto flex max-w-3xl flex-row space-x-2" orientation="vertical">
<div hlmTabsList hlm orientation="vertical" aria-label="tabs example">
Copy link
Collaborator

Choose a reason for hiding this comment

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

How do you feel about turning this into ?
I think that would be even cleaner!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh sorry I did not see your comment.
What do you mean by "turning into ?"

@elite-benni
Copy link
Collaborator Author

Moved to branch

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