Update base components

This commit is contained in:
jeffvli
2022-10-24 21:56:58 -07:00
parent dfdf53f6ee
commit df3418120a
23 changed files with 614 additions and 328 deletions
@@ -1,9 +0,0 @@
.body {
padding: 5px;
color: var(--tooltip-text-color);
background: var(--tooltip-bg);
}
.arrow {
background: var(--tooltip-bg);
}
@@ -1,31 +0,0 @@
import { Tooltip as MantineTooltip, TooltipProps } from '@mantine/core';
export const Tooltip = ({ children, ...rest }: TooltipProps) => {
return (
<MantineTooltip
radius="xs"
styles={{
arrow: {
background: 'var(--tooltip-bg)',
},
root: {
background: 'var(--tooltip-bg)',
color: 'var(--tooltip-text-color)',
padding: '5px',
},
}}
{...rest}
>
{children}
</MantineTooltip>
);
};
Tooltip.defaultProps = {
openDelay: 0,
position: 'top',
transition: 'fade',
transitionDuration: 250,
withArrow: true,
withinPortal: true,
};
+31
View File
@@ -0,0 +1,31 @@
import styled from '@emotion/styled';
import { Tooltip as MantineTooltip, TooltipProps } from '@mantine/core';
const StyledTooltip = styled(MantineTooltip)`
& .mantine-Tooltip-arrow {
background: var(--tooltip-bg);
}
& .mantine-Tooltip-tooltip {
margin: 20px;
color: var(--tooltip-text-color);
background: var(--tooltip-bg);
}
`;
export const Tooltip = ({ children, ...rest }: TooltipProps) => {
return (
<StyledTooltip pl={10} pr={10} py={5} radius="xs" {...rest}>
{children}
</StyledTooltip>
);
};
Tooltip.defaultProps = {
openDelay: 0,
position: 'top',
transition: 'fade',
transitionDuration: 250,
withArrow: true,
withinPortal: true,
};