DocSpace-buildtools/packages/components/input-phone/styled-input-phone.js

165 lines
3.5 KiB
JavaScript
Raw Normal View History

2022-09-15 12:52:39 +00:00
import Box from "@docspace/components/box";
import styled from "styled-components";
2022-10-03 16:02:00 +00:00
import Base from "../themes/base";
2022-09-15 12:52:39 +00:00
export const StyledBox = styled(Box)`
position: relative;
2022-10-05 14:19:50 +00:00
width: ${(props) => (props.scaled ? "100%" : props.theme.inputPhone.width)};
2022-10-05 13:24:17 +00:00
border: 1px solid ${(props) =>
2022-10-03 16:02:00 +00:00
props.hasError
? props.theme.inputPhone.errorBorderColor
: props.theme.inputPhone.inactiveBorderColor};
2022-09-22 15:03:03 +00:00
border-radius: 3px;
:focus-within {
2022-10-03 16:02:00 +00:00
border-color: ${(props) =>
props.hasError
? props.theme.inputPhone.errorBorderColor
: props.theme.inputPhone.activeBorderColor};
2022-09-22 15:03:03 +00:00
}
2022-09-15 12:52:39 +00:00
2022-10-03 13:41:15 +00:00
.country-box {
width: 57px;
2022-10-03 16:02:00 +00:00
background: ${(props) => props.theme.inputPhone.backgroundColor};
border-radius: 3px;
2022-10-03 13:41:15 +00:00
}
.input-phone {
2022-10-03 16:02:00 +00:00
height: ${(props) => props.theme.inputPhone.height};
2022-10-05 11:36:34 +00:00
padding-left: 20px;
margin-left: -8px;
2022-10-03 16:02:00 +00:00
border-left: 1px solid ${(props) =>
2022-10-05 13:24:17 +00:00
props.theme.inputPhone.inactiveBorderColor};
2022-10-03 13:41:15 +00:00
border-top-left-radius: 0;
border-bottom-left-radius: 0;
2022-10-03 16:02:00 +00:00
background: ${(props) => props.theme.inputPhone.backgroundColor};
2022-10-03 13:41:15 +00:00
}
2022-10-03 09:44:39 +00:00
2022-10-05 11:36:34 +00:00
.prefix {
position: relative;
top: 0;
left: 12px;
font-size: 14px;
font-weight: 400;
}
2022-09-15 12:52:39 +00:00
.combo-button {
2022-09-22 12:20:27 +00:00
width: 100%;
height: 100%;
2022-09-15 12:52:39 +00:00
border-right: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
cursor: pointer;
padding-left: 0;
2022-10-03 09:44:39 +00:00
2022-10-03 06:08:22 +00:00
.invalid-flag {
2022-10-03 09:44:39 +00:00
width: 26px;
height: 20px;
2022-10-03 06:08:22 +00:00
margin-left: 6px;
margin-top: 9px;
}
2022-10-03 09:44:39 +00:00
2022-09-22 12:20:27 +00:00
.forceColor {
width: 36px;
height: 36px;
svg {
path:last-child {
fill: none;
}
}
}
2022-09-15 12:52:39 +00:00
}
2022-10-03 13:41:15 +00:00
2022-09-22 12:20:27 +00:00
.combo-buttons_arrow-icon {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #a3a9ae;
cursor: pointer;
margin: 0;
position: absolute;
top: 21px;
right: 10px;
}
2022-10-03 13:41:15 +00:00
.drop-down {
padding: 12px 16px;
box-sizing: border-box;
margin-top: 5px;
2022-10-03 16:02:00 +00:00
outline: 1px solid ${(props) => props.theme.inputPhone.inactiveBorderColor};
2022-10-03 13:41:15 +00:00
border-radius: 3px;
box-shadow: none;
}
2022-09-15 12:52:39 +00:00
2022-10-05 13:24:17 +00:00
.search-country_input {
2022-10-04 17:09:54 +00:00
.search-input-block {
font-weight: 400;
border-color: ${(props) => props.theme.inputPhone.inactiveBorderColor};
:focus-within {
border-color: ${(props) => props.theme.inputPhone.activeBorderColor};
}
::placeholder {
color: ${(props) => props.theme.inputPhone.placeholderColor}
}
2022-10-03 16:02:00 +00:00
}
2022-10-04 17:09:54 +00:00
2022-10-03 16:02:00 +00:00
}
2022-10-03 13:41:15 +00:00
.country-name {
margin-left: 10px;
2022-10-03 16:02:00 +00:00
color: ${(props) => props.theme.inputPhone.color};
2022-09-22 12:20:27 +00:00
}
2022-09-22 15:03:03 +00:00
2022-10-03 13:41:15 +00:00
.country-dialcode {
margin-left: 5px;
2022-10-03 16:02:00 +00:00
color: ${(props) => props.theme.inputPhone.dialCodeColor};
2022-10-03 09:44:39 +00:00
}
2022-10-03 13:41:15 +00:00
.country-item {
display: flex;
align-items: center;
2022-10-05 13:24:17 +00:00
max-width: 100%;
2022-10-03 13:41:15 +00:00
padding: 0;
2022-09-22 12:20:27 +00:00
height: 36px;
svg {
2022-10-03 13:41:15 +00:00
width: 36px !important;
height: 36px !important;
}
2022-10-03 16:02:00 +00:00
2022-10-03 13:41:15 +00:00
.drop-down-icon > div {
height: 36px;
}
.drop-down-icon {
width: 36px;
height: 36px;
margin-right: 0;
svg {
path:last-child {
fill: none;
}
2022-09-22 12:20:27 +00:00
}
}
}
2022-10-03 13:41:15 +00:00
2022-10-05 13:24:17 +00:00
.phone-input_empty-text {
2022-10-03 16:02:00 +00:00
padding: 30px 0;
2022-10-05 13:24:17 +00:00
word-break: break-all;
2022-10-03 16:02:00 +00:00
color: ${(props) => props.theme.inputPhone.placeholderColor};
}
.nav-thumb-vertical {
background: ${(props) => props.theme.inputPhone.placeholderColor};
cursor: pointer;
:hover {
background: ${(props) => props.theme.inputPhone.scrollBackground};
}
}
2022-10-05 13:24:17 +00:00
.phone-input_error-text {
2022-10-03 13:41:15 +00:00
position: absolute;
2022-10-05 13:24:17 +00:00
word-break: break-all;
2022-10-03 13:41:15 +00:00
top: 48px;
}
}
2022-09-15 12:52:39 +00:00
`;
2022-10-03 16:02:00 +00:00
StyledBox.defaultProps = { theme: Base };