DocSpace-buildtools/packages/components/snackbar/styled-snackbar.js

126 lines
2.4 KiB
JavaScript
Raw Normal View History

2022-02-08 09:54:20 +00:00
import styled, { css } from "styled-components";
2021-07-14 14:12:13 +00:00
import Box from "../box";
2022-02-08 09:54:20 +00:00
import { isMobile } from "react-device-detect";
2022-02-01 08:20:14 +00:00
const StyledIframe = styled.iframe`
border: none;
height: 60px;
width: 100%;
2022-02-08 09:54:20 +00:00
${isMobile &&
css`
min-width: ${(props) => props.sectionWidth + 40 + "px"};
`};
2022-02-01 08:20:14 +00:00
`;
2021-07-14 14:12:13 +00:00
const StyledSnackBar = styled(Box)`
transition: all 500ms ease;
transition-property: top, right, bottom, left, opacity;
font-family: Open Sans, sans-serif, Arial;
font-size: 12px;
min-height: 14px;
position: relative;
display: flex;
align-items: flex-start;
color: white;
line-height: 16px;
padding: 12px 20px;
margin: 0;
2021-07-14 14:12:13 +00:00
opacity: ${(props) => props.opacity || 0};
width: 100%;
2021-07-20 08:07:41 +00:00
background-color: ${(props) => props.backgroundColor};
background-image: url(${(props) => props.backgroundImg || ""});
2021-07-14 14:12:13 +00:00
.text-container {
width: 100%;
2021-07-14 14:12:13 +00:00
display: flex;
flex-direction: column;
gap: 5px;
2022-02-01 08:20:14 +00:00
text-align: ${(props) => props.textalign};
2021-07-14 14:12:13 +00:00
2022-09-19 14:09:31 +00:00
.header-body {
width: 100%;
height: fit-content;
2022-09-19 14:09:31 +00:00
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
justify-content: start;
.text-header {
font-size: 12px;
line-height: 16px;
font-weight: 600;
margin: 0;
}
2021-07-14 14:12:13 +00:00
}
2021-07-26 09:31:56 +00:00
.text-body {
width: 100%;
display: flex;
flex-direction: row;
gap: 10px;
2022-02-01 08:20:14 +00:00
justify-content: ${(props) => props.textalign};
2022-09-19 14:09:31 +00:00
.text {
font-size: 12px;
line-height: 16px;
font-weight: 400;
}
2021-07-26 09:31:56 +00:00
}
2021-07-14 14:12:13 +00:00
}
.action {
background: inherit;
display: inline-block;
border: none;
font-size: inherit;
2022-02-01 08:20:14 +00:00
color: "#333";
margin: 0px 4px 4px 24px;
2023-06-23 06:24:52 +00:00
2021-07-14 14:12:13 +00:00
padding: 0;
2021-07-14 14:12:13 +00:00
min-width: min-content;
cursor: pointer;
margin-left: 12px;
2023-06-23 06:24:52 +00:00
${(props) =>
props.theme.interfaceDirection === "rtl" &&
css`
margin-right: 12px;
margin-left: 4px;
`}
text-decoration: underline;
2021-07-14 14:12:13 +00:00
}
2021-07-26 09:31:56 +00:00
.button {
background: inherit;
border: none;
font-size: 13px;
color: "#000";
cursor: pointer;
2021-10-07 10:56:46 +00:00
line-height: 14px;
2021-07-26 09:31:56 +00:00
text-decoration: underline;
}
2021-07-14 14:12:13 +00:00
`;
2022-02-01 08:20:14 +00:00
const StyledAction = styled.div`
position: absolute;
right: 8px;
top: 8px;
background: inherit;
display: inline-block;
border: none;
font-size: inherit;
color: "#333";
cursor: pointer;
text-decoration: underline;
${isMobile &&
css`
right: 14px;
`};
2022-02-01 08:20:14 +00:00
`;
export { StyledAction, StyledSnackBar, StyledIframe };