diff --git a/src/index.ts b/src/index.ts index 2055b63..8aed736 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,7 +21,4 @@ export { ModalWindow } from "./ModalWindow" export { ModalContainer } from "./ModalContainer" export { useModalWindow, useModalSnapshot } from "./hooks" -export { default as DrawerLayout } from "./layouts/DrawerLayout" -export { default as PopupLayout } from "./layouts/PopupLayout" - export { ModalPortal } from "./ModalPortal" diff --git a/src/layouts/DrawerLayout.tsx b/src/layouts/DrawerLayout.tsx deleted file mode 100644 index 6f1d1c8..0000000 --- a/src/layouts/DrawerLayout.tsx +++ /dev/null @@ -1,49 +0,0 @@ -/* - -MIT License - -Copyright (c) 2023 Valery Zinchenko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -*/ - -import { ReactNode } from "react" - -import { useModalWindow } from "../hooks" - -interface DrawerLayoutProps { - width?: string; - children: ReactNode; -} - -function DrawerLayout(props: DrawerLayoutProps) { - const modal = useModalWindow() - - return ( -
-
- {modal.params.closable && ( - - )} -
{props.children}
-
-
- ) -} - -export default DrawerLayout diff --git a/src/layouts/PopupLayout.tsx b/src/layouts/PopupLayout.tsx deleted file mode 100644 index 8acdef3..0000000 --- a/src/layouts/PopupLayout.tsx +++ /dev/null @@ -1,49 +0,0 @@ -/* - -MIT License - -Copyright (c) 2023 Valery Zinchenko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -*/ - -import { ReactNode } from "react" - -import { useModalWindow } from "../hooks" - -interface PopupLayoutProps { - width?: string; - children: ReactNode; -} - -function PopupLayout(props: PopupLayoutProps) { - const modal = useModalWindow() - - return ( -
-
- {modal.params.closable && ( - - )} -
{props.children}
-
-
- ) -} - -export default PopupLayout diff --git a/src/layouts/react-extension.d.ts b/src/layouts/react-extension.d.ts deleted file mode 100644 index a1da09e..0000000 --- a/src/layouts/react-extension.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare global { - namespace React { - interface CSSProperties { - // Allow writing CSS Variables - [key: `--${string}`]: string | number | null | undefined - } - } -} - -export { } diff --git a/styles/layouts.scss b/styles/layouts.scss deleted file mode 100644 index cc38a97..0000000 --- a/styles/layouts.scss +++ /dev/null @@ -1,106 +0,0 @@ -/* - -MIT License - -Copyright (c) 2023 Valery Zinchenko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -*/ - -/* Drawer Layout */ - -.drawer-layout { - position: relative; - - padding: 3.5em 2em; - background: white; - - height: 100%; - min-width: 20em; - width: var(--drawer-width, auto); - max-width: 50vw; - - margin-left: auto; - overflow: auto; - overflow: overlay; - overscroll-behavior: contain; - - color: #333; - box-shadow: 0px 0px 20px 10px rgba(black, 0.1); - cursor: initial; - - transition: 250ms ease right; - right: -5em; - -} - -.modal--active .drawer-layout { - right: 0em; -} - -.drawer-layout__close { - margin-left: auto; - - position: absolute; - top: 1.25em; - right: 1.25em; -} - -.drawer-layout__container { - display: grid; - gap: 2.5em; -} - -/* Popup Layout */ - -.popup-layout { - position: relative; - - padding: 2em; - background: white; - border-radius: 1em; - - min-width: 20em; - width: var(--popup-width, auto); - max-width: 75vw; - - max-height: 90vh; - - margin: auto; - overflow: auto; - overflow: overlay; - overscroll-behavior: contain; - - color: #333; - box-shadow: 0px 0px 20px 10px rgba(black, 0.1); - cursor: initial; - - transition: 250ms ease top; - top: -2.5em; -} - -.modal--active .popup-layout { - top: 0em; -} - -.popup-layout__close { - margin-left: auto; - - position: absolute; - top: 1.25em; - right: 1.5em; -} - -.popup-layout__container { - display: grid; - gap: 2.5em; -} \ No newline at end of file