2024-06-05 19:26:27 +08:00
|
|
|
import styled, { css, keyframes } from 'styled-components';
|
2022-02-15 04:20:50 +08:00
|
|
|
import Button from '/imports/ui/components/common/button/component';
|
2021-11-09 22:33:40 +08:00
|
|
|
import { smallOnly } from '/imports/ui/stylesheets/styled-components/breakpoints';
|
2024-08-09 07:52:50 +08:00
|
|
|
import {
|
|
|
|
borderSizeSmall,
|
|
|
|
mdPaddingX,
|
|
|
|
mdPaddingY,
|
|
|
|
jumboPaddingX,
|
2024-08-23 11:05:10 +08:00
|
|
|
jumboPaddingY,
|
2024-08-09 07:52:50 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
import {
|
|
|
|
colorGrayLightest,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/palette';
|
|
|
|
import {
|
|
|
|
lineHeightComputed,
|
|
|
|
fontSizeSmall,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/typography';
|
2021-11-09 22:33:40 +08:00
|
|
|
|
|
|
|
const FormWrapper = styled.div`
|
2024-06-05 19:26:27 +08:00
|
|
|
min-width: 100%;
|
2021-11-09 22:33:40 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const Form = styled.div`
|
2024-08-09 07:52:50 +08:00
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 2fr 1fr;
|
|
|
|
margin: ${mdPaddingY} ${mdPaddingX} 0 ${mdPaddingX};
|
|
|
|
column-gap: ${jumboPaddingX};
|
|
|
|
row-gap: ${mdPaddingY};
|
|
|
|
@media ${smallOnly} {
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
grid-template-rows: auto;
|
|
|
|
}
|
2021-11-09 22:33:40 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const AudioNote = styled.div`
|
2024-08-15 11:30:18 +08:00
|
|
|
display: block;
|
2024-08-23 11:05:10 +08:00
|
|
|
margin: 0 ${mdPaddingX} ${jumboPaddingY} ${mdPaddingX};
|
2024-06-05 19:26:27 +08:00
|
|
|
text-align: center;
|
2021-11-09 22:33:40 +08:00
|
|
|
@media ${smallOnly} {
|
2024-08-09 07:52:50 +08:00
|
|
|
font-size: ${fontSizeSmall};
|
2021-11-09 22:33:40 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const FormElement = styled.div`
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-flow: column;
|
|
|
|
flex-grow: 1;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const LabelSmall = styled.label`
|
|
|
|
color: black;
|
2024-08-09 07:52:50 +08:00
|
|
|
font-size: ${fontSizeSmall};
|
2021-11-09 22:33:40 +08:00
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
& > :first-child {
|
2024-08-09 07:52:50 +08:00
|
|
|
margin: 0.5rem 0 0 0 !important;
|
2021-11-09 22:33:40 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-04-05 05:09:35 +08:00
|
|
|
const LabelSmallFullWidth = styled(LabelSmall)`
|
|
|
|
width: 100%;
|
|
|
|
`;
|
|
|
|
|
2024-08-09 07:52:50 +08:00
|
|
|
const EnterAudio = styled.div`
|
|
|
|
margin: 0 ${mdPaddingX} 0 0;
|
2021-11-09 22:33:40 +08:00
|
|
|
display: flex;
|
2024-08-09 07:52:50 +08:00
|
|
|
justify-content: flex-end;
|
2021-11-09 22:33:40 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
2024-08-09 07:52:50 +08:00
|
|
|
margin: 0 0 0 ${mdPaddingX};
|
2021-11-09 22:33:40 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const BackButton = styled(Button)`
|
|
|
|
border: none;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
2024-08-09 07:52:50 +08:00
|
|
|
margin: 0 0 0 ${mdPaddingX};
|
2021-11-09 22:33:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&:first-child {
|
|
|
|
margin: 0 0.5rem 0 0 !important;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-06-05 19:26:27 +08:00
|
|
|
const ellipsis = keyframes`
|
|
|
|
to {
|
|
|
|
width: 1.5em;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const FetchingAnimation = styled.span`
|
|
|
|
margin: auto;
|
|
|
|
display: inline-block;
|
|
|
|
width: 1.5em;
|
|
|
|
|
|
|
|
&:after {
|
|
|
|
overflow: hidden;
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: bottom;
|
|
|
|
content: "\\2026"; /* ascii code for the ellipsis character */
|
|
|
|
width: 0;
|
|
|
|
margin-left: 0.25em;
|
|
|
|
|
|
|
|
${({ animations }) => animations && css`
|
|
|
|
animation: ${ellipsis} steps(4, end) 900ms infinite;
|
|
|
|
`}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-08-09 07:52:50 +08:00
|
|
|
const BottomSeparator = styled.div`
|
|
|
|
position: relative;
|
|
|
|
width: inherit;
|
|
|
|
height: ${borderSizeSmall};
|
|
|
|
background-color: ${colorGrayLightest};
|
|
|
|
margin: calc(${lineHeightComputed} * 1.25) ${mdPaddingX} calc(${lineHeightComputed} * 1.25) ${mdPaddingX};
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
2021-11-09 22:33:40 +08:00
|
|
|
export default {
|
2024-08-09 07:52:50 +08:00
|
|
|
BottomSeparator,
|
2021-11-09 22:33:40 +08:00
|
|
|
FormWrapper,
|
|
|
|
Form,
|
|
|
|
EnterAudio,
|
|
|
|
AudioNote,
|
|
|
|
FormElement,
|
|
|
|
LabelSmall,
|
2022-04-05 05:09:35 +08:00
|
|
|
LabelSmallFullWidth,
|
2021-11-09 22:33:40 +08:00
|
|
|
BackButton,
|
2024-06-05 19:26:27 +08:00
|
|
|
FetchingAnimation,
|
2021-11-09 22:33:40 +08:00
|
|
|
};
|