-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs-infra] Add support for data attributes in the API generation #44709
[docs-infra] Add support for data attributes in the API generation #44709
Conversation
Netlify deploy previewhttps://deploy-preview-44709--material-ui.netlify.app/ Bundle size report |
const attachCssVariables = (reactApi: ComponentReactApi, params: ParsedProperty[]) => { | ||
const cssVarsErrors: Array<[propName: string, error: Error]> = []; | ||
const cssVariables: ComponentReactApi['cssVariables'] = params | ||
const attachTable = ( |
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.
Repurposed the function to be used with any attribute
@@ -7,7 +7,7 @@ export interface Slot { | |||
default?: string; | |||
} | |||
|
|||
export interface CssVariable { | |||
export interface ApiItemDescription { |
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.
Made the name more generic to be reused with different types of API descriptions.
@@ -0,0 +1,13 @@ | |||
enum AccordionDataAttributes { | |||
/** | |||
* Indicates whether the panel is opened |
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.
* Indicates whether the panel is opened | |
* Indicates whether the panel is opened. |
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.
Side note, I was thinking of making a quick PR to fail the CI anytime any of those descriptions doesn't end with a dot. I suspect it's a quick win.
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.
I am reverting these changes, they are just here to help the reviewer :)
Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Signed-off-by: Marija Najdova <mnajdova@gmail.com>
Adds support for API generation for data-* attributes. It works identical to the CSS variables generation. I'll remove the test data after the approval.