Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Refactor components import path
Browse files Browse the repository at this point in the history
  • Loading branch information
grayashh committed Oct 24, 2023
1 parent 4f4e6d0 commit 92639f1
Show file tree
Hide file tree
Showing 46 changed files with 149 additions and 199 deletions.
7 changes: 3 additions & 4 deletions src/components/Base/Accordion/Accordion.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from 'react';

import type { Meta, StoryObj } from '@storybook/react';

import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from './Accordion';
} from 'components';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'Components/Accordion',
Expand Down
7 changes: 3 additions & 4 deletions src/components/Base/AleartDialog/AlertDialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import React from 'react';

import type { Meta, StoryObj } from '@storybook/react';

import {
AlertDialog,
AlertDialogAction,
Expand All @@ -12,7 +9,9 @@ import {
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from './AlertDialog';
} from 'components';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'Components/AlertDialog',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/AleartDialog/AlertDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import React from 'react';
import { buttonVariants } from 'components/Base/Button/Button';
import { buttonVariants } from 'components';
import { cn } from 'lib/twUtils';

import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';
import { Alert, AlertDescription, AlertTitle } from 'components';
import { Terminal } from 'lucide-react';

import type { Meta, StoryObj } from '@storybook/react';

import { Alert, AlertDescription, AlertTitle } from './Alert';

const meta = {
title: 'Components/Alert',
component: Alert,
Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Avatar/Avatar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import { Avatar, AvatarFallback, AvatarImage } from 'components';

import type { Meta, StoryObj } from '@storybook/react';

import { Avatar, AvatarFallback, AvatarImage } from './Avatar';

const meta = {
title: 'Components/Avatar',
component: Avatar,
Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Badge/Badge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import { Badge } from 'components';

import type { Meta, StoryObj } from '@storybook/react';

import { Badge } from './Badge';

const meta = {
title: 'Components/Badge',
component: Badge,
Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';
import { Button } from 'components';
import { ChevronRight, Loader2, Mail } from 'lucide-react';

import type { Meta, StoryObj } from '@storybook/react';

import { Button } from './Button';

const meta = {
title: 'Components/Button',
component: Button,
Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Calendar/Calendar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { useState } from 'react';
import { Calendar } from 'components';
import { addDays } from 'date-fns';
import { DateRange, DayClickEventHandler } from 'react-day-picker';

import type { Meta, StoryObj } from '@storybook/react';

import { Calendar } from './Calendar';

const meta = {
title: 'Components/Calendar',
component: Calendar,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import React from 'react';
import { buttonVariants } from 'components/Base/Button/Button';
import { buttonVariants } from 'components';
import { cn } from 'lib/twUtils';
import { ChevronLeft, ChevronRight } from 'lucide-react';
import { DayPicker } from 'react-day-picker';
Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Card/Card.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Button } from 'components/Base/Button/Button';
import { Input } from 'components/Base/Input/Input';
import { Button, Input } from 'components';

import type { Meta, StoryObj } from '@storybook/react';

Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Checkbox/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import { Checkbox } from 'components';

import type { Meta, StoryObj } from '@storybook/react';

import { Checkbox } from './Checkbox';

const meta = {
title: 'Components/Checkbox',
component: Checkbox,
Expand Down
11 changes: 5 additions & 6 deletions src/components/Base/Collapsible/Collapsible.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React, { useState } from 'react';
import { Button } from 'components/Base/Button/Button';
import { ChevronsUpDown } from 'lucide-react';

import type { Meta, StoryObj } from '@storybook/react';

import {
Button,
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from './Collapsible';
} from 'components';
import { ChevronsUpDown } from 'lucide-react';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'Components/Collapsible',
Expand Down
23 changes: 11 additions & 12 deletions src/components/Base/Command/Command.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
import React, { useEffect, useState } from 'react';
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-react';

import type { Meta, StoryObj } from '@storybook/react';

import {
Command,
CommandDialog,
Expand All @@ -20,7 +9,17 @@ import {
CommandList,
CommandSeparator,
CommandShortcut,
} from './Command';
} from 'components';
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-react';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'Components/Command',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/Command/Command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React from 'react';
import { Command as CommandPrimitive } from 'cmdk';
import { Dialog, DialogContent } from 'components/Base/Dialog/Dialog';
import { Dialog, DialogContent } from 'components';
import { cn } from 'lib/twUtils';
import { Search } from 'lucide-react';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/ContextMenu/ContextMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
ContextMenuSubContent,
ContextMenuSubTrigger,
ContextMenuTrigger,
} from 'components/Base/ContextMenu/ContextMenu';
} from 'components';

import type { Meta, StoryObj } from '@storybook/react';

Expand Down
13 changes: 6 additions & 7 deletions src/components/Base/Dialog/Dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import React from 'react';
import { Button } from 'components/Base/Button/Button';
import { Input } from 'components/Base/Input/Input';
import { Label } from 'components/Base/Label/Label';

import type { Meta, StoryObj } from '@storybook/react';

import {
Button,
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from './Dialog';
Input,
Label,
} from 'components';

import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'Components/Dialog',
Expand Down
37 changes: 18 additions & 19 deletions src/components/Base/DropdownMenu/DropdownMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
import React, { useState } from 'react';
import { Button } from 'components/Base/Button/Button';
import {
Button,
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from 'components';
import {
Cloud,
CreditCard,
Expand All @@ -20,24 +37,6 @@ import {
import { DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
import type { Meta, StoryObj } from '@storybook/react';

import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from './DropdownMenu';

const meta = {
title: 'Components/DropdownMenu',
component: DropdownMenu,
Expand Down
39 changes: 16 additions & 23 deletions src/components/Base/Form/Form.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
'use client';

import React from 'react';
import { Button } from 'components/Base/Button/Button';
import { Calendar } from 'components/Base/Calendar/Calendar';
import { Checkbox } from 'components/Base/Checkbox/Checkbox';
import { Input } from 'components/Base/Input/Input';
import {
Button,
Calendar,
Checkbox,
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
Input,
Popover,
PopoverContent,
PopoverTrigger,
} from 'components/Base/Popover/Popover';
import {
RadioGroup,
RadioGroupItem,
} from 'components/Base/RadioGroup/RadioGroup';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from 'components/Base/Select/Select';
import { Switch } from 'components/Base/Switch/Switch';
import { Textarea } from 'components/Base/Textarea/Textarea';
import { Toaster } from 'components/Base/Toast/Toaster';
Switch,
Textarea,
Toaster,
} from 'components';
import { format } from 'date-fns';
import { cn } from 'lib/twUtils';
import { toast } from 'lib/useToast';
Expand All @@ -34,16 +37,6 @@ import * as z from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import type { Meta, StoryObj } from '@storybook/react';

import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from './Form';

const meta = {
title: 'Components/Form',
component: Form,
Expand Down Expand Up @@ -563,7 +556,7 @@ export const WithSwitchForm: StoryObj<typeof Form> = {
},
},
},
render: args => {
render: () => {
const FormSchema = z.object({
marketing_emails: z.boolean().default(false).optional(),
security_emails: z.boolean(),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/Form/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Label } from 'components/Base/Label/Label';
import { Label } from 'components';
import { cn } from 'lib/twUtils';
import { useId } from 'lib/useId';
import {
Expand Down
6 changes: 2 additions & 4 deletions src/components/Base/HoverCard/HoverCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import {
Avatar,
AvatarFallback,
AvatarImage,
} from 'components/Base/Avatar/Avatar';
import { Button } from 'components/Base/Button/Button';
import {
Button,
HoverCard,
HoverCardContent,
HoverCardTrigger,
} from 'components/Base/HoverCard/HoverCard';
} from 'components';
import { CalendarDays } from 'lucide-react';

import type { Meta, StoryObj } from '@storybook/react';
Expand Down
3 changes: 1 addition & 2 deletions src/components/Base/Input/Input.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Button } from 'components/Base/Button/Button';
import { Input } from 'components/Base/Input/Input';
import { Button, Input } from 'components';

import type { Meta, StoryObj } from '@storybook/react';

Expand Down
4 changes: 1 addition & 3 deletions src/components/Base/Label/Label.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from 'react';
import { Checkbox } from 'components/Base/Checkbox/Checkbox';
import { Checkbox, Label } from 'components';

import type { Meta, StoryObj } from '@storybook/react';

import { Label } from './Label';

const meta = {
title: 'Components/Label',
component: Label,
Expand Down
Loading

0 comments on commit 92639f1

Please sign in to comment.