Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-04-22 13:32:21 +02:00
parent d71235a0c1
commit 81454df46f
27 changed files with 121 additions and 119 deletions

View File

@ -4,6 +4,7 @@
**/OLD/**
testApp/**
examples/**
cypress/**
packages/strapi-generate-plugin/files/admin/src/**
packages/strapi-helper-plugin/**
packages/strapi-plugin-users-permissions/admin/**

View File

@ -64,9 +64,14 @@ module.exports = {
{
flatTernaryExpressions: false,
SwitchCase: 1,
ignoredNodes: ['ConditionalExpression', "VariableDeclarator[kind='const']"],
ignoredNodes: [
'ConditionalExpression',
"VariableDeclarator[kind='const']",
'TemplateLiteral',
],
},
],
'template-curly-spacing': 0,
'func-names': ['error', 'never'],
'function-paren-newline': 0,
'implicit-arrow-linebreak': 0,

View File

@ -64,7 +64,7 @@ const GlobalNotification = createGlobalStyle`
.notificationSuccess{
background: linear-gradient(100deg , #FFFFFF 50%, rgba(39, 183, 15, .05)), ${props =>
props.theme.main.colors.white};
props.theme.main.colors.white};
}
.notificationWarning {
@ -91,7 +91,7 @@ const GlobalNotification = createGlobalStyle`
.notificationInfo {
background: linear-gradient(100deg , #FFFFFF 50%, rgba(28, 93, 231, .05)), ${props =>
props.theme.main.colors.white};
props.theme.main.colors.white};
.notificationIcon:before {
border-color: ${props => props.theme.main.colors.blue};

View File

@ -11,15 +11,15 @@ const MenuDropdown = styled(DropdownMenu)`
transform: translate3d(-178px, 28px, 0px) !important;
${({ isopen }) => {
if (isopen === 'true') {
return `
if (isopen === 'true') {
return `
border-top-color: #aed4fb !important;
border-top-right-radius: 0;
`;
}
}
return '';
}}
return '';
}}
`;
export default MenuDropdown;

View File

@ -18,9 +18,9 @@ const Toggle = styled(DropdownToggle)`
}
${({ isopen }) => {
// Fix react warning
if (isopen === 'true') {
return `
// Fix react warning
if (isopen === 'true') {
return `
background: #e6f0fb;
border: 1px solid #aed4fb !important;
border-radius: 2px;
@ -52,9 +52,9 @@ const Toggle = styled(DropdownToggle)`
border: 1px solid #aed4fb;
}
`;
}
}
return `
return `
background: #ffffff !important;
border: 1px solid #e3e9f3;
border-radius: 2px !important;
@ -81,7 +81,7 @@ const Toggle = styled(DropdownToggle)`
border: 1px solid #e3e9f3;
}
`;
}}
}}
`;
export default Toggle;

View File

@ -9,20 +9,20 @@ const NameWrapper = styled.div`
cursor: pointer;
${({ isOverEditBlock, isOverRemove, isSelected }) => {
if (isOverRemove) {
return `
if (isOverRemove) {
return `
color: #f64d0a;
`;
}
}
if (isSelected || isOverEditBlock) {
return `
if (isSelected || isOverEditBlock) {
return `
color: #007eff;
`;
}
}
return '';
}}
return '';
}}
`;
export default NameWrapper;

View File

@ -9,7 +9,7 @@ const RemoveWrapper = styled.div`
width: 30px;
text-align: center;
background-color: ${({ isOverEditBlock, isOverRemove, isSelected }) =>
getColor(isOverRemove, isSelected, isOverEditBlock)};
getColor(isOverRemove, isSelected, isOverEditBlock)};
cursor: pointer;
position: absolute;

View File

@ -3,16 +3,16 @@ import styled from 'styled-components';
const Carret = styled.div`
position: absolute;
${({ right }) => {
if (right) {
return `
if (right) {
return `
right: -4px;
`;
}
}
return `
return `
left: -1px;
`;
}}
}}
height: 100%;
width: 2px;
margin-right: 3px;

View File

@ -14,17 +14,17 @@ const Button = styled(PlusButton)`
}
${({ hasError }) => {
if (hasError) {
return `
if (hasError) {
return `
background-color: #FAA684;
:before, :after {
background-color: #F64D0A;
}
`;
}
}
return '';
}}
return '';
}}
&.isOpen {
transform: rotate(-45deg);
}

View File

@ -12,7 +12,7 @@ const ComponentsPicker = styled.div`
}
${({ isOpen }) =>
isOpen &&
isOpen &&
css`
max-height: 260px;
`}

View File

@ -7,14 +7,14 @@ const Wrapper = styled.div`
}
${({ isFromDynamicZone }) => {
if (isFromDynamicZone) {
return `
if (isFromDynamicZone) {
return `
background-color: #fff;
`;
}
}
return '';
}}
return '';
}}
`;
export default Wrapper;

View File

@ -37,20 +37,19 @@ const Flex = styled.div`
const Div = styled.div`
width: calc(100% + 60px);
margin: ${props =>
props.show ? '-100px -30px 30px' : `-${props.number}px -30px 103px`};
margin: ${props => (props.show ? '-100px -30px 30px' : `-${props.number}px -30px 103px`)};
background: #fff;
box-shadow: 3px 2px 4px #e3e9f3;
padding: 18px 30px 0px 30px;
transition: ${props => {
if (props.anim) {
return props.show
if (props.anim) {
return props.show
? 'margin-top .3s ease-out, margin-bottom .2s ease-out'
: 'margin .3s ease-in';
}
}
return '';
}};
return '';
}};
`;
export { Div, Flex, Span, Wrapper };

View File

@ -42,8 +42,8 @@ const Label = styled.label`
}
${({ value }) => {
if (value === true) {
return css`
if (value === true) {
return css`
font-weight: 500;
&:after {
content: '\f00c';
@ -57,10 +57,10 @@ const Label = styled.label`
transition: all 0.2s;
}
`;
}
}
return '';
}}
return '';
}}
`;
export { Div, Label };

View File

@ -5,7 +5,7 @@ import { colors } from '@buffetjs/styles';
const InputUID = styled(InputText)`
width: 100%;
${({ error }) =>
error &&
error &&
`
> input {
border-color: ${colors.darkOrange};

View File

@ -5,8 +5,8 @@ const NonRepeatableWrapper = styled.div`
padding: 0 20px !important;
${({ isEmpty, isFromDynamicZone }) => {
if (isEmpty) {
return `
if (isEmpty) {
return `
position: relative;
height: 108px;
margin-bottom: 21px !important;
@ -44,21 +44,21 @@ const NonRepeatableWrapper = styled.div`
}
}
`;
}
}
if (isFromDynamicZone) {
return `
if (isFromDynamicZone) {
return `
background-color: #fff;
padding: 0 10px !important;
`;
}
}
return `
return `
padding-top: 25px !important;
background-color: #f7f8f8;
margin-bottom: 18px !important;
`;
}}
}}
`;
export default NonRepeatableWrapper;

View File

@ -8,15 +8,15 @@ const Wrapper = styled.div`
width: 100%;
padding: 0 5px;
${({ isComponent }) => {
if (isComponent) {
return css`
if (isComponent) {
return css`
height: 34px;
padding: 0;
`;
}
}
return '';
}}
return '';
}}
border-radius: 2px;
> div {
width: 100%;

View File

@ -9,32 +9,30 @@ const Button = styled.button`
border: 1px solid rgba(227, 233, 243, 0.75);
border-top: 1px solid
${({ doesPreviousFieldContainErrorsAndIsClosed }) =>
doesPreviousFieldContainErrorsAndIsClosed
? '#FFA784'
: 'rgba(227, 233, 243, 0.75)'};
doesPreviousFieldContainErrorsAndIsClosed ? '#FFA784' : 'rgba(227, 233, 243, 0.75)'};
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
${({ withBorderRadius }) => {
if (withBorderRadius) {
return css`
if (withBorderRadius) {
return css`
border-radius: 2px;
`;
}
}
return '';
}}
return '';
}}
${({ hasMinError }) => {
if (hasMinError) {
return `
if (hasMinError) {
return `
border-color: #FAA684;
border-top-color: rgba(227, 233, 243, 0.75);
`;
}
}
return '';
}}
return '';
}}
color: #007eff;
font-size: 12px;

View File

@ -11,12 +11,12 @@ const EmptyComponent = styled.div`
background-color: #fff;
${({ hasMinError }) => {
if (hasMinError) {
return 'border-color: #FAA684';
}
if (hasMinError) {
return 'border-color: #FAA684';
}
return '';
}}
return '';
}}
> p {
color: #9ea7b8;

View File

@ -21,24 +21,23 @@ const Button = styled.button`
}
${({ active, disabled }) => {
if (active) {
return css`
if (active) {
return css`
border: 0;
background: rgba(16, 22, 34, 0);
box-shadow: inset 0 -1px 0 0 rgba(16, 22, 34, 0.04),
inset 0 1px 0 0 rgba(16, 22, 34, 0.04);
box-shadow: inset 0 -1px 0 0 rgba(16, 22, 34, 0.04), inset 0 1px 0 0 rgba(16, 22, 34, 0.04);
`;
}
}
if (disabled) {
return css`
if (disabled) {
return css`
opacity: 0.7;
cursor: not-allowed;
`;
}
}
return '';
}}
return '';
}}
> svg {
margin: auto;

View File

@ -10,8 +10,8 @@ const Cell = styled.div`
cursor: pointer;
${({ isSelected }) => {
if (isSelected) {
return `
if (isSelected) {
return `
&::after {
content: '';
position: absolute;
@ -24,10 +24,10 @@ const Cell = styled.div`
z-index: 1;
}
`;
}
}
return '';
}}
return '';
}}
> svg {
z-index: 9;

View File

@ -2,18 +2,18 @@ import styled, { css } from 'styled-components';
const Wrapper = styled.div`
${({ isActive }) => {
if (isActive) {
return css`
if (isActive) {
return css`
height: 3rem;
color: #007eff;
font-weight: 600;
border-bottom: 2px solid #007eff;
z-index: 99;
`;
}
}
return '';
}}
return '';
}}
`;
export default Wrapper;

View File

@ -35,8 +35,8 @@ const StyledButton = styled(Button)`
font-size: 13px;
font-weight: 500;
${({ type }) => {
if (type === 'openDocumentation') {
return css`
if (type === 'openDocumentation') {
return css`
margin-right: 10px;
border: 1px solid #dfe0e1;
&:before {
@ -46,9 +46,9 @@ const StyledButton = styled(Button)`
font-size: 10px;
}
`;
}
if (type === 'generateDocumentation') {
return css`
}
if (type === 'generateDocumentation') {
return css`
background: #e6f0fb;
border: 1px solid #aed4fb;
color: #007eff;
@ -59,9 +59,9 @@ const StyledButton = styled(Button)`
font-size: 10px;
}
`;
}
if (type === 'trash') {
return css`
}
if (type === 'trash') {
return css`
margin-left: 25px;
font-weight: 400;
&:before {
@ -71,13 +71,13 @@ const StyledButton = styled(Button)`
font-size: 12 px;
}
`;
}
}
return css`
return css`
margin-left: 45px;
font-weight: 400;
`;
}}
}}
`;
export { Wrapper, StyledButton };

View File

@ -31,7 +31,7 @@ const CardImgWrapper = styled.div`
}
${({ checked }) =>
checked &&
checked &&
`
.card-control-wrapper:not(.card-control-wrapper-hidden) {
display: flex;

View File

@ -23,7 +23,7 @@ const Label = styled.label`
}
${({ isDragging }) =>
isDragging &&
isDragging &&
`
background-color: rgba(28, 93, 231, 0.01);
border: 2px dashed rgba(28, 93, 231, 0.1);

View File

@ -5,7 +5,7 @@ const Padded = styled.div`
padding-top: ${({ theme, size, top }) => top && (theme.main.sizes.paddings[size] || size)};
padding-right: ${({ theme, size, right }) => right && (theme.main.sizes.paddings[size] || size)};
padding-bottom: ${({ theme, size, bottom }) =>
bottom && (theme.main.sizes.paddings[size] || size)};
bottom && (theme.main.sizes.paddings[size] || size)};
padding-left: ${({ theme, size, left }) => left && (theme.main.sizes.paddings[size] || size)};
`;

View File

@ -10,7 +10,7 @@ const SortListItem = styled.li`
background-color: ${({ theme }) => theme.main.colors.mediumGrey};
}
${({ isActive, theme }) =>
isActive &&
isActive &&
`
background-color: ${theme.main.colors.mediumGrey};
`}

View File

@ -9,7 +9,7 @@ const Text = styled.p`
font-weight: ${({ theme, fontWeight }) => theme.main.fontWeights[fontWeight]};
text-transform: ${({ textTransform }) => textTransform};
${({ ellipsis }) =>
ellipsis &&
ellipsis &&
`
white-space: nowrap;
overflow: hidden;