-
Notifications
You must be signed in to change notification settings - Fork 601
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
feat: add slot event part docs to foundation #5912
feat: add slot event part docs to foundation #5912
Conversation
3eab1f3
to
33ebe47
Compare
@scomea are you able to add this context for data-grid once this PR goes in? I'm did not feel familiar enough with the code to address everything. |
* @slot end - Content which can be provided between the start slot and icon | ||
* @slot heading - Content which serves as the accordion item heading and text of the expand button | ||
* @slot - The default slot for accordion item content | ||
* @slot - expanded-icon - The expanded icon |
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.
The analyzer uses the hyphen as the separator between the name and the description. These hyphens between @slot and the name should be removed.
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.
Yeah, I did almost all of these manually, I'll do one last check for any time it's not the default slot.
* @csspart input-container - The element representing the visual checked or radio indicator | ||
* @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator | ||
* @csspart radio - The element wrapping the `menuitemradio` indicator | ||
* @scspart content - The element wrapping the menu item content |
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.
Typo. Should be "@csspart".
Wow, thanks Chris! I'm so happy we're finally able to get these flags in. One thing that catches my eye here is that it documents the foundation components as if they are a single component, template and class, where in this package those two are never actually combined. For example, the ES6 class conceptually never has css parts or slots because those are template concerns. I don't know if we should change anything now because we would likely need to adjust the CEM code, but to me it would make more sense if the class and templates are both documented w/ their respective TSDoc flags. Any thoughts on that? We can take to an issue if needed. |
I fired this off without much investigation after a few conversations with @williamw2, so I have zero thoughts. Totally open, just going by the initial convention shared. I’ll default to him :) |
@nicholasrice I don't think that's going to work. The problem is in how we declare the templates as a const function that returns a template. The CEM analyzer sees it as just a function and seems to ignore any jsdoc tags that don't apply to functions. Then the markdown generator simply renders it in a "function" table with just a name and description. I'm currently manually excluding the template functions from the markdown output as they didn't seem useful. The plan is to eventually replace the CEM markdown generation with a custom solution. Maybe we can try to address this then. |
dd16f5b
to
0b64722
Compare
* Add custom tags to tsdoc * PR feedback
0b64722
to
490e6ee
Compare
Pull Request
📖 Description
This PR does an initial pass to add jsdocs to enable support for slots, events, and parts in the CEM analyzer.
Two components have some gaps due to how composable they are - Calendar and Data Grid.
🎫 Issues
closes #5904
👩💻 Reviewer Notes
📑 Test Plan
✅ Checklist
General
$ yarn change
Component-specific
⏭ Next Steps