-
Notifications
You must be signed in to change notification settings - Fork 34
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
[Issue-126] :: Implement Disclosure component #168
base: master
Are you sure you want to change the base?
Conversation
Hi @NullVoxPopuli can you help me with the review for this PR |
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 some questions, overall very nice work!
sorry it took so long to review!
@@ -0,0 +1,14 @@ | |||
<div |
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.
do we need the wrapping div?
|
||
|
||
export default class Button extends Component { | ||
guid = `${guidFor(this)}-tailwindui-disclosure-button`; |
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.
can we use the guid helper instead of having a backing class?
template-only components are more performant
<Disclosure as |disclosure|> | ||
<span class='rounded-md shadow-sm'> | ||
<disclosure.Button | ||
@index={{1}} |
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.
we do we have index here? A consumer should never need to manage the index, yeah?
<button | ||
type='button' | ||
aria-haspopup={{true}} | ||
aria-controls={{if @isOpen this.itemsGuid}} |
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.
can we generate a single GUID in the parent component, just to reduce the number of repeat guid creations?
passing a guid (and then concatting suffixes) allows us to then also get rid of data-test-selectors (we don't want to ship these to consumers either, but that's a current problem all over the addon that we need to fix -- out of scope for this PR)
export default class Panel extends Component { | ||
panelGuid = `${guidFor(this)}-tailwindui-disclosure-panel`; | ||
|
||
@tracked isOpen = false; |
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.
why does this have its own isOpen state when the parent component also has isOpen?
In this PR, I have implemented the Disclosure component in ember similar to the react headless UI component
I have added the relevant tests for the component functionality as well
I have also added the component to the docs
Please find the screen shots of the implementation