2019-10-18 06:38:10 +00:00
|
|
|
import React from "react";
|
|
|
|
import { storiesOf } from "@storybook/react";
|
2020-02-07 12:21:11 +00:00
|
|
|
import { withKnobs, number } from "@storybook/addon-knobs/react";
|
2019-10-18 06:38:10 +00:00
|
|
|
import withReadme from "storybook-readme/with-readme";
|
|
|
|
import Readme from "./README.md";
|
|
|
|
import HelpButton from ".";
|
|
|
|
import Section from "../../../.storybook/decorators/section";
|
2019-12-04 09:36:13 +00:00
|
|
|
import Text from "../text";
|
2019-10-18 12:13:08 +00:00
|
|
|
import Link from "../link";
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
|
|
|
const IconButtons = styled.div`
|
|
|
|
margin-top: 150px;
|
|
|
|
margin-left: 70px;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.icon-button {
|
|
|
|
margin-left: 10px;
|
|
|
|
}
|
|
|
|
`;
|
2019-10-18 06:38:10 +00:00
|
|
|
|
|
|
|
storiesOf("Components|Buttons", module)
|
|
|
|
.addDecorator(withKnobs)
|
|
|
|
.addDecorator(withReadme(Readme))
|
|
|
|
.add("help button", () => {
|
|
|
|
return (
|
|
|
|
<Section>
|
2019-10-18 12:13:08 +00:00
|
|
|
<IconButtons>
|
|
|
|
<HelpButton
|
2019-11-20 06:13:04 +00:00
|
|
|
displayType="dropdown"
|
2020-02-07 12:21:11 +00:00
|
|
|
offsetTop={number("offsetTop", 0)}
|
|
|
|
offsetRight={number("offsetRight", 0)}
|
|
|
|
offsetBottom={number("offsetBottom", 0)}
|
|
|
|
offsetLeft={number("offsetLeft", 0)}
|
2019-10-18 12:13:08 +00:00
|
|
|
tooltipContent={
|
2020-10-16 13:16:01 +00:00
|
|
|
<Text fontSize="13px">Paste you tooltip content here</Text>
|
2019-10-18 12:13:08 +00:00
|
|
|
}
|
|
|
|
/>
|
|
|
|
<HelpButton
|
2019-11-20 06:13:04 +00:00
|
|
|
displayType="aside"
|
2019-11-25 09:00:40 +00:00
|
|
|
helpButtonHeaderContent="Aside position HelpButton"
|
2019-10-18 12:13:08 +00:00
|
|
|
tooltipContent={
|
2019-12-04 09:36:13 +00:00
|
|
|
<Text>
|
2019-10-18 12:13:08 +00:00
|
|
|
You tooltip content with{" "}
|
|
|
|
<Link
|
|
|
|
isHovered={true}
|
|
|
|
href="http://localhost:6006/?path=/story/components-buttons--help-button"
|
|
|
|
>
|
|
|
|
link
|
|
|
|
</Link>
|
2019-12-04 09:36:13 +00:00
|
|
|
</Text>
|
2019-10-18 12:13:08 +00:00
|
|
|
}
|
|
|
|
/>
|
|
|
|
<HelpButton
|
2019-11-20 06:13:04 +00:00
|
|
|
displayType="auto"
|
2019-11-25 09:00:40 +00:00
|
|
|
helpButtonHeaderContent="Auto position HelpButton"
|
2019-10-18 12:13:08 +00:00
|
|
|
tooltipContent={
|
|
|
|
<>
|
|
|
|
<p>You can put every thing here</p>
|
2019-11-20 06:13:04 +00:00
|
|
|
<ul style={{ marginBottom: 0 }}>
|
2019-10-18 12:13:08 +00:00
|
|
|
<li>Word</li>
|
|
|
|
<li>Chart</li>
|
|
|
|
<li>Else</li>
|
|
|
|
</ul>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</IconButtons>
|
2019-10-18 06:38:10 +00:00
|
|
|
</Section>
|
|
|
|
);
|
|
|
|
});
|