-
-
Notifications
You must be signed in to change notification settings - Fork 97
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] New API reference generator #1537
base: master
Are you sure you want to change the base?
Changes from 3 commits
0a24326
0565887
9b1e641
72d2050
42ccff0
d696318
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,16 @@ | |
"description": "Groups all parts of the accordion.\nRenders a `<div>` element.", | ||
"props": { | ||
"defaultValue": { | ||
"type": "array", | ||
"type": "Array", | ||
"description": "The uncontrolled value of the item(s) that should be initially expanded.\n\nTo render a controlled accordion, use the `value` prop instead." | ||
}, | ||
"value": { | ||
"type": "array", | ||
"type": "Array", | ||
"description": "The controlled value of the item(s) that should be expanded.\n\nTo render an uncontrolled accordion, use the `defaultValue` prop instead." | ||
}, | ||
"onValueChange": { | ||
"type": "(value) => void", | ||
"type": "((value: Array) => void) | undefined", | ||
"required": true, | ||
"description": "Event handler called when an accordion item is expanded or collapsed.\nProvides the new value as an argument." | ||
}, | ||
"hiddenUntilFound": { | ||
|
@@ -20,27 +21,31 @@ | |
"description": "Allows the browser’s built-in page search to find and expand the panel contents.\n\nOverrides the `keepMounted` prop and uses `hidden=\"until-found\"`\nto hide the element without removing it from the DOM." | ||
}, | ||
"openMultiple": { | ||
"type": "boolean", | ||
"type": "boolean | undefined", | ||
"default": "true", | ||
"required": true, | ||
"description": "Whether multiple items can be open at the same time." | ||
}, | ||
"disabled": { | ||
"type": "boolean", | ||
"type": "boolean | undefined", | ||
"default": "false", | ||
"required": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit strange. It says it's required, but we allow undefined as value. Is there a way to change the props that have default values not to be flagged as required? |
||
"description": "Whether the component should ignore user interaction." | ||
}, | ||
"loop": { | ||
"type": "boolean", | ||
"type": "boolean | undefined", | ||
"default": "true", | ||
"required": true, | ||
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys." | ||
}, | ||
"orientation": { | ||
"type": "'horizontal' | 'vertical'", | ||
"type": "\"horizontal\" | \"vertical\" | undefined", | ||
"default": "'vertical'", | ||
"required": true, | ||
"description": "The visual orientation of the accordion.\nControls whether roving focus uses left/right or up/down arrow keys." | ||
}, | ||
"className": { | ||
"type": "string | (state) => string", | ||
"type": "string | ((state: { value, disabled, orientation }) => string)", | ||
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state." | ||
}, | ||
"keepMounted": { | ||
|
@@ -49,7 +54,7 @@ | |
"description": "Whether to keep the element in the DOM while the panel is closed.\nThis prop is ignored when `hiddenUntilFound` is used." | ||
}, | ||
"render": { | ||
"type": "React.ReactElement | (props, state) => React.ReactElement", | ||
"type": "React.ReactElement | ((props: unknown, state: { value, disabled, orientation }) => React.ReactElement)", | ||
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render." | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ | |
"description": "A paragraph with additional information about the alert dialog.\nRenders a `<p>` element.", | ||
"props": { | ||
"className": { | ||
"type": "string | (state) => string", | ||
"type": "string | ((state: unknown) => string)", | ||
"description": "CSS class applied to the element, or a function that\nreturns a class based on the component’s state." | ||
}, | ||
"render": { | ||
"type": "React.ReactElement | (props, state) => React.ReactElement", | ||
"type": "React.ReactElement | ((props: unknown, state: unknown) => React.ReactElement)", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably need to specify the state & props for each component. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this doesn't look right. These aren't really the props of a component but attributes to be spread on the rendered HTML element. I'll try to display in a better way |
||
"description": "Allows you to replace the component’s HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render." | ||
} | ||
}, | ||
|
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 keep the previous logic for the @type info?
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.
Yes, the extractor doesn't handle the @type tag yet, but will soon.