From 700b4bbef639777f217f788ffe7e7eed2aa4a631 Mon Sep 17 00:00:00 2001
From: Ye-Chan Kang
Date: Mon, 11 Mar 2024 21:30:37 +0900
Subject: [PATCH] refactor: pull up common path
---
src/components/{common => }/Avatar/index.tsx | 0
src/components/{common => }/Badge/index.tsx | 0
src/components/{common => }/Button/index.tsx | 0
src/components/{common => }/Card/index.tsx | 0
.../Checkbox.test.tsx} | 2 +-
.../{common => }/Checkbox/index.tsx | 0
.../Dialog.test.tsx} | 2 +-
src/components/{common => }/Dialog/Dialog.tsx | 0
.../{common => }/Dialog/DialogClose.tsx | 0
.../{common => }/Dialog/DialogContent.tsx | 0
.../{common => }/Dialog/DialogContext.tsx | 0
.../{common => }/Dialog/DialogToggle.tsx | 0
src/components/{common => }/Dialog/index.tsx | 0
.../Dropdown.test.tsx} | 4 +-
.../{common => }/Dropdown/Dropdown.tsx | 2 +-
.../{common => }/Dropdown/DropdownContent.tsx | 2 +-
.../{common => }/Dropdown/DropdownItem.tsx | 2 +-
.../{common => }/Dropdown/DropdownToggle.tsx | 2 +-
.../{common => }/Dropdown/index.tsx | 0
.../{common => }/HoverCard/HoverCard.tsx | 2 +-
.../HoverCard/HoverCardContent.tsx | 2 +-
.../HoverCard/HoverCardContext.tsx | 0
.../HoverCard/HoverCardToggle.tsx | 2 +-
.../{common => }/HoverCard/index.tsx | 0
.../{common => }/HoverCard/useHoverWaiting.ts | 2 +-
.../input.test.tsx => Input/Input.test.tsx} | 2 +-
.../{common => }/Input/InputDesc.tsx | 0
.../{common => }/Input/InputGroup.tsx | 0
src/components/{common => }/Input/index.tsx | 0
src/components/{common => }/Label/index.tsx | 0
.../{portal => Portal}/PortalContent.tsx | 2 +-
.../{portal => Portal}/PortalContext.tsx | 0
.../{portal => Portal}/PortalProvider.tsx | 0
src/components/{portal => Portal}/type.ts | 0
.../{portal => Portal}/usePortal.ts | 2 +-
.../Select.test.tsx} | 2 +-
src/components/{common => }/Select/Select.tsx | 2 +-
.../{common => }/Select/SelectContent.tsx | 2 +-
.../{common => }/Select/SelectContext.tsx | 0
.../{common => }/Select/SelectIcon.tsx | 0
.../{common => }/Select/SelectItem.tsx | 2 +-
.../{common => }/Select/SelectToggle.tsx | 2 +-
src/components/{common => }/Select/index.tsx | 0
src/components/{common => }/Select/type.ts | 0
.../Switch.test.tsx} | 2 +-
src/components/{common => }/Switch/index.tsx | 0
.../Textarea.test.tsx} | 2 +-
.../{common => }/Textarea/index.tsx | 0
.../toast.test.tsx => Toast/Toast.test.tsx} | 2 +-
src/components/{common => }/Toast/Toast.tsx | 0
.../{common => }/Toast/ToastContext.tsx | 0
src/components/{common => }/Toast/Toaster.tsx | 0
src/components/{common => }/Toast/index.tsx | 0
src/components/{common => }/Toast/type.ts | 0
.../{common => }/Toast/useToast.tsx | 0
.../Toggle.test.tsx} | 2 +-
src/components/{common => }/Toggle/index.tsx | 0
.../Tooltip.test.tsx} | 2 +-
src/components/{common => }/Tooltip/index.tsx | 0
src/components/common/Form/form.test.tsx | 52 -------------------
src/components/common/Form/index.tsx | 24 ---------
src/components/common/index.ts | 17 ------
src/components/index.ts | 20 ++++++-
63 files changed, 43 insertions(+), 120 deletions(-)
rename src/components/{common => }/Avatar/index.tsx (100%)
rename src/components/{common => }/Badge/index.tsx (100%)
rename src/components/{common => }/Button/index.tsx (100%)
rename src/components/{common => }/Card/index.tsx (100%)
rename src/components/{common/Checkbox/checkbox.test.tsx => Checkbox/Checkbox.test.tsx} (95%)
rename src/components/{common => }/Checkbox/index.tsx (100%)
rename src/components/{common/Dialog/dialog.test.tsx => Dialog/Dialog.test.tsx} (97%)
rename src/components/{common => }/Dialog/Dialog.tsx (100%)
rename src/components/{common => }/Dialog/DialogClose.tsx (100%)
rename src/components/{common => }/Dialog/DialogContent.tsx (100%)
rename src/components/{common => }/Dialog/DialogContext.tsx (100%)
rename src/components/{common => }/Dialog/DialogToggle.tsx (100%)
rename src/components/{common => }/Dialog/index.tsx (100%)
rename src/components/{common/Dropdown/dropdown.test.tsx => Dropdown/Dropdown.test.tsx} (93%)
rename src/components/{common => }/Dropdown/Dropdown.tsx (85%)
rename src/components/{common => }/Dropdown/DropdownContent.tsx (90%)
rename src/components/{common => }/Dropdown/DropdownItem.tsx (95%)
rename src/components/{common => }/Dropdown/DropdownToggle.tsx (94%)
rename src/components/{common => }/Dropdown/index.tsx (100%)
rename src/components/{common => }/HoverCard/HoverCard.tsx (92%)
rename src/components/{common => }/HoverCard/HoverCardContent.tsx (93%)
rename src/components/{common => }/HoverCard/HoverCardContext.tsx (100%)
rename src/components/{common => }/HoverCard/HoverCardToggle.tsx (96%)
rename src/components/{common => }/HoverCard/index.tsx (100%)
rename src/components/{common => }/HoverCard/useHoverWaiting.ts (94%)
rename src/components/{common/Input/input.test.tsx => Input/Input.test.tsx} (90%)
rename src/components/{common => }/Input/InputDesc.tsx (100%)
rename src/components/{common => }/Input/InputGroup.tsx (100%)
rename src/components/{common => }/Input/index.tsx (100%)
rename src/components/{common => }/Label/index.tsx (100%)
rename src/components/{portal => Portal}/PortalContent.tsx (97%)
rename src/components/{portal => Portal}/PortalContext.tsx (100%)
rename src/components/{portal => Portal}/PortalProvider.tsx (100%)
rename src/components/{portal => Portal}/type.ts (100%)
rename src/components/{portal => Portal}/usePortal.ts (96%)
rename src/components/{common/Select/select.test.tsx => Select/Select.test.tsx} (97%)
rename src/components/{common => }/Select/Select.tsx (91%)
rename src/components/{common => }/Select/SelectContent.tsx (90%)
rename src/components/{common => }/Select/SelectContext.tsx (100%)
rename src/components/{common => }/Select/SelectIcon.tsx (100%)
rename src/components/{common => }/Select/SelectItem.tsx (97%)
rename src/components/{common => }/Select/SelectToggle.tsx (97%)
rename src/components/{common => }/Select/index.tsx (100%)
rename src/components/{common => }/Select/type.ts (100%)
rename src/components/{common/Switch/switch.test.tsx => Switch/Switch.test.tsx} (94%)
rename src/components/{common => }/Switch/index.tsx (100%)
rename src/components/{common/Textarea/textarea.test.tsx => Textarea/Textarea.test.tsx} (91%)
rename src/components/{common => }/Textarea/index.tsx (100%)
rename src/components/{common/Toast/toast.test.tsx => Toast/Toast.test.tsx} (96%)
rename src/components/{common => }/Toast/Toast.tsx (100%)
rename src/components/{common => }/Toast/ToastContext.tsx (100%)
rename src/components/{common => }/Toast/Toaster.tsx (100%)
rename src/components/{common => }/Toast/index.tsx (100%)
rename src/components/{common => }/Toast/type.ts (100%)
rename src/components/{common => }/Toast/useToast.tsx (100%)
rename src/components/{common/Toggle/toggle.test.tsx => Toggle/Toggle.test.tsx} (87%)
rename src/components/{common => }/Toggle/index.tsx (100%)
rename src/components/{common/Tooltip/tooltip.test.tsx => Tooltip/Tooltip.test.tsx} (95%)
rename src/components/{common => }/Tooltip/index.tsx (100%)
delete mode 100644 src/components/common/Form/form.test.tsx
delete mode 100644 src/components/common/Form/index.tsx
delete mode 100644 src/components/common/index.ts
diff --git a/src/components/common/Avatar/index.tsx b/src/components/Avatar/index.tsx
similarity index 100%
rename from src/components/common/Avatar/index.tsx
rename to src/components/Avatar/index.tsx
diff --git a/src/components/common/Badge/index.tsx b/src/components/Badge/index.tsx
similarity index 100%
rename from src/components/common/Badge/index.tsx
rename to src/components/Badge/index.tsx
diff --git a/src/components/common/Button/index.tsx b/src/components/Button/index.tsx
similarity index 100%
rename from src/components/common/Button/index.tsx
rename to src/components/Button/index.tsx
diff --git a/src/components/common/Card/index.tsx b/src/components/Card/index.tsx
similarity index 100%
rename from src/components/common/Card/index.tsx
rename to src/components/Card/index.tsx
diff --git a/src/components/common/Checkbox/checkbox.test.tsx b/src/components/Checkbox/Checkbox.test.tsx
similarity index 95%
rename from src/components/common/Checkbox/checkbox.test.tsx
rename to src/components/Checkbox/Checkbox.test.tsx
index 7454e6b..8c56ad5 100644
--- a/src/components/common/Checkbox/checkbox.test.tsx
+++ b/src/components/Checkbox/Checkbox.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { describe, expect, it } from 'vitest';
import { Checkbox, Label } from '../../';
-import { fireEvent, render, screen } from '../../../libs/test';
+import { fireEvent, render, screen } from '../../libs/test';
describe('Checkbox', () => {
it('Checkbox icon must be customizable and work when clicked.', () => {
diff --git a/src/components/common/Checkbox/index.tsx b/src/components/Checkbox/index.tsx
similarity index 100%
rename from src/components/common/Checkbox/index.tsx
rename to src/components/Checkbox/index.tsx
diff --git a/src/components/common/Dialog/dialog.test.tsx b/src/components/Dialog/Dialog.test.tsx
similarity index 97%
rename from src/components/common/Dialog/dialog.test.tsx
rename to src/components/Dialog/Dialog.test.tsx
index d7eff99..f1c3a72 100644
--- a/src/components/common/Dialog/dialog.test.tsx
+++ b/src/components/Dialog/Dialog.test.tsx
@@ -17,7 +17,7 @@ import {
InputGroup,
Label,
} from '../../';
-import { fireEvent, render, screen } from '../../../libs/test';
+import { fireEvent, render, screen } from '../../libs/test';
describe('Dialog', () => {
it('Should appear DialogContent when click DialogToggle', () => {
diff --git a/src/components/common/Dialog/Dialog.tsx b/src/components/Dialog/Dialog.tsx
similarity index 100%
rename from src/components/common/Dialog/Dialog.tsx
rename to src/components/Dialog/Dialog.tsx
diff --git a/src/components/common/Dialog/DialogClose.tsx b/src/components/Dialog/DialogClose.tsx
similarity index 100%
rename from src/components/common/Dialog/DialogClose.tsx
rename to src/components/Dialog/DialogClose.tsx
diff --git a/src/components/common/Dialog/DialogContent.tsx b/src/components/Dialog/DialogContent.tsx
similarity index 100%
rename from src/components/common/Dialog/DialogContent.tsx
rename to src/components/Dialog/DialogContent.tsx
diff --git a/src/components/common/Dialog/DialogContext.tsx b/src/components/Dialog/DialogContext.tsx
similarity index 100%
rename from src/components/common/Dialog/DialogContext.tsx
rename to src/components/Dialog/DialogContext.tsx
diff --git a/src/components/common/Dialog/DialogToggle.tsx b/src/components/Dialog/DialogToggle.tsx
similarity index 100%
rename from src/components/common/Dialog/DialogToggle.tsx
rename to src/components/Dialog/DialogToggle.tsx
diff --git a/src/components/common/Dialog/index.tsx b/src/components/Dialog/index.tsx
similarity index 100%
rename from src/components/common/Dialog/index.tsx
rename to src/components/Dialog/index.tsx
diff --git a/src/components/common/Dropdown/dropdown.test.tsx b/src/components/Dropdown/Dropdown.test.tsx
similarity index 93%
rename from src/components/common/Dropdown/dropdown.test.tsx
rename to src/components/Dropdown/Dropdown.test.tsx
index 1b5e935..a9e7e42 100644
--- a/src/components/common/Dropdown/dropdown.test.tsx
+++ b/src/components/Dropdown/Dropdown.test.tsx
@@ -10,8 +10,8 @@ import {
DropdownLabel,
DropdownShortcut,
DropdownToggle,
-} from '../../..';
-import { fireEvent, render, screen } from '../../../libs/test';
+} from '../';
+import { fireEvent, render, screen } from '../../libs/test';
describe('UI test', () => {
it('Should appear DropdownContent when click DropdownToggle', () => {
diff --git a/src/components/common/Dropdown/Dropdown.tsx b/src/components/Dropdown/Dropdown.tsx
similarity index 85%
rename from src/components/common/Dropdown/Dropdown.tsx
rename to src/components/Dropdown/Dropdown.tsx
index b3e0e8b..42c422d 100644
--- a/src/components/common/Dropdown/Dropdown.tsx
+++ b/src/components/Dropdown/Dropdown.tsx
@@ -1,4 +1,4 @@
-import { PortalProvider } from '@/components/portal/PortalProvider';
+import { PortalProvider } from '@/components/Portal/PortalProvider';
import { AlignType } from '@/types/align';
interface DropdownProps extends React.PropsWithChildren {
diff --git a/src/components/common/Dropdown/DropdownContent.tsx b/src/components/Dropdown/DropdownContent.tsx
similarity index 90%
rename from src/components/common/Dropdown/DropdownContent.tsx
rename to src/components/Dropdown/DropdownContent.tsx
index 248991f..7ed4d51 100644
--- a/src/components/common/Dropdown/DropdownContent.tsx
+++ b/src/components/Dropdown/DropdownContent.tsx
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
import * as React from 'react';
-import { PortalContent } from '@/components/portal/PortalContent';
+import { PortalContent } from '@/components/Portal/PortalContent';
interface ModalProps extends React.ComponentPropsWithoutRef<'div'> {
width?: React.CSSProperties['width'];
diff --git a/src/components/common/Dropdown/DropdownItem.tsx b/src/components/Dropdown/DropdownItem.tsx
similarity index 95%
rename from src/components/common/Dropdown/DropdownItem.tsx
rename to src/components/Dropdown/DropdownItem.tsx
index 41d0330..3087129 100644
--- a/src/components/common/Dropdown/DropdownItem.tsx
+++ b/src/components/Dropdown/DropdownItem.tsx
@@ -2,7 +2,7 @@ import { css } from '@emotion/react';
import styled from '@emotion/styled';
import * as React from 'react';
-import { PortalContext } from '@/components/portal/PortalContext';
+import { PortalContext } from '@/components/Portal/PortalContext';
import useContext from '@/hooks/useContext';
import { composeEventHandlers } from '@/libs/event';
diff --git a/src/components/common/Dropdown/DropdownToggle.tsx b/src/components/Dropdown/DropdownToggle.tsx
similarity index 94%
rename from src/components/common/Dropdown/DropdownToggle.tsx
rename to src/components/Dropdown/DropdownToggle.tsx
index 748b8f4..8885101 100644
--- a/src/components/common/Dropdown/DropdownToggle.tsx
+++ b/src/components/Dropdown/DropdownToggle.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
+import { PortalContext } from '@/components/Portal/PortalContext';
import Slot from '@/components/Slot';
-import { PortalContext } from '@/components/portal/PortalContext';
import useContext from '@/hooks/useContext';
import { composeEventHandlers } from '@/libs/event';
import { composeRefs } from '@/libs/ref';
diff --git a/src/components/common/Dropdown/index.tsx b/src/components/Dropdown/index.tsx
similarity index 100%
rename from src/components/common/Dropdown/index.tsx
rename to src/components/Dropdown/index.tsx
diff --git a/src/components/common/HoverCard/HoverCard.tsx b/src/components/HoverCard/HoverCard.tsx
similarity index 92%
rename from src/components/common/HoverCard/HoverCard.tsx
rename to src/components/HoverCard/HoverCard.tsx
index 2062830..cd23a9e 100644
--- a/src/components/common/HoverCard/HoverCard.tsx
+++ b/src/components/HoverCard/HoverCard.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
-import { PortalProvider } from '@/components/portal/PortalProvider';
+import { PortalProvider } from '@/components/Portal/PortalProvider';
import { AlignType } from '@/types/align';
import HoverCardContext from './HoverCardContext';
diff --git a/src/components/common/HoverCard/HoverCardContent.tsx b/src/components/HoverCard/HoverCardContent.tsx
similarity index 93%
rename from src/components/common/HoverCard/HoverCardContent.tsx
rename to src/components/HoverCard/HoverCardContent.tsx
index c9c3e51..1b68f85 100644
--- a/src/components/common/HoverCard/HoverCardContent.tsx
+++ b/src/components/HoverCard/HoverCardContent.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
-import { PortalContent } from '@/components/portal/PortalContent';
+import { PortalContent } from '@/components/Portal/PortalContent';
import { composeEventHandlers, excludeTouchEventHandler } from '@/libs/event';
import useHoverWaiting from './useHoverWaiting';
diff --git a/src/components/common/HoverCard/HoverCardContext.tsx b/src/components/HoverCard/HoverCardContext.tsx
similarity index 100%
rename from src/components/common/HoverCard/HoverCardContext.tsx
rename to src/components/HoverCard/HoverCardContext.tsx
diff --git a/src/components/common/HoverCard/HoverCardToggle.tsx b/src/components/HoverCard/HoverCardToggle.tsx
similarity index 96%
rename from src/components/common/HoverCard/HoverCardToggle.tsx
rename to src/components/HoverCard/HoverCardToggle.tsx
index 08eedd9..cfe5f6e 100644
--- a/src/components/common/HoverCard/HoverCardToggle.tsx
+++ b/src/components/HoverCard/HoverCardToggle.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
-import { PortalContext } from '@/components/portal/PortalContext';
+import { PortalContext } from '@/components/Portal/PortalContext';
import useContext from '@/hooks/useContext';
import { composeEventHandlers, excludeTouchEventHandler } from '@/libs/event';
import { composeRefs } from '@/libs/ref';
diff --git a/src/components/common/HoverCard/index.tsx b/src/components/HoverCard/index.tsx
similarity index 100%
rename from src/components/common/HoverCard/index.tsx
rename to src/components/HoverCard/index.tsx
diff --git a/src/components/common/HoverCard/useHoverWaiting.ts b/src/components/HoverCard/useHoverWaiting.ts
similarity index 94%
rename from src/components/common/HoverCard/useHoverWaiting.ts
rename to src/components/HoverCard/useHoverWaiting.ts
index 3fec963..523a050 100644
--- a/src/components/common/HoverCard/useHoverWaiting.ts
+++ b/src/components/HoverCard/useHoverWaiting.ts
@@ -1,6 +1,6 @@
import React from 'react';
-import { PortalContext } from '@/components/portal/PortalContext';
+import { PortalContext } from '@/components/Portal/PortalContext';
import useContext from '@/hooks/useContext';
import HoverCardContext from './HoverCardContext';
diff --git a/src/components/common/Input/input.test.tsx b/src/components/Input/Input.test.tsx
similarity index 90%
rename from src/components/common/Input/input.test.tsx
rename to src/components/Input/Input.test.tsx
index cae5739..777db1d 100644
--- a/src/components/common/Input/input.test.tsx
+++ b/src/components/Input/Input.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { expect, it } from 'vitest';
import { Input, InputGroup, Label } from '../..';
-import { fireEvent, render, screen } from '../../../libs/test';
+import { fireEvent, render, screen } from '../../libs/test';
describe('Input', () => {
it('Fill out the Input', async () => {
diff --git a/src/components/common/Input/InputDesc.tsx b/src/components/Input/InputDesc.tsx
similarity index 100%
rename from src/components/common/Input/InputDesc.tsx
rename to src/components/Input/InputDesc.tsx
diff --git a/src/components/common/Input/InputGroup.tsx b/src/components/Input/InputGroup.tsx
similarity index 100%
rename from src/components/common/Input/InputGroup.tsx
rename to src/components/Input/InputGroup.tsx
diff --git a/src/components/common/Input/index.tsx b/src/components/Input/index.tsx
similarity index 100%
rename from src/components/common/Input/index.tsx
rename to src/components/Input/index.tsx
diff --git a/src/components/common/Label/index.tsx b/src/components/Label/index.tsx
similarity index 100%
rename from src/components/common/Label/index.tsx
rename to src/components/Label/index.tsx
diff --git a/src/components/portal/PortalContent.tsx b/src/components/Portal/PortalContent.tsx
similarity index 97%
rename from src/components/portal/PortalContent.tsx
rename to src/components/Portal/PortalContent.tsx
index c8a9a6b..d5ec846 100644
--- a/src/components/portal/PortalContent.tsx
+++ b/src/components/Portal/PortalContent.tsx
@@ -3,7 +3,7 @@ import styled from '@emotion/styled';
import React from 'react';
import { createPortal } from 'react-dom';
-import { usePortal } from '@/components/portal/usePortal';
+import { usePortal } from '@/components/Portal/usePortal';
import useContext from '@/hooks/useContext';
import { composeRefs } from '@/libs/ref';
import { PositionType } from '@/types/position';
diff --git a/src/components/portal/PortalContext.tsx b/src/components/Portal/PortalContext.tsx
similarity index 100%
rename from src/components/portal/PortalContext.tsx
rename to src/components/Portal/PortalContext.tsx
diff --git a/src/components/portal/PortalProvider.tsx b/src/components/Portal/PortalProvider.tsx
similarity index 100%
rename from src/components/portal/PortalProvider.tsx
rename to src/components/Portal/PortalProvider.tsx
diff --git a/src/components/portal/type.ts b/src/components/Portal/type.ts
similarity index 100%
rename from src/components/portal/type.ts
rename to src/components/Portal/type.ts
diff --git a/src/components/portal/usePortal.ts b/src/components/Portal/usePortal.ts
similarity index 96%
rename from src/components/portal/usePortal.ts
rename to src/components/Portal/usePortal.ts
index ff3817c..ef3b825 100644
--- a/src/components/portal/usePortal.ts
+++ b/src/components/Portal/usePortal.ts
@@ -1,6 +1,6 @@
import React from 'react';
-import { PortalContext } from '@/components/portal/PortalContext';
+import { PortalContext } from '@/components/Portal/PortalContext';
import { PositionType } from '@/types/position';
export const usePortal = ({ modalRef }: { modalRef: React.RefObject }) => {
diff --git a/src/components/common/Select/select.test.tsx b/src/components/Select/Select.test.tsx
similarity index 97%
rename from src/components/common/Select/select.test.tsx
rename to src/components/Select/Select.test.tsx
index c2c1ed7..0efdd90 100644
--- a/src/components/common/Select/select.test.tsx
+++ b/src/components/Select/Select.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { describe, expect, it } from 'vitest';
import { Select, SelectContent, SelectDivider, SelectItem, SelectLabel, SelectToggle } from '../';
-import { fireEvent, render, screen } from '../../../libs/test';
+import { fireEvent, render, screen } from '../../libs/test';
const items = [
{
diff --git a/src/components/common/Select/Select.tsx b/src/components/Select/Select.tsx
similarity index 91%
rename from src/components/common/Select/Select.tsx
rename to src/components/Select/Select.tsx
index b0aa5e9..056f000 100644
--- a/src/components/common/Select/Select.tsx
+++ b/src/components/Select/Select.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
-import { PortalProvider } from '@/components/portal/PortalProvider';
+import { PortalProvider } from '@/components/Portal/PortalProvider';
import { AlignType } from '@/types/align';
import SelectContext from './SelectContext';
diff --git a/src/components/common/Select/SelectContent.tsx b/src/components/Select/SelectContent.tsx
similarity index 90%
rename from src/components/common/Select/SelectContent.tsx
rename to src/components/Select/SelectContent.tsx
index 354ef7f..cebb819 100644
--- a/src/components/common/Select/SelectContent.tsx
+++ b/src/components/Select/SelectContent.tsx
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
import * as React from 'react';
-import { PortalContent } from '@/components/portal/PortalContent';
+import { PortalContent } from '@/components/Portal/PortalContent';
interface ModalProps extends React.ComponentPropsWithoutRef<'div'> {
width?: React.CSSProperties['width'];
diff --git a/src/components/common/Select/SelectContext.tsx b/src/components/Select/SelectContext.tsx
similarity index 100%
rename from src/components/common/Select/SelectContext.tsx
rename to src/components/Select/SelectContext.tsx
diff --git a/src/components/common/Select/SelectIcon.tsx b/src/components/Select/SelectIcon.tsx
similarity index 100%
rename from src/components/common/Select/SelectIcon.tsx
rename to src/components/Select/SelectIcon.tsx
diff --git a/src/components/common/Select/SelectItem.tsx b/src/components/Select/SelectItem.tsx
similarity index 97%
rename from src/components/common/Select/SelectItem.tsx
rename to src/components/Select/SelectItem.tsx
index 9c0a5e5..828e908 100644
--- a/src/components/common/Select/SelectItem.tsx
+++ b/src/components/Select/SelectItem.tsx
@@ -2,7 +2,7 @@ import { css } from '@emotion/react';
import styled from '@emotion/styled';
import * as React from 'react';
-import { PortalContext } from '@/components/portal/PortalContext';
+import { PortalContext } from '@/components/Portal/PortalContext';
import useContext from '@/hooks/useContext';
import { composeEventHandlers } from '@/libs/event';
diff --git a/src/components/common/Select/SelectToggle.tsx b/src/components/Select/SelectToggle.tsx
similarity index 97%
rename from src/components/common/Select/SelectToggle.tsx
rename to src/components/Select/SelectToggle.tsx
index 8284049..ebc859a 100644
--- a/src/components/common/Select/SelectToggle.tsx
+++ b/src/components/Select/SelectToggle.tsx
@@ -1,8 +1,8 @@
import styled from '@emotion/styled';
import * as React from 'react';
+import { PortalContext } from '@/components/Portal/PortalContext';
import Slot from '@/components/Slot';
-import { PortalContext } from '@/components/portal/PortalContext';
import useContext from '@/hooks/useContext';
import { composeEventHandlers } from '@/libs/event';
import { composeRefs } from '@/libs/ref';
diff --git a/src/components/common/Select/index.tsx b/src/components/Select/index.tsx
similarity index 100%
rename from src/components/common/Select/index.tsx
rename to src/components/Select/index.tsx
diff --git a/src/components/common/Select/type.ts b/src/components/Select/type.ts
similarity index 100%
rename from src/components/common/Select/type.ts
rename to src/components/Select/type.ts
diff --git a/src/components/common/Switch/switch.test.tsx b/src/components/Switch/Switch.test.tsx
similarity index 94%
rename from src/components/common/Switch/switch.test.tsx
rename to src/components/Switch/Switch.test.tsx
index e3dabfe..62fe9f3 100644
--- a/src/components/common/Switch/switch.test.tsx
+++ b/src/components/Switch/Switch.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { expect, it } from 'vitest';
import { Switch } from '../..';
-import { fireEvent, render, screen } from '../../../libs/test';
+import { fireEvent, render, screen } from '../../libs/test';
describe('Switch', () => {
it('Should be change checked value when click the Switch', async () => {
diff --git a/src/components/common/Switch/index.tsx b/src/components/Switch/index.tsx
similarity index 100%
rename from src/components/common/Switch/index.tsx
rename to src/components/Switch/index.tsx
diff --git a/src/components/common/Textarea/textarea.test.tsx b/src/components/Textarea/Textarea.test.tsx
similarity index 91%
rename from src/components/common/Textarea/textarea.test.tsx
rename to src/components/Textarea/Textarea.test.tsx
index 1eddf9b..1154a6d 100644
--- a/src/components/common/Textarea/textarea.test.tsx
+++ b/src/components/Textarea/Textarea.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { expect, it } from 'vitest';
import { InputDesc, InputGroup, Label, Textarea } from '../..';
-import { fireEvent, render, screen } from '../../../libs/test';
+import { fireEvent, render, screen } from '../../libs/test';
describe('Textarea', () => {
it('Fill out the Textarea', async () => {
diff --git a/src/components/common/Textarea/index.tsx b/src/components/Textarea/index.tsx
similarity index 100%
rename from src/components/common/Textarea/index.tsx
rename to src/components/Textarea/index.tsx
diff --git a/src/components/common/Toast/toast.test.tsx b/src/components/Toast/Toast.test.tsx
similarity index 96%
rename from src/components/common/Toast/toast.test.tsx
rename to src/components/Toast/Toast.test.tsx
index e048413..84b2a87 100644
--- a/src/components/common/Toast/toast.test.tsx
+++ b/src/components/Toast/Toast.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { expect, it } from 'vitest';
import { Button, Toaster, useToast } from '../..';
-import { fireEvent, render, screen, waitFor } from '../../../libs/test';
+import { fireEvent, render, screen, waitFor } from '../../libs/test';
import { ToastData } from './type';
const ToastForTest = ({ ...props }: Omit) => {
diff --git a/src/components/common/Toast/Toast.tsx b/src/components/Toast/Toast.tsx
similarity index 100%
rename from src/components/common/Toast/Toast.tsx
rename to src/components/Toast/Toast.tsx
diff --git a/src/components/common/Toast/ToastContext.tsx b/src/components/Toast/ToastContext.tsx
similarity index 100%
rename from src/components/common/Toast/ToastContext.tsx
rename to src/components/Toast/ToastContext.tsx
diff --git a/src/components/common/Toast/Toaster.tsx b/src/components/Toast/Toaster.tsx
similarity index 100%
rename from src/components/common/Toast/Toaster.tsx
rename to src/components/Toast/Toaster.tsx
diff --git a/src/components/common/Toast/index.tsx b/src/components/Toast/index.tsx
similarity index 100%
rename from src/components/common/Toast/index.tsx
rename to src/components/Toast/index.tsx
diff --git a/src/components/common/Toast/type.ts b/src/components/Toast/type.ts
similarity index 100%
rename from src/components/common/Toast/type.ts
rename to src/components/Toast/type.ts
diff --git a/src/components/common/Toast/useToast.tsx b/src/components/Toast/useToast.tsx
similarity index 100%
rename from src/components/common/Toast/useToast.tsx
rename to src/components/Toast/useToast.tsx
diff --git a/src/components/common/Toggle/toggle.test.tsx b/src/components/Toggle/Toggle.test.tsx
similarity index 87%
rename from src/components/common/Toggle/toggle.test.tsx
rename to src/components/Toggle/Toggle.test.tsx
index e2d1803..610cfdf 100644
--- a/src/components/common/Toggle/toggle.test.tsx
+++ b/src/components/Toggle/Toggle.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { expect, it } from 'vitest';
import { Toggle } from '../..';
-import { fireEvent, render, screen } from '../../../libs/test';
+import { fireEvent, render, screen } from '../../libs/test';
describe('Toggle', () => {
it('Should be changed style', async () => {
diff --git a/src/components/common/Toggle/index.tsx b/src/components/Toggle/index.tsx
similarity index 100%
rename from src/components/common/Toggle/index.tsx
rename to src/components/Toggle/index.tsx
diff --git a/src/components/common/Tooltip/tooltip.test.tsx b/src/components/Tooltip/Tooltip.test.tsx
similarity index 95%
rename from src/components/common/Tooltip/tooltip.test.tsx
rename to src/components/Tooltip/Tooltip.test.tsx
index e0e4b65..509c297 100644
--- a/src/components/common/Tooltip/tooltip.test.tsx
+++ b/src/components/Tooltip/Tooltip.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { expect, it } from 'vitest';
import { Button, Tooltip } from '../..';
-import { fireEvent, render, screen, waitFor } from '../../../libs/test';
+import { fireEvent, render, screen, waitFor } from '../../libs/test';
describe('Tooltip', () => {
it('Show Tooltip message when hover component', async () => {
diff --git a/src/components/common/Tooltip/index.tsx b/src/components/Tooltip/index.tsx
similarity index 100%
rename from src/components/common/Tooltip/index.tsx
rename to src/components/Tooltip/index.tsx
diff --git a/src/components/common/Form/form.test.tsx b/src/components/common/Form/form.test.tsx
deleted file mode 100644
index 7e11361..0000000
--- a/src/components/common/Form/form.test.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import '@testing-library/jest-dom';
-import React from 'react';
-import { Route } from 'react-router-dom';
-import { expect, it, vi } from 'vitest';
-
-import { Button, Form, Input, InputDesc, InputGroup, Label, Textarea } from '../../';
-import { MockRouter, fireEvent, render, screen, waitFor } from '../../../libs/test';
-
-describe('Form', () => {
- it('Fill out the Input and Textarea and submit the Form', async () => {
- const handleSubmitFn = vi.fn().mockImplementation(e => e.preventDefault());
-
- render(
-
-
-
-
-
-
-
-
-
- You can @mention other users to link to them.
-
-
-
- }
- />
- Success
} />
- ,
- {},
- );
-
- const emailInput = screen.getByLabelText(/email/i);
- const bioTextarea = screen.getByLabelText(/bio/i);
- const submitBtn = screen.getByText('Save');
-
- fireEvent.change(emailInput, { target: { value: 'bandmator@bandmate.com' } });
- fireEvent.change(bioTextarea, { target: { value: 'Hi, I am Bandmator' } });
-
- fireEvent.click(submitBtn);
-
- await waitFor(() => {
- expect(handleSubmitFn).toHaveBeenCalledTimes(1);
- });
- });
-});
diff --git a/src/components/common/Form/index.tsx b/src/components/common/Form/index.tsx
deleted file mode 100644
index 6290f74..0000000
--- a/src/components/common/Form/index.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { PropsWithChildren } from 'react';
-import { useNavigate, useSearchParams } from 'react-router-dom';
-
-interface FormProps extends React.ComponentProps<'form'>, PropsWithChildren {
- redirect?: string;
-}
-
-export const Form = ({ redirect = '/', ...props }: FormProps) => {
- const navigate = useNavigate();
-
- const [searchParams] = useSearchParams();
- const redirect_to: string = decodeURIComponent(searchParams.get('redirect_to') || redirect);
-
- const handleSubmit = () => {
- console.log('!!');
- navigate(redirect_to);
- };
-
- return (
-
- );
-};
diff --git a/src/components/common/index.ts b/src/components/common/index.ts
deleted file mode 100644
index 97f596b..0000000
--- a/src/components/common/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-export * from './Avatar';
-export * from './Badge';
-export * from './Button';
-export * from './Card';
-export * from './Dialog';
-export * from './Dropdown';
-export * from './Form';
-export * from './HoverCard';
-export * from './Input';
-export * from './Label';
-export * from './Select';
-export * from './Switch';
-export * from './Textarea';
-export * from './Toast';
-export * from './Toggle';
-export * from './Tooltip';
-export * from './Checkbox';
diff --git a/src/components/index.ts b/src/components/index.ts
index 2facc6b..c210f15 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -1,2 +1,18 @@
-export * from './common';
-export { default as BMatesProvider } from './provider/StyledProvider';
+export * from './Avatar';
+export * from './Badge';
+export * from './Button';
+export * from './Card';
+export * from './Dialog';
+export * from './Dropdown';
+export * from './HoverCard';
+export * from './Input';
+export * from './Label';
+export * from './Select';
+export * from './Switch';
+export * from './Textarea';
+export * from './Toast';
+export * from './Toggle';
+export * from './Tooltip';
+export * from './Checkbox';
+
+export { default as BMatesProvider } from './Provider/StyledProvider';