diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-31 16:00:45 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:15:27 +0100 |
| commit | 3ff4c37a7a2c40340c17f9e6c1754444bce0f839 (patch) | |
| tree | 551ca3df148d46af2bd27995fa98c01378030644 /src/components/molecules/modals/tooltip/tooltip.stories.tsx | |
| parent | 0e52a59917406ad03c174e030c6c1c92ab23449d (diff) | |
refactor(components): rewrite Modal component
* add an optional close button
* add an icon prop
Diffstat (limited to 'src/components/molecules/modals/tooltip/tooltip.stories.tsx')
| -rw-r--r-- | src/components/molecules/modals/tooltip/tooltip.stories.tsx | 43 |
1 files changed, 43 insertions, 0 deletions
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, +}; |
