2021-11-04 22:19:38 +08:00
|
|
|
import styled from 'styled-components';
|
2022-02-15 04:20:50 +08:00
|
|
|
import Button from '/imports/ui/components/common/button/component';
|
2021-11-04 22:19:38 +08:00
|
|
|
import {
|
2023-02-15 00:50:07 +08:00
|
|
|
jumboPaddingY,
|
2021-11-04 22:19:38 +08:00
|
|
|
smPaddingX,
|
|
|
|
smPaddingY,
|
|
|
|
lgPaddingX,
|
|
|
|
borderRadius,
|
|
|
|
borderSize,
|
|
|
|
pollInputHeight,
|
|
|
|
pollSmMargin,
|
|
|
|
pollMdMargin,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
import {
|
|
|
|
colorText,
|
|
|
|
colorBlueLight,
|
|
|
|
colorGrayLight,
|
|
|
|
colorGrayLighter,
|
|
|
|
colorGrayLightest,
|
|
|
|
colorDanger,
|
2022-03-22 01:58:11 +08:00
|
|
|
colorWarning,
|
2021-11-04 22:19:38 +08:00
|
|
|
colorHeading,
|
|
|
|
colorPrimary,
|
|
|
|
colorGrayDark,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/palette';
|
|
|
|
import { fontSizeBase, fontSizeSmall } from '/imports/ui/stylesheets/styled-components/typography';
|
|
|
|
|
|
|
|
const ToggleLabel = styled.span`
|
|
|
|
margin-right: ${smPaddingX};
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin: 0 0 0 ${smPaddingX};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const PollOptionInput = styled.input`
|
|
|
|
margin-right: 1rem;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin-right: 0;
|
|
|
|
margin-left: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
border-radius: ${borderSize};
|
|
|
|
box-shadow: 0 0 0 ${borderSize} ${colorBlueLight}, inset 0 0 0 1px ${colorPrimary};
|
|
|
|
}
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
color: ${colorText};
|
|
|
|
-webkit-appearance: none;
|
|
|
|
padding: calc(${smPaddingY} * 2) ${smPaddingX};
|
|
|
|
border-radius: ${borderRadius};
|
|
|
|
font-size: ${fontSizeBase};
|
|
|
|
border: 1px solid ${colorGrayLighter};
|
|
|
|
box-shadow: 0 0 0 1px ${colorGrayLighter};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const DeletePollOptionButton = styled(Button)`
|
|
|
|
font-size: ${fontSizeBase};
|
|
|
|
flex: none;
|
|
|
|
width: 40px;
|
|
|
|
position: relative;
|
|
|
|
& > i {
|
|
|
|
font-size: 150%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ErrorSpacer = styled.div`
|
|
|
|
position: relative;
|
|
|
|
height: 1.25rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const InputError = styled(ErrorSpacer)`
|
|
|
|
color: ${colorDanger};
|
|
|
|
font-size: ${fontSizeSmall};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Instructions = styled.div`
|
|
|
|
margin-bottom: ${lgPaddingX};
|
|
|
|
color: ${colorText};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const PollQuestionArea = styled.textarea`
|
|
|
|
resize: none;
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
border-radius: ${borderSize};
|
|
|
|
box-shadow: 0 0 0 ${borderSize} ${colorBlueLight}, inset 0 0 0 1px ${colorPrimary};
|
|
|
|
}
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
color: ${colorText};
|
|
|
|
-webkit-appearance: none;
|
|
|
|
padding: calc(${smPaddingY} * 2) ${smPaddingX};
|
|
|
|
border-radius: ${borderRadius};
|
|
|
|
font-size: ${fontSizeBase};
|
|
|
|
border: 1px solid ${colorGrayLighter};
|
|
|
|
box-shadow: 0 0 0 1px ${colorGrayLighter};
|
|
|
|
|
|
|
|
${({ hasError }) => hasError && `
|
|
|
|
border-color: ${colorDanger};
|
|
|
|
box-shadow: 0 0 0 1px ${colorDanger};
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const SectionHeading = styled.h4`
|
|
|
|
margin-top: 0;
|
|
|
|
font-weight: 600;
|
|
|
|
color: ${colorHeading};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ResponseType = styled.div`
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-flow: wrap;
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: ${lgPaddingX};
|
|
|
|
|
|
|
|
& > button {
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const PollConfigButton = styled(Button)`
|
|
|
|
border: solid ${colorGrayLight} 1px;
|
|
|
|
min-height: ${pollInputHeight};
|
|
|
|
font-size: ${fontSizeBase};
|
|
|
|
white-space: pre-wrap;
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
|
|
& > span {
|
|
|
|
&:hover {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
${({ selected }) => selected && `
|
|
|
|
background-color: ${colorGrayLightest};
|
|
|
|
font-size: ${fontSizeBase};
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
|
|
|
background-color: ${colorGrayLightest} !important;
|
|
|
|
box-shadow: none !important;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
|
|
|
|
${({ small }) => small && `
|
|
|
|
width: 49% !important;
|
|
|
|
`}
|
|
|
|
|
|
|
|
${({ full }) => full && `
|
|
|
|
width: 100%;
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const PollParagraph = styled.div`
|
|
|
|
color: ${colorText};
|
2022-04-29 04:18:35 +08:00
|
|
|
margin-bottom: 0.9rem;
|
2021-11-04 22:19:38 +08:00
|
|
|
`;
|
|
|
|
|
2021-11-06 01:29:46 +08:00
|
|
|
const PollCheckbox = styled.div`
|
2021-11-04 22:19:38 +08:00
|
|
|
display: inline-block;
|
|
|
|
margin-right: ${pollSmMargin};
|
|
|
|
margin-bottom: ${pollMdMargin};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const AddItemButton = styled(Button)`
|
|
|
|
top: 1px;
|
|
|
|
position: relative;
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
text-align: left;
|
|
|
|
color: ${colorPrimary};
|
|
|
|
padding-left: 0;
|
|
|
|
padding-right: 0;
|
|
|
|
font-size: ${fontSizeBase};
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
& > span {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Row = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-flow: wrap;
|
|
|
|
flex-grow: 1;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin-top: 0.7rem;
|
|
|
|
margin-bottom: 0.7rem;
|
|
|
|
`;
|
|
|
|
|
2022-03-22 01:58:11 +08:00
|
|
|
const Warning = styled.div`
|
|
|
|
color: ${colorWarning};
|
|
|
|
font-size: ${fontSizeSmall};
|
|
|
|
`;
|
|
|
|
|
2022-04-29 04:18:35 +08:00
|
|
|
const CustomInputRow = styled.div`
|
2022-03-22 01:58:11 +08:00
|
|
|
display: flex;
|
2022-11-22 20:09:35 +08:00
|
|
|
flex-flow: nowrap;
|
2022-03-22 01:58:11 +08:00
|
|
|
flex-grow: 1;
|
|
|
|
justify-content: space-between;
|
|
|
|
`;
|
|
|
|
|
2021-11-04 22:19:38 +08:00
|
|
|
const Col = styled.div`
|
|
|
|
display: flex;
|
|
|
|
position: relative;
|
|
|
|
flex-flow: column;
|
|
|
|
flex-grow: 1;
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
padding-right: 0;
|
|
|
|
padding-left: 1rem;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
padding-right: 0.1rem;
|
|
|
|
padding-left: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Toggle = styled.label`
|
|
|
|
margin-left: auto;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StartPollBtn = styled(Button)`
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
min-height: ${pollInputHeight};
|
|
|
|
margin-top: 1rem;
|
|
|
|
font-size: ${fontSizeBase};
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
& > span {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const NoSlidePanelContainer = styled.div`
|
|
|
|
color: ${colorGrayDark};
|
|
|
|
text-align: center;
|
|
|
|
`;
|
|
|
|
|
2024-01-30 21:29:12 +08:00
|
|
|
const PollButton = styled(Button)``;
|
2021-11-04 22:19:38 +08:00
|
|
|
|
|
|
|
const DragAndDropPollContainer = styled.div`
|
|
|
|
width: 200px !important;
|
|
|
|
height: 200px !important;
|
|
|
|
`;
|
|
|
|
|
2022-04-29 04:18:35 +08:00
|
|
|
const Question = styled.div`
|
|
|
|
margin-bottom: ${lgPaddingX};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const OptionWrapper = styled.div`
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ResponseArea = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-flow: column wrap;
|
|
|
|
`;
|
|
|
|
|
2022-11-22 20:09:35 +08:00
|
|
|
const CustomInputHeading = styled(SectionHeading)`
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2023-02-15 00:50:07 +08:00
|
|
|
padding-bottom: ${jumboPaddingY};
|
2022-11-22 20:09:35 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const CustomInputHeadingCol = styled(Col)`
|
|
|
|
overflow: hidden;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const CustomInputToggleCol = styled(Col)`
|
|
|
|
flex-shrink: 0;
|
|
|
|
`;
|
|
|
|
|
2022-11-23 22:09:38 +08:00
|
|
|
const AnonymousHeading = styled(CustomInputHeading)``;
|
|
|
|
|
|
|
|
const AnonymousHeadingCol = styled(CustomInputHeadingCol)``;
|
|
|
|
|
|
|
|
const AnonymousToggleCol = styled(CustomInputToggleCol)``;
|
|
|
|
|
|
|
|
const AnonymousRow = styled(Row)`
|
|
|
|
flex-flow: nowrap;
|
|
|
|
width: 100%;
|
|
|
|
`;
|
|
|
|
|
2021-11-04 22:19:38 +08:00
|
|
|
export default {
|
|
|
|
ToggleLabel,
|
|
|
|
PollOptionInput,
|
|
|
|
DeletePollOptionButton,
|
|
|
|
ErrorSpacer,
|
|
|
|
InputError,
|
|
|
|
Instructions,
|
|
|
|
PollQuestionArea,
|
|
|
|
SectionHeading,
|
|
|
|
ResponseType,
|
|
|
|
PollConfigButton,
|
|
|
|
PollParagraph,
|
|
|
|
PollCheckbox,
|
|
|
|
AddItemButton,
|
|
|
|
Row,
|
|
|
|
Col,
|
|
|
|
Toggle,
|
|
|
|
StartPollBtn,
|
|
|
|
NoSlidePanelContainer,
|
|
|
|
PollButton,
|
|
|
|
DragAndDropPollContainer,
|
2022-03-22 01:58:11 +08:00
|
|
|
Warning,
|
2022-04-29 04:18:35 +08:00
|
|
|
CustomInputRow,
|
|
|
|
Question,
|
|
|
|
OptionWrapper,
|
|
|
|
ResponseArea,
|
2022-11-22 20:09:35 +08:00
|
|
|
CustomInputHeading,
|
|
|
|
CustomInputHeadingCol,
|
|
|
|
CustomInputToggleCol,
|
2022-11-23 22:09:38 +08:00
|
|
|
AnonymousHeading,
|
|
|
|
AnonymousHeadingCol,
|
|
|
|
AnonymousToggleCol,
|
|
|
|
AnonymousRow,
|
2021-11-04 22:19:38 +08:00
|
|
|
};
|