Skip to content

Commit

Permalink
refactor: pull up common path
Browse files Browse the repository at this point in the history
  • Loading branch information
kyechan99 committed Mar 11, 2024
1 parent 831e6e4 commit 700b4bb
Show file tree
Hide file tree
Showing 63 changed files with 43 additions and 120 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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.', () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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<HTMLDivElement> }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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'];
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ToastData, 'toastId'>) => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
File renamed without changes.
52 changes: 0 additions & 52 deletions src/components/common/Form/form.test.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions src/components/common/Form/index.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions src/components/common/index.ts

This file was deleted.

20 changes: 18 additions & 2 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit 700b4bb

Please sign in to comment.