2021-07-30 11:18:11 +00:00
|
|
|
import styled, { css } from "styled-components";
|
2021-02-25 21:19:45 +00:00
|
|
|
import Base from "../themes/base";
|
2021-02-09 08:56:15 +00:00
|
|
|
import Box from "../box";
|
2021-02-24 17:11:23 +00:00
|
|
|
import CrossSidebarIcon from "../../../public/images/cross.sidebar.react.svg";
|
2021-02-09 08:56:15 +00:00
|
|
|
|
|
|
|
const Dialog = styled.div`
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
cursor: default;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
width: ${(props) => props.theme.modalDialog.width};
|
|
|
|
max-width: ${(props) => props.theme.modalDialog.maxwidth};
|
|
|
|
margin: ${(props) => props.theme.modalDialog.margin};
|
|
|
|
min-height: ${(props) => props.theme.modalDialog.minHeight};
|
|
|
|
`;
|
|
|
|
Dialog.defaultProps = { theme: Base };
|
|
|
|
|
|
|
|
const Content = styled.div`
|
|
|
|
position: relative;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
height: ${(props) => props.contentHeight};
|
|
|
|
width: ${(props) => props.contentWidth};
|
|
|
|
background-color: ${(props) =>
|
|
|
|
props.theme.modalDialog.content.backgroundColor};
|
2021-11-15 09:54:10 +00:00
|
|
|
padding: ${(props) =>
|
|
|
|
props.displayType === "modal"
|
|
|
|
? props.theme.modalDialog.content.modalPadding
|
|
|
|
: props.theme.modalDialog.content.asidePadding};
|
2021-11-26 14:37:27 +00:00
|
|
|
border-radius: ${(props) =>
|
|
|
|
props.theme.modalDialog.content.modalBorderRadius};
|
2021-02-09 08:56:15 +00:00
|
|
|
|
|
|
|
.heading {
|
|
|
|
max-width: ${(props) => props.theme.modalDialog.content.heading.maxWidth};
|
|
|
|
margin: ${(props) => props.theme.modalDialog.content.heading.margin};
|
|
|
|
line-height: ${(props) =>
|
2021-11-15 09:54:10 +00:00
|
|
|
props.displayType === "modal"
|
|
|
|
? props.theme.modalDialog.content.heading.modalLineHeight
|
|
|
|
: props.theme.modalDialog.content.heading.asideLineHeight};
|
2021-02-09 08:56:15 +00:00
|
|
|
font-weight: ${(props) =>
|
|
|
|
props.theme.modalDialog.content.heading.fontWeight};
|
2021-11-15 09:54:10 +00:00
|
|
|
font-size: ${(props) =>
|
|
|
|
props.displayType === "modal"
|
|
|
|
? props.theme.modalDialog.content.heading.modalFontSize
|
|
|
|
: props.theme.modalDialog.content.heading.asideFontSize};
|
2021-02-09 08:56:15 +00:00
|
|
|
}
|
2021-07-30 11:18:11 +00:00
|
|
|
|
|
|
|
${(props) =>
|
|
|
|
props.removeScroll &&
|
|
|
|
css`
|
|
|
|
overflow: hidden;
|
|
|
|
`}
|
2021-02-09 08:56:15 +00:00
|
|
|
`;
|
|
|
|
Content.defaultProps = { theme: Base };
|
|
|
|
|
|
|
|
const StyledHeader = styled.div`
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
border-bottom: ${(props) => props.theme.modalDialog.header.borderBottom};
|
|
|
|
`;
|
|
|
|
StyledHeader.defaultProps = { theme: Base };
|
|
|
|
|
2021-02-20 08:46:32 +00:00
|
|
|
const CloseButton = styled(CrossSidebarIcon)`
|
2021-02-09 08:56:15 +00:00
|
|
|
cursor: pointer;
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
width: ${(props) => props.theme.modalDialog.closeButton.width};
|
|
|
|
height: ${(props) => props.theme.modalDialog.closeButton.height};
|
|
|
|
min-width: ${(props) => props.theme.modalDialog.closeButton.minWidth};
|
|
|
|
min-height: ${(props) => props.theme.modalDialog.closeButton.minHeight};
|
|
|
|
|
|
|
|
right: ${(props) => props.theme.modalDialog.closeButton.right};
|
|
|
|
top: ${(props) => props.theme.modalDialog.closeButton.top};
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
path {
|
2021-11-29 08:58:54 +00:00
|
|
|
stroke: ${(props) => props.theme.modalDialog.closeButton.hoverColor};
|
2021-02-09 08:56:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2021-03-02 08:25:11 +00:00
|
|
|
CloseButton.defaultProps = { theme: Base };
|
2021-02-09 08:56:15 +00:00
|
|
|
|
|
|
|
const BodyBox = styled(Box)`
|
|
|
|
position: relative;
|
2021-07-30 11:18:11 +00:00
|
|
|
|
|
|
|
${(props) =>
|
|
|
|
props.removeScroll &&
|
|
|
|
css`
|
|
|
|
height: 100%;
|
|
|
|
`}
|
2021-02-09 08:56:15 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export { CloseButton, StyledHeader, Content, Dialog, BodyBox };
|