Skip to content

Commit

Permalink
Merge pull request #2583 from contentful/homer-2272-5
Browse files Browse the repository at this point in the history
fix(Tooltip): Fix Tooltip type issues
  • Loading branch information
miguelcrespo authored Sep 19, 2023
2 parents 474010c + 47d75ab commit 6832612
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-penguins-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@contentful/f36-tooltip': minor
---

Fix: Make content optional again
2 changes: 1 addition & 1 deletion packages/components/avatar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/f36-avatar",
"version": "4.0.0-alpha.8",
"version": "4.0.0-alpha.10",
"description": "Forma 36: Avatar component",
"scripts": {
"build": "tsup"
Expand Down
38 changes: 14 additions & 24 deletions packages/components/tooltip/src/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,16 @@ import { getStyles } from './Tooltip.styles';

export type TooltipPlacement = Placement;

export type WithEnhancedContent =
| {
/**
* Content of the tooltip
*/
content: ReactElement;
/**
* Accesible label property, only required when using ReactElement as content
*/
label: string;
}
| {
/**
* Content of the tooltip
*/
content: string;
/**
* Accesible label property, only required when using ReactElement as content
*/
label?: string;
};
export type WithEnhancedContent = {
/**
* Content of the tooltip
*/
content?: ReactElement | string;
/**
* Accesible label property, only required when using ReactElement as content
*/
label?: string;
};

export type TooltipInternalProps = {
/**
Expand Down Expand Up @@ -115,9 +104,10 @@ export type TooltipInternalProps = {
isDisabled?: boolean;
};

export type TooltipProps = CommonProps &
TooltipInternalProps &
WithEnhancedContent;
export interface TooltipProps
extends CommonProps,
TooltipInternalProps,
WithEnhancedContent {}

export const Tooltip = ({
children,
Expand Down

1 comment on commit 6832612

@vercel
Copy link

@vercel vercel bot commented on 6832612 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.