From a6ff5eee45215effb3344cb5d631a27a7c0369aa Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 22 Sep 2023 19:34:01 +0200
Subject: refactor(components): rewrite form components

---
 .../molecules/tooltip/tooltip.stories.tsx          | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 src/components/molecules/tooltip/tooltip.stories.tsx

(limited to 'src/components/molecules/tooltip/tooltip.stories.tsx')

diff --git a/src/components/molecules/tooltip/tooltip.stories.tsx b/src/components/molecules/tooltip/tooltip.stories.tsx
new file mode 100644
index 0000000..8a22a06
--- /dev/null
+++ b/src/components/molecules/tooltip/tooltip.stories.tsx
@@ -0,0 +1,42 @@
+import { ComponentMeta, ComponentStory } from '@storybook/react';
+import { Tooltip } from './tooltip';
+import { useState } from 'react';
+
+/**
+ * Switch - Storybook Meta
+ */
+export default {
+  title: 'Molecules/Tooltip',
+  component: Tooltip,
+  args: {},
+  argTypes: {},
+} as ComponentMeta<typeof Tooltip>;
+
+const Template: ComponentStory<typeof Tooltip> = ({
+  isOpen,
+  onToggle: _onToggle,
+  ...args
+}) => {
+  const [isOpened, setIsOpened] = useState(isOpen);
+
+  const toggle = () => {
+    setIsOpened((prev) => !prev);
+  };
+
+  return (
+    <div style={{ position: 'relative' }}>
+      <Tooltip {...args} isOpen={isOpened} onToggle={toggle} />
+    </div>
+  );
+};
+
+/**
+ * Tooltip Stories - Example
+ */
+export const Example = Template.bind({});
+Example.args = {
+  children:
+    'Inventore natus dignissimos aut illum modi asperiores. Et voluptatibus delectus.',
+  heading: 'A title',
+  isOpen: false,
+};
-- 
cgit v1.2.3

