From 3ff4c37a7a2c40340c17f9e6c1754444bce0f839 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 31 Oct 2023 16:00:45 +0100
Subject: refactor(components): rewrite Modal component

* add an optional close button
* add an icon prop
---
 .../molecules/modals/tooltip/tooltip.stories.tsx   | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 src/components/molecules/modals/tooltip/tooltip.stories.tsx

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

diff --git a/src/components/molecules/modals/tooltip/tooltip.stories.tsx b/src/components/molecules/modals/tooltip/tooltip.stories.tsx
new file mode 100644
index 0000000..0cff339
--- /dev/null
+++ b/src/components/molecules/modals/tooltip/tooltip.stories.tsx
@@ -0,0 +1,43 @@
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import { useBoolean } from '../../../../utils/hooks';
+import { Tooltip } from './tooltip';
+
+/**
+ * Switch - Storybook Meta
+ */
+export default {
+  title: 'Molecules/Modals/Tooltip',
+  component: Tooltip,
+  args: {},
+  argTypes: {},
+} as ComponentMeta<typeof Tooltip>;
+
+const Template: ComponentStory<typeof Tooltip> = ({
+  isOpen,
+  onToggle: _onToggle,
+  ...args
+}) => {
+  const { deactivate, state: isOpened, toggle } = useBoolean(isOpen);
+
+  return (
+    <div style={{ position: 'relative' }}>
+      <Tooltip
+        {...args}
+        isOpen={isOpened}
+        onClickOutside={deactivate}
+        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

