Skip to content
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

Fix min width on tooltip #51

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openstax/ui-components",
"version": "1.10.3",
"version": "1.10.5",
"license": "MIT",
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
Expand Down
7 changes: 3 additions & 4 deletions src/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const tooltipStyles = `
/* fixes FF gap */
transform: translate3d(0, 0, 0);
position: absolute;
min-width: 24rem;
z-index: 1000;

&[data-placement=top] {
Expand Down Expand Up @@ -61,7 +60,7 @@ const tooltipStyles = `
export const StyledTooltip = styled(AriaTooltip)`${tooltipStyles}`;

const StyledCustomTooltip = styled.div`
${tooltipStyles}
${tooltipStyles}
`;

export const StyledTrigger = styled(Button)`
Expand All @@ -78,7 +77,7 @@ type TooltipProps = {
isOpen?: boolean;
};

export const Tooltip = ({children, placement, icon, ...props}: React.PropsWithChildren<TooltipProps>) =>
export const Tooltip = ({children, placement, icon, ...props}: React.PropsWithChildren<TooltipProps>) =>
<StyledTooltip {...props} placement={placement}>
<OverlayArrow>
<svg width={8} height={8} viewBox="0 0 8 8">
Expand Down Expand Up @@ -112,4 +111,4 @@ export const CustomTooltip = ({ state, ...props }: any) => {
</OverlayArrow>
</StyledCustomTooltip>
);
}
}
2 changes: 1 addition & 1 deletion src/components/__snapshots__/Tooltip.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Array [
data-overlay-container={true}
>
<div
className="sc-bczRLJ dvhbKn"
className="sc-bczRLJ BxtqR"
data-rac=""
id="react-aria-1"
onMouseEnter={[Function]}
Expand Down
Loading