2019-10-18 06:38:10 +00:00
|
|
|
import React from "react";
|
2021-03-07 11:57:26 +00:00
|
|
|
|
2019-12-04 09:36:13 +00:00
|
|
|
import Text from "../text";
|
2019-10-18 12:13:08 +00:00
|
|
|
import Link from "../link";
|
2021-03-07 11:57:26 +00:00
|
|
|
import HelpButton from ".";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: "Components/HelpButton",
|
|
|
|
component: HelpButton,
|
|
|
|
subcomponents: { Text, Link },
|
|
|
|
argTypes: {},
|
|
|
|
parameters: {
|
|
|
|
docs: {
|
|
|
|
description: {
|
|
|
|
component: "HelpButton is used for a action on a page",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const Template = (args) => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<HelpButton {...args} />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Default = Template.bind({});
|
|
|
|
Default.args = {
|
|
|
|
displayType: "auto",
|
|
|
|
offsetTop: 0,
|
|
|
|
offsetRight: 0,
|
|
|
|
offsetBottom: 0,
|
|
|
|
offsetLeft: 0,
|
|
|
|
tooltipContent: <Text fontSize="13px">Paste you tooltip content here</Text>,
|
|
|
|
};
|
|
|
|
|
|
|
|
const DropDownTemplate = (args) => {
|
|
|
|
return (
|
|
|
|
<HelpButton
|
|
|
|
displayType="dropdown"
|
|
|
|
offsetTop={0}
|
|
|
|
offsetRight={0}
|
|
|
|
offsetBottom={0}
|
|
|
|
offsetLeft={0}
|
|
|
|
tooltipContent={
|
|
|
|
<Text fontSize="13px">Paste you tooltip content here</Text>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const DropDownPosition = DropDownTemplate.bind({});
|
|
|
|
|
|
|
|
const AsideTemplate = (args) => {
|
|
|
|
return (
|
|
|
|
<HelpButton
|
|
|
|
displayType="aside"
|
|
|
|
helpButtonHeaderContent="Aside position HelpButton"
|
|
|
|
tooltipContent={
|
|
|
|
<Text>
|
|
|
|
You tooltip content with{" "}
|
|
|
|
<Link
|
|
|
|
isHovered={true}
|
2021-03-08 20:18:45 +00:00
|
|
|
href="http://localhost:6006/?path=/story/components-helpbutton--default"
|
2021-03-07 11:57:26 +00:00
|
|
|
>
|
|
|
|
link
|
|
|
|
</Link>
|
|
|
|
</Text>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
2019-10-18 12:13:08 +00:00
|
|
|
|
2021-03-07 11:57:26 +00:00
|
|
|
export const AsidePosition = AsideTemplate.bind({});
|
2019-10-18 12:13:08 +00:00
|
|
|
|
2021-03-07 11:57:26 +00:00
|
|
|
const AutoTemplate = (args) => {
|
|
|
|
return (
|
|
|
|
<HelpButton
|
|
|
|
displayType="auto"
|
|
|
|
helpButtonHeaderContent="Auto position HelpButton"
|
|
|
|
tooltipContent={
|
|
|
|
<>
|
|
|
|
<p>You can put every thing here</p>
|
|
|
|
<ul style={{ marginBottom: 0 }}>
|
|
|
|
<li>Word</li>
|
|
|
|
<li>Chart</li>
|
|
|
|
<li>Else</li>
|
|
|
|
</ul>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
2019-10-18 06:38:10 +00:00
|
|
|
|
2021-03-07 11:57:26 +00:00
|
|
|
export const AutoPosition = AutoTemplate.bind({});
|