-
Notifications
You must be signed in to change notification settings - Fork 174
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
Conversation
There was a problem hiding this 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!!
apps/app/src/app/pages/(components)/components/(tabs)/tabs--vertical.preview.ts
Outdated
Show resolved
Hide resolved
apps/app/src/app/pages/(components)/components/(tabs)/tabs.preview.ts
Outdated
Show resolved
Hide resolved
apps/app/src/app/pages/(components)/components/(tabs)/tabs.preview.ts
Outdated
Show resolved
Hide resolved
Thanks for feedback and improvement suggestions! |
There was a problem hiding this 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"> |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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 ?"
….component is a directive
Moved to branch |
PR Checklist
Please check if your PR fulfills the following requirements:
guidelines: https://github.com/goetzrobin/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
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?
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.