import * as React from "react";
import { Tooltip } from "../../index";
import Dropdownable, {
Direction
} from "../../dropdownable/components/Dropdownable";
import { Box } from "../../styleUtils/modifiers";
import { Card } from "../../card";
import { StoryFn, Meta } from "@storybook/react";
import { TooltipProps } from "../components/Tooltip";
import {
directionsValues,
directionsValuesLabels
} from "../../storybookHelpers/controlConstants";
import TooltipIcon from "../components/TooltipIcon";
const tooltipStoryDecorator = storyFn => (
{storyFn()}
);
export default {
title: "Overlays/Tooltip",
component: Tooltip,
decorators: [
tooltipStoryDecorator,
Story => {Story()}
],
argTypes: {
preferredDirections: {
options: directionsValues,
mapping: directionsValuesLabels
}
}
} as Meta;
const Template: StoryFn = args => (
Tooltip Content
);
export const Default = {
render: Template,
args: { trigger: "Hover Me" }
};
export const MountedInsideDropdown = {
render: args => (
Tooltip Content
}
>
Dropdown Trigger
)
};
export const DefaultMaxWidth = {
render: args => (
since my content is wider than 300px, it will wrap so that tooltip does
not exceed a width of 300px by default
)
};
export const MinOrMaxWidth = {
render: args => (
<>
content that is greater than 100px
content
>
)
};
export const ContentWidth = {
render: args => (
sometimes I may want my tooltip to take up as much width as the content
needs without having the default maxWidth
)
};
export const WithTooltipIcon = {
render: Template,
args: { trigger: }
};