Skip to content

Commit

Permalink
[docs] Refine common props descriptions (#1045)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmoroz authored Dec 11, 2024
1 parent 01aa994 commit 3d74e52
Show file tree
Hide file tree
Showing 282 changed files with 1,737 additions and 1,071 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ const Checkbox = React.forwardRef(function Checkbox(props, ref) {

Checkbox.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -118,7 +119,8 @@ const Indicator = React.forwardRef(function Indicator(props, ref) {

Indicator.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const Checkbox = React.forwardRef(function Checkbox(props, ref) {

Checkbox.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -90,7 +91,8 @@ const Indicator = React.forwardRef(function Indicator(props, ref) {

Indicator.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ const NumberFieldGroup = React.forwardRef(function NumberFieldGroup(props, ref)

NumberFieldGroup.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -110,7 +111,8 @@ const NumberFieldScrubArea = React.forwardRef(

NumberFieldScrubArea.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -136,7 +138,8 @@ const NumberFieldVirtualCursor = React.forwardRef(

NumberFieldVirtualCursor.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down Expand Up @@ -168,7 +171,8 @@ const NumberFieldInput = React.forwardRef(function NumberFieldInput(props, ref)

NumberFieldInput.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down Expand Up @@ -211,7 +215,8 @@ const NumberFieldDecrement = React.forwardRef(

NumberFieldDecrement.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down Expand Up @@ -239,7 +244,8 @@ const NumberFieldIncrement = React.forwardRef(

NumberFieldIncrement.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const Progress = React.forwardRef(function Progress(props, ref) {

Progress.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -62,7 +63,8 @@ const ProgressTrack = React.forwardRef(function ProgressTrack(props, ref) {

ProgressTrack.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -86,7 +88,8 @@ const ProgressIndicator = React.forwardRef(function ProgressIndicator(props, ref

ProgressIndicator.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ const Slider = React.forwardRef(function Slider(props, ref) {

Slider.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -81,7 +82,8 @@ const SliderOutput = React.forwardRef(function SliderOutput(props, ref) {

SliderOutput.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -106,7 +108,8 @@ const SliderControl = React.forwardRef(function SliderControl(props, ref) {

SliderControl.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -130,7 +133,8 @@ const SliderTrack = React.forwardRef(function SliderTrack(props, ref) {

SliderTrack.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -156,7 +160,8 @@ const SliderThumb = React.forwardRef(function SliderThumb(props, ref) {

SliderThumb.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -180,7 +185,8 @@ const SliderIndicator = React.forwardRef(function SliderIndicator(props, ref) {

SliderIndicator.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ const TabsList = React.forwardRef((props, ref) => {

TabsList.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand Down Expand Up @@ -75,7 +76,8 @@ const Tab = React.forwardRef((props, ref) => {

Tab.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
Expand All @@ -96,7 +98,8 @@ const TabPanel = React.forwardRef((props, ref) => {

TabPanel.propTypes = {
/**
* Class names applied to the element or a function that returns them based on the component's state.
* CSS class applied to the element, or a function that
* returns a class based on the component’s state.
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};
4 changes: 2 additions & 2 deletions docs/reference/generated/accordion-header.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"props": {
"className": {
"type": "string | (state) => string",
"description": "Class names applied to the element or a function that returns them based on the component's state."
"description": "CSS class applied to the element, or a function that\nreturns a class based on the components state."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "A function to customize rendering of the component."
"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."
}
},
"dataAttributes": {
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/generated/accordion-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"props": {
"className": {
"type": "string | (state) => string",
"description": "Class names applied to the element or a function that returns them based on the component's state."
"description": "CSS class applied to the element, or a function that\nreturns a class based on the components state."
},
"disabled": {
"type": "boolean",
"default": "false",
"description": "If `true`, the component is disabled."
"description": "Whether the component should ignore user actions."
},
"onOpenChange": {
"type": "(open) => void",
"description": "Callback fired when the Collapsible is opened or closed."
"description": "Event handler called when the panel is opened or closed."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "A function to customize rendering of the component."
"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."
}
},
"dataAttributes": {
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/generated/accordion-panel.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
"props": {
"className": {
"type": "string | (state) => string",
"description": "Class names applied to the element or a function that returns them based on the component's state."
"description": "CSS class applied to the element, or a function that\nreturns a class based on the components state."
},
"hiddenUntilFound": {
"type": "boolean",
"default": "false",
"description": "If `true`, sets `hidden=\"until-found\"` when closed. Accordion panels\nwill remain mounted in the DOM when closed and overrides `keepMounted`.\nIf `false`, sets `hidden` when closed."
"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."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "If `true`, accordion panels remains mounted when closed and is instead\nhidden using the `hidden` attribute.\nIf `false`, accordion panels are unmounted when closed."
"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",
"description": "A function to customize rendering of the component."
"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."
}
},
"dataAttributes": {
Expand Down
22 changes: 11 additions & 11 deletions docs/reference/generated/accordion-root.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@
"props": {
"className": {
"type": "string | (state) => string",
"description": "Class names applied to the element or a function that returns them based on the component's state."
"description": "CSS class applied to the element, or a function that\nreturns a class based on the components state."
},
"defaultValue": {
"type": "array",
"description": "The default value representing the currently open `Accordion.Item`\nThis is the uncontrolled counterpart of `value`."
"description": "The uncontrolled value of the item(s) that should be expanded.\nTo render a controlled accordion, use the `value` prop instead."
},
"disabled": {
"type": "boolean",
"default": "false",
"description": "If `true`, the component is disabled."
"description": "Whether the component should ignore user actions."
},
"hiddenUntilFound": {
"type": "boolean",
"default": "false",
"description": "If `true`, sets `hidden=\"until-found\"` when closed. Accordion panels\nwill remain mounted in the DOM when closed and overrides `keepMounted`.\nIf `false`, sets `hidden` when closed."
"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."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "If `true`, accordion panels remains mounted when closed and is instead\nhidden using the `hidden` attribute.\nIf `false`, accordion panels are unmounted when closed."
"description": "Whether to keep the element in the DOM while the panel is closed.\nThis prop is ignored when `hiddenUntilFound` is used."
},
"loop": {
"type": "boolean",
"default": "true",
"description": "If `true`, focus will loop when moving focus between `Trigger`s using\nthe arrow keys."
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys."
},
"onValueChange": {
"type": "(value) => void",
"description": "Callback fired when an Accordion section is opened or closed.\nThe value representing the involved section is provided as an argument."
"description": "Event handler called when an accordion item is expanded or collapsed.\nProvides the new value as an argument."
},
"openMultiple": {
"type": "boolean",
"default": "true",
"description": "Whether multiple Accordion sections can be opened at the same time."
"description": "Whether multiple items can be open at the same time."
},
"orientation": {
"type": "'horizontal' | 'vertical'",
"default": "'vertical'",
"description": "The orientation of the accordion."
"description": "The visual orientation of the accordion.\nControls whether the roving focus uses left/right or up/down arrow keys."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "A function to customize rendering of the component."
"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."
},
"value": {
"type": "array",
"description": "The value of the currently open `Accordion.Item`\nThis is the controlled counterpart of `defaultValue`."
"description": "The controlled value of the item(s) that should be expanded.\nTo render an controlled accordion, use the `defaultValue` prop instead."
}
},
"dataAttributes": {
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/generated/accordion-trigger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"props": {
"className": {
"type": "string | (state) => string",
"description": "Class names applied to the element or a function that returns them based on the component's state."
"description": "CSS class applied to the element, or a function that\nreturns a class based on the components state."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "A function to customize rendering of the component."
"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."
}
},
"dataAttributes": {
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/generated/alert-dialog-backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"props": {
"className": {
"type": "string | (state) => string",
"description": "Class names applied to the element or a function that returns them based on the component's state."
"description": "CSS class applied to the element, or a function that\nreturns a class based on the components state."
},
"keepMounted": {
"type": "boolean",
"default": "false",
"description": "If `true`, the backdrop element is kept in the DOM when closed."
"description": "Whether to keep the element in the DOM while the alert dialog is hidden."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "A function to customize rendering of the component."
"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."
}
},
"dataAttributes": {
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/generated/alert-dialog-close.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"props": {
"className": {
"type": "string | (state) => string",
"description": "Class names applied to the element or a function that returns them based on the component's state."
"description": "CSS class applied to the element, or a function that\nreturns a class based on the components state."
},
"render": {
"type": "React.ReactElement | (props, state) => React.ReactElement",
"description": "A function to customize rendering of the component."
"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."
}
}
}
Loading

0 comments on commit 3d74e52

Please sign in to comment.