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 { Story, Meta } from "@storybook/react";
import { TooltipProps } from "../components/Tooltip";
import {
directionsValues,
directionsValuesLabels
} from "../../storybookHelpers/controlConstants";
const tooltipStoryDecorator = storyFn => (
{storyFn()}
);
export default {
title: "Overlays/Tooltip",
component: Tooltip,
decorators: [
tooltipStoryDecorator,
Story => {Story()}
],
argTypes: {
preferredDirections: {
options: directionsValues,
mapping: directionsValuesLabels
},
className: {
control: { disable: true }
},
trigger: {
control: { disable: true }
},
ariaLabel: {
control: { disable: true }
},
"data-cy": {
control: { disable: true }
}
}
} as Meta;
const Template: Story = args => (
Tooltip Content
);
export const Default = Template.bind({});
export const MountedInsideDropdown = args => (
Tooltip Content
}
>
Dropdown Trigger
);
export const DefaultMaxWidth = 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 = args => (
<>
content that is greater than 100px
content
>
);
export const ContentWidth = args => (
sometimes I may want my tooltip to take up as much width as the content
needs without having the default maxWidth
);