Skip to content

Commit

Permalink
feat: Snackbar 제거 및 TransitionMotion 컴포넌트 추가 (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-moon authored Jul 31, 2021
1 parent f01a4d6 commit 3900839
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 566 deletions.
Binary file modified .yarn/cache/react-spring-npm-8.0.27-e2e99c79a8-8f041fd303.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"url": "https://github.com/Lubycon/lubycon-ui-kit.git"
},
"keywords": [
"lubycon"
"lubycon",
"ui",
"ui kit",
"design system"
],
"author": "Lubycon",
"dependencies": {
Expand Down
5 changes: 1 addition & 4 deletions src/components/LubyconUIKitProvider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { ReactNode } from 'react';
import { PortalProvider } from 'contexts/Portal';
import { SnackbarProvider } from 'contexts/Snackbar';
import { OverlayProvider } from 'contexts/Overlay';

interface Props {
Expand All @@ -10,9 +9,7 @@ interface Props {
function LubyconUIKitProvider({ children }: Props) {
return (
<PortalProvider>
<OverlayProvider>
<SnackbarProvider>{children}</SnackbarProvider>
</OverlayProvider>
<OverlayProvider>{children}</OverlayProvider>
</PortalProvider>
);
}
Expand Down
29 changes: 0 additions & 29 deletions src/components/Snackbar/SnackbarBody.tsx

This file was deleted.

109 changes: 0 additions & 109 deletions src/components/Snackbar/index.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions src/components/Snackbar/utils.ts

This file was deleted.

52 changes: 52 additions & 0 deletions src/components/TransitionMotion/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React, { CSSProperties, ElementType, PropsWithChildren } from 'react';
import { TransitionKeyProps, useTransition, animated } from 'react-spring';
import { OverridableProps } from 'src/types/OverridableProps';

type Props<E extends ElementType = 'div'> = OverridableProps<
E,
{
flag: boolean;
keys?: TransitionKeyProps | TransitionKeyProps[] | null;
from?: Partial<CSSProperties>;
enter?: Partial<CSSProperties> | Partial<CSSProperties>[];
leave?: Partial<CSSProperties> | Partial<CSSProperties>[];
onStart?: () => void;
onDestroyed?: () => void;
}
>;
const TransitionMotion = ({
flag,
keys = null,
from,
enter,
leave,
children,
onStart,
onDestroyed,
as,
style,
...rest
}: PropsWithChildren<Props>) => {
const transitions = useTransition(flag, keys, {
from,
enter,
leave,
onStart,
onDestroyed,
});
const Component = animated[as ?? 'div'];

return (
<>
{transitions.map(({ item, key, props }) => {
return item ? (
<Component key={key} {...rest} style={{ ...style, ...props }}>
{children}
</Component>
) : null;
})}
</>
);
};

export default TransitionMotion;
112 changes: 0 additions & 112 deletions src/contexts/Snackbar.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ export {
CardImageContent,
CardFooter,
} from './components/Card';
export { default as Snackbar } from './components/Snackbar';
export { default as Input } from './components/Input';
export { default as Accordion } from './components/Accordion';
export { Portal } from './contexts/Portal';
export { useSnackbar } from './contexts/Snackbar';
export { colors } from './constants/colors';
export { default as Icon } from './components/Icon';
export { default as Shadow } from './components/Shadow';
export { default as Spacing } from './components/Spacing';
export { default as useProgress } from './hooks/useProgress';
export { default as useResizeObserver } from './hooks/useResizeObserver';
export { useOverlay } from './contexts/Overlay';
export { default as TransitionMotion } from './components/TransitionMotion';
Loading

0 comments on commit 3900839

Please sign in to comment.