Skip to content

Commit

Permalink
chore: housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
DGiannaris committed Aug 28, 2024
1 parent ec1aab6 commit 9ff1f56
Showing 1 changed file with 18 additions and 32 deletions.
50 changes: 18 additions & 32 deletions examples/storybook/src/stories/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ const meta: Meta<typeof Tooltip.Root> = {
title: "Components/Tooltip",
component: Tooltip.Root,
tags: ["autodocs"],
};

export default meta;

type Story = StoryObj<typeof Tooltip.Root>;

export const Uncontrolled: Story = {
decorators: [
(Story) => (
<div className="flex flex-col gap-4 items-start">
<Story />
</div>
),
],
};

export default meta;

type Story = StoryObj<typeof Tooltip.Root>;

export const Uncontrolled: Story = {
render: (args: TooltipProps["Root"]) => (
<Tooltip.Root {...args}>
<Tooltip.Trigger>
Expand Down Expand Up @@ -65,13 +65,6 @@ export const Uncontrolled: Story = {
};

export const Controlled: Story = {
decorators: [
(Story) => (
<div className="flex flex-col gap-4 items-start">
<Story />
</div>
),
],
render: (args) => {
const [open, setOpen] = React.useState(false);
return (
Expand All @@ -87,18 +80,18 @@ export const Controlled: Story = {
docs: {
source: {
code: `
const ControlledTooltip = () => {
const [open, setOpen] = React.useState(false);
const ControlledTooltip = () => {
const [open, setOpen] = React.useState(false);
return (
<Tooltip.Root open={open} onOpenChange={setOpen}>
<Tooltip.Trigger>
<span>Hover me</span>
</Tooltip.Trigger>
<Tooltip.Content label="Controlled Tooltip" />
</Tooltip.Root>
);
};
return (
<Tooltip.Root open={open} onOpenChange={setOpen}>
<Tooltip.Trigger>
<span>Hover me</span>
</Tooltip.Trigger>
<Tooltip.Content label="Controlled Tooltip" />
</Tooltip.Root>
);
};
`,
language: "jsx",
type: "code",
Expand All @@ -108,13 +101,6 @@ export const Controlled: Story = {
};

export const CustomContent: Story = {
decorators: [
(Story) => (
<div className="flex flex-col gap-4 items-start">
<Story />
</div>
),
],
render: (args: TooltipProps["Root"]) => (
<Tooltip.Root {...args}>
<Tooltip.Trigger>
Expand Down

0 comments on commit 9ff1f56

Please sign in to comment.