Skip to content

Commit

Permalink
chore(storybook): ♻️ swap to alias import for stories
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydrichards committed Sep 28, 2023
1 parent bcbc9f3 commit 24727b8
Show file tree
Hide file tree
Showing 28 changed files with 103 additions and 82 deletions.
2 changes: 1 addition & 1 deletion apps/www/registry/stories/accordion.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "../default/ui/accordion"
} from "@/registry/default/ui/accordion"

const meta: Meta<typeof Accordion> = {
title: "ui/Accordion",
Expand Down
4 changes: 2 additions & 2 deletions apps/www/registry/stories/alert-dialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "../default/ui/alert-dialog"
import { Button } from "../default/ui/button"
} from "@/registry/default/ui/alert-dialog"
import { Button } from "@/registry/default/ui/button"

const meta: Meta<typeof AlertDialog> = {
title: "ui/AlertDialog",
Expand Down
6 changes: 5 additions & 1 deletion apps/www/registry/stories/avatar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Meta, StoryObj } from "@storybook/react"

import { Avatar, AvatarFallback, AvatarImage } from "../default/ui/avatar"
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@/registry/default/ui/avatar"

const meta: Meta<typeof Avatar> = {
title: "ui/Avatar",
Expand Down
18 changes: 9 additions & 9 deletions apps/www/registry/stories/badge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
import { Meta, StoryObj } from "@storybook/react";
import { Meta, StoryObj } from "@storybook/react"

import { Badge } from "../default/ui/badge";
import { Badge } from "@/registry/default/ui/badge"

const meta: Meta<typeof Badge> = {
title: "ui/Badge",
component: Badge,
tags: ["autodocs"],
argTypes: {},
};
export default meta;
}
export default meta

type Story = StoryObj<typeof Badge>;
type Story = StoryObj<typeof Badge>

export const Base: Story = {
render: (args) => <Badge {...args}>Badge</Badge>,
args: {},
};
}

export const Secondary: Story = {
render: (args) => <Badge {...args}>Badge</Badge>,
args: {
variant: "secondary",
},
};
}

export const Destructive: Story = {
render: (args) => <Badge {...args}>Badge</Badge>,
args: {
variant: "destructive",
},
};
}

export const Outline: Story = {
render: (args) => <Badge {...args}>Badge</Badge>,
args: {
variant: "outline",
},
};
}
28 changes: 14 additions & 14 deletions apps/www/registry/stories/button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
import { Meta, StoryObj } from "@storybook/react";
import { Loader2, Mail } from "lucide-react";
import { Meta, StoryObj } from "@storybook/react"
import { Loader2, Mail } from "lucide-react"

import { Button } from "../default/ui/button";
import { Button } from "@/registry/default/ui/button"

const meta: Meta<typeof Button> = {
title: "ui/Button",
component: Button,
tags: ["autodocs"],
argTypes: {},
};
export default meta;
}
export default meta

type Story = StoryObj<typeof Button>;
type Story = StoryObj<typeof Button>

export const Base: Story = {
render: (args) => <Button {...args}>Button</Button>,
args: {},
};
}

export const Outline: Story = {
render: (args) => <Button {...args}>Button</Button>,
args: {
variant: "outline",
},
};
}

export const Ghost: Story = {
render: (args) => <Button {...args}>Button</Button>,
args: {
variant: "ghost",
},
};
}

export const Secondary: Story = {
render: (args) => <Button {...args}>Button</Button>,
args: {
variant: "secondary",
},
};
}

export const Destructive: Story = {
render: (args) => <Button {...args}>Button</Button>,
args: {
variant: "destructive",
},
};
}

export const Link: Story = {
render: (args) => <Button {...args}>Button</Button>,
args: {
variant: "link",
},
};
}

export const Loading: Story = {
render: (args) => (
Expand All @@ -63,7 +63,7 @@ export const Loading: Story = {
args: {
variant: "outline",
},
};
}

export const WithIcon: Story = {
render: (args) => (
Expand All @@ -74,4 +74,4 @@ export const WithIcon: Story = {
args: {
variant: "secondary",
},
};
}
7 changes: 3 additions & 4 deletions apps/www/registry/stories/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import { Meta, StoryObj } from "@storybook/react"
import { BellRing, Check } from "lucide-react"

import { cn } from "@/lib/utils"

import { Button } from "../default/ui/button"
import { Button } from "@/registry/default/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "../default/ui/card"
import { Switch } from "../default/ui/switch"
} from "@/registry/default/ui/card"
import { Switch } from "@/registry/default/ui/switch"

const meta: Meta<typeof Card> = {
title: "ui/Card",
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/stories/checkbox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/react"

import { Checkbox } from "../default/ui/checkbox"
import { Checkbox } from "@/registry/default/ui/checkbox"

const meta: Meta<typeof Checkbox> = {
title: "ui/Checkbox",
Expand Down
4 changes: 2 additions & 2 deletions apps/www/registry/stories/collapsible.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Meta, StoryObj } from "@storybook/react"
import { ChevronsUpDown, Plus, X } from "lucide-react"

import { Button } from "../default/ui/button"
import { Button } from "@/registry/default/ui/button"
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from "../default/ui/collapsible"
} from "@/registry/default/ui/collapsible"

const meta: Meta<typeof Collapsible> = {
title: "ui/Collapsible",
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/stories/context-menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ContextMenuSubContent,
ContextMenuSubTrigger,
ContextMenuTrigger,
} from "../default/ui/context-menu"
} from "@/registry/default/ui/context-menu"

const meta: Meta<typeof ContextMenu> = {
title: "ui/ContextMenu",
Expand Down
8 changes: 4 additions & 4 deletions apps/www/registry/stories/dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/react"

import { Button } from "../default/ui/button"
import { Button } from "@/registry/default/ui/button"
import {
Dialog,
DialogContent,
Expand All @@ -9,9 +9,9 @@ import {
DialogHeader,
DialogTitle,
DialogTrigger,
} from "../default/ui/dialog"
import { Input } from "../default/ui/input"
import { Label } from "../default/ui/label"
} from "@/registry/default/ui/dialog"
import { Input } from "@/registry/default/ui/input"
import { Label } from "@/registry/default/ui/label"

const meta: Meta<typeof Dialog> = {
title: "ui/Dialog",
Expand Down
4 changes: 2 additions & 2 deletions apps/www/registry/stories/dropdown-menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Users,
} from "lucide-react"

import { Button } from "../default/ui/button"
import { Button } from "@/registry/default/ui/button"
import {
DropdownMenu,
DropdownMenuContent,
Expand All @@ -30,7 +30,7 @@ import {
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from "../default/ui/dropdown-menu"
} from "@/registry/default/ui/dropdown-menu"

const meta: Meta<typeof DropdownMenu> = {
title: "ui/DropdownMenu",
Expand Down
10 changes: 7 additions & 3 deletions apps/www/registry/stories/hover-card.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { Meta, StoryObj } from "@storybook/react"
import { CalendarDays } from "lucide-react"

import { Avatar, AvatarFallback, AvatarImage } from "../default/ui/avatar"
import { Button } from "../default/ui/button"
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@/registry/default/ui/avatar"
import { Button } from "@/registry/default/ui/button"
import {
HoverCard,
HoverCardContent,
HoverCardTrigger,
} from "../default/ui/hover-card"
} from "@/registry/default/ui/hover-card"

const meta: Meta<typeof HoverCard> = {
title: "ui/HoverCard",
Expand Down
6 changes: 3 additions & 3 deletions apps/www/registry/stories/input.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Meta, StoryObj } from "@storybook/react"

import { Button } from "../default/ui/button"
import { Input } from "../default/ui/input"
import { Label } from "../default/ui/label"
import { Button } from "@/registry/default/ui/button"
import { Input } from "@/registry/default/ui/input"
import { Label } from "@/registry/default/ui/label"

const meta: Meta<typeof Input> = {
title: "ui/Input",
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/stories/label.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/react"

import { Label } from "../default/ui/label"
import { Label } from "@/registry/default/ui/label"

const meta: Meta<typeof Label> = {
title: "ui/Label",
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/stories/menubar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
MenubarSubContent,
MenubarSubTrigger,
MenubarTrigger,
} from "../default/ui/menubar"
} from "@/registry/default/ui/menubar"

const meta: Meta<typeof Menubar> = {
title: "ui/Menubar",
Expand Down
15 changes: 8 additions & 7 deletions apps/www/registry/stories/navigation-menu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import { Meta, StoryObj } from "@storybook/react";
import Link from "next/link";
import Link from "next/link"
import { Meta, StoryObj } from "@storybook/react"

import {
NavigationMenu,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
navigationMenuTriggerStyle,
} from "../default/ui/navigation-menu";
} from "@/registry/default/ui/navigation-menu"

const meta: Meta<typeof NavigationMenu> = {
title: "ui/NavigationMenu",
component: NavigationMenu,
tags: ["autodocs"],
argTypes: {},
};
export default meta;
}
export default meta

type Story = StoryObj<typeof NavigationMenu>;
type Story = StoryObj<typeof NavigationMenu>

export const Base: Story = {
render: () => (
Expand All @@ -41,4 +42,4 @@ export const Base: Story = {
</NavigationMenu>
),
args: {},
};
}
12 changes: 8 additions & 4 deletions apps/www/registry/stories/popover.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { Meta, StoryObj } from "@storybook/react"
import { Settings2 } from "lucide-react"

import { Button } from "../default/ui/button"
import { Input } from "../default/ui/input"
import { Label } from "../default/ui/label"
import { Popover, PopoverContent, PopoverTrigger } from "../default/ui/popover"
import { Button } from "@/registry/default/ui/button"
import { Input } from "@/registry/default/ui/input"
import { Label } from "@/registry/default/ui/label"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/registry/default/ui/popover"

const meta: Meta<typeof Popover> = {
title: "ui/Popover",
Expand Down
2 changes: 1 addition & 1 deletion apps/www/registry/stories/progress.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/react"

import { Progress } from "../default/ui/progress"
import { Progress } from "@/registry/default/ui/progress"

const meta: Meta<typeof Progress> = {
title: "ui/Progress",
Expand Down
4 changes: 2 additions & 2 deletions apps/www/registry/stories/radio-group.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from "@storybook/react"

import { Label } from "../default/ui/label"
import { RadioGroup, RadioGroupItem } from "../default/ui/radio-group"
import { Label } from "@/registry/default/ui/label"
import { RadioGroup, RadioGroupItem } from "@/registry/default/ui/radio-group"

const meta: Meta<typeof RadioGroup> = {
title: "ui/RadioGroup",
Expand Down
4 changes: 2 additions & 2 deletions apps/www/registry/stories/scroll-area.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import { Meta, StoryObj } from "@storybook/react"

import { ScrollArea } from "../default/ui/scroll-area"
import { Separator } from "../default/ui/separator"
import { ScrollArea } from "@/registry/default/ui/scroll-area"
import { Separator } from "@/registry/default/ui/separator"

const meta: Meta<typeof ScrollArea> = {
title: "ui/ScrollArea",
Expand Down
Loading

0 comments on commit 24727b8

Please sign in to comment.