Skip to content

Commit

Permalink
Fix jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Sep 13, 2024
1 parent 3ac3941 commit d0420ae
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,39 @@
"componentDescription": "The tooltip positioner element.",
"propDescriptions": {
"alignment": {
"description": "The alignment of the tooltip popup element to the anchor element along its cross axis."
"description": "The alignment of the tooltip element to the anchor element along its cross axis."
},
"alignmentOffset": {
"description": "The offset of the tooltip popup element along its alignment axis."
"description": "The offset of the tooltip element along its alignment axis."
},
"anchor": { "description": "The element to which the tooltip popup element is anchored to." },
"anchor": { "description": "The element to which the tooltip element is anchored to." },
"arrowPadding": {
"description": "Determines the padding between the arrow and the tooltip popup edges. Useful when the tooltip popup element has rounded corners via <code>border-radius</code>."
"description": "Determines the padding between the arrow and the tooltip edges. Useful when the tooltip element has rounded corners via <code>border-radius</code>."
},
"className": {
"description": "Class names applied to the element or a function that returns them based on the component&#39;s state."
},
"collisionBoundary": {
"description": "The boundary that the tooltip popup element should be constrained to."
"description": "The boundary that the tooltip element should be constrained to."
},
"collisionPadding": {
"description": "The padding between the tooltip popup element and the edges of the collision boundary to add whitespace between them to prevent them from touching."
"description": "The padding between the tooltip element and the edges of the collision boundary to add whitespace between them to prevent them from touching."
},
"container": { "description": "The container element the tooltip positioner is appended to." },
"hideWhenDetached": {
"description": "Whether the tooltip popup element is hidden if it appears detached from its anchor element due to the anchor element being clipped (or hidden) from view."
"description": "Whether the tooltip element is hidden if it appears detached from its anchor element due to the anchor element being clipped (or hidden) from view."
},
"keepMounted": {
"description": "Whether the tooltip popup remains mounted in the DOM while closed."
"description": "Whether the tooltip remains mounted in the DOM while closed."
},
"positionStrategy": {
"description": "The CSS position strategy for positioning the tooltip popup element."
"description": "The CSS position strategy for positioning the tooltip element."
},
"render": { "description": "A function to customize rendering of the component." },
"side": {
"description": "The side of the anchor element that the tooltip popup element should be placed at."
},
"sideOffset": {
"description": "The gap between the anchor element and the tooltip popup element."
"description": "The side of the anchor element that the tooltip element should be placed at."
},
"sideOffset": { "description": "The gap between the anchor element and the tooltip element." },
"sticky": {
"description": "Whether to allow the tooltip to remain stuck in view while the anchor element is scrolled out of view."
}
Expand Down
24 changes: 12 additions & 12 deletions packages/mui-base/src/Tooltip/Positioner/TooltipPositioner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,26 @@ TooltipPositioner.propTypes /* remove-proptypes */ = {
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The alignment of the tooltip popup element to the anchor element along its cross axis.
* The alignment of the tooltip element to the anchor element along its cross axis.
* @default 'center'
*/
alignment: PropTypes.oneOf(['center', 'end', 'start']),
/**
* The offset of the tooltip popup element along its alignment axis.
* The offset of the tooltip element along its alignment axis.
* @default 0
*/
alignmentOffset: PropTypes.number,
/**
* The element to which the tooltip popup element is anchored to.
* The element to which the tooltip element is anchored to.
*/
anchor: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
HTMLElementType,
PropTypes.object,
PropTypes.func,
]),
/**
* Determines the padding between the arrow and the tooltip popup edges. Useful when the tooltip
* popup element has rounded corners via `border-radius`.
* Determines the padding between the arrow and the tooltip edges. Useful when the tooltip
* element has rounded corners via `border-radius`.
* @default 5
*/
arrowPadding: PropTypes.number,
Expand All @@ -168,7 +168,7 @@ TooltipPositioner.propTypes /* remove-proptypes */ = {
*/
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
/**
* The boundary that the tooltip popup element should be constrained to.
* The boundary that the tooltip element should be constrained to.
* @default 'clippingAncestors'
*/
collisionBoundary: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
Expand All @@ -183,7 +183,7 @@ TooltipPositioner.propTypes /* remove-proptypes */ = {
}),
]),
/**
* The padding between the tooltip popup element and the edges of the collision boundary to add
* The padding between the tooltip element and the edges of the collision boundary to add
* whitespace between them to prevent them from touching.
* @default 5
*/
Expand All @@ -204,18 +204,18 @@ TooltipPositioner.propTypes /* remove-proptypes */ = {
PropTypes.func,
]),
/**
* Whether the tooltip popup element is hidden if it appears detached from its anchor element due
* Whether the tooltip element is hidden if it appears detached from its anchor element due
* to the anchor element being clipped (or hidden) from view.
* @default false
*/
hideWhenDetached: PropTypes.bool,
/**
* Whether the tooltip popup remains mounted in the DOM while closed.
* Whether the tooltip remains mounted in the DOM while closed.
* @default false
*/
keepMounted: PropTypes.bool,
/**
* The CSS position strategy for positioning the tooltip popup element.
* The CSS position strategy for positioning the tooltip element.
* @default 'absolute'
*/
positionStrategy: PropTypes.oneOf(['absolute', 'fixed']),
Expand All @@ -224,12 +224,12 @@ TooltipPositioner.propTypes /* remove-proptypes */ = {
*/
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
/**
* The side of the anchor element that the tooltip popup element should be placed at.
* The side of the anchor element that the tooltip element should be placed at.
* @default 'top'
*/
side: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
/**
* The gap between the anchor element and the tooltip popup element.
* The gap between the anchor element and the tooltip element.
* @default 0
*/
sideOffset: PropTypes.number,
Expand Down
34 changes: 17 additions & 17 deletions packages/mui-base/src/Tooltip/Positioner/useTooltipPositioner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function useTooltipPositioner(
export namespace useTooltipPositioner {
export interface Parameters {
/**
* The element to which the tooltip popup element is anchored to.
* The element to which the tooltip element is anchored to.
*/
anchor?:
| Element
Expand All @@ -71,48 +71,48 @@ export namespace useTooltipPositioner {
| React.MutableRefObject<Element | null>
| (() => Element | VirtualElement | null);
/**
* Whether the tooltip popup is open.
* Whether the tooltip is open.
* @default false
*/
open?: boolean;
/**
* The CSS position strategy for positioning the tooltip popup element.
* The CSS position strategy for positioning the tooltip element.
* @default 'absolute'
*/
positionStrategy?: 'absolute' | 'fixed';
/**
* The side of the anchor element that the tooltip popup element should be placed at.
* The side of the anchor element that the tooltip element should be placed at.
* @default 'top'
*/
side?: 'top' | 'right' | 'bottom' | 'left';
/**
* The gap between the anchor element and the tooltip popup element.
* The gap between the anchor element and the tooltip element.
* @default 0
*/
sideOffset?: number;
/**
* The alignment of the tooltip popup element to the anchor element along its cross axis.
* The alignment of the tooltip element to the anchor element along its cross axis.
* @default 'center'
*/
alignment?: 'start' | 'end' | 'center';
/**
* The offset of the tooltip popup element along its alignment axis.
* The offset of the tooltip element along its alignment axis.
* @default 0
*/
alignmentOffset?: number;
/**
* The boundary that the tooltip popup element should be constrained to.
* The boundary that the tooltip element should be constrained to.
* @default 'clippingAncestors'
*/
collisionBoundary?: Boundary;
/**
* The padding between the tooltip popup element and the edges of the collision boundary to add
* The padding between the tooltip element and the edges of the collision boundary to add
* whitespace between them to prevent them from touching.
* @default 5
*/
collisionPadding?: Padding;
/**
* Whether the tooltip popup element is hidden if it appears detached from its anchor element due
* Whether the tooltip element is hidden if it appears detached from its anchor element due
* to the anchor element being clipped (or hidden) from view.
* @default false
*/
Expand All @@ -124,18 +124,18 @@ export namespace useTooltipPositioner {
*/
sticky?: boolean;
/**
* Determines the padding between the arrow and the tooltip popup edges. Useful when the tooltip
* popup element has rounded corners via `border-radius`.
* Determines the padding between the arrow and the tooltip edges. Useful when the tooltip
* element has rounded corners via `border-radius`.
* @default 5
*/
arrowPadding?: number;
/**
* Whether the tooltip popup remains mounted in the DOM while closed.
* Whether the tooltip remains mounted in the DOM while closed.
* @default false
*/
keepMounted?: boolean;
/**
* Whether the tooltip popup continuously tracks its anchor after the initial positioning upon
* Whether the tooltip continuously tracks its anchor after the initial positioning upon
* mount.
* @default true
*/
Expand Down Expand Up @@ -165,15 +165,15 @@ export namespace useTooltipPositioner {
*/
arrowUncentered: boolean;
/**
* Styles to apply to the popup arrow element.
* Styles to apply to the arrow element.
*/
arrowStyles: React.CSSProperties;
/**
* The rendered side of the tooltip popup element.
* The rendered side of the tooltip element.
*/
side: 'top' | 'right' | 'bottom' | 'left';
/**
* The rendered alignment of the tooltip popup element.
* The rendered alignment of the tooltip element.
*/
alignment: 'start' | 'end' | 'center';
}
Expand Down

0 comments on commit d0420ae

Please sign in to comment.