-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstyled.js
104 lines (90 loc) · 2.5 KB
/
styled.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import styled, { keyframes } from 'styled-components';
import { Box } from '@strapi/design-system/Box';
import { FieldAction } from '@strapi/design-system/Field';
import { Flex } from '@strapi/design-system/Flex';
import { Button, IconButton } from '@strapi/design-system';
const rotation = keyframes`
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
`;
export const LoadingWrapper = styled(Flex)`
animation: ${rotation} 2s infinite linear;
`;
export const ExpandButton = styled(IconButton)`
height: 1rem;
width: 1.5rem;
border: none;
background: ${({ theme, hasError }) => theme.colors[hasError ? 'danger100' : 'primary100']};
color: ${({ theme, hasError }) => theme.colors[hasError ? 'danger700' : 'primary700']};
`;
export const HideButton = styled(Button)`
padding: 0;
height: fit-content;
background-color: transparent;
color: transparent;
border: none;
:hover {
border: none;
}
`;
export const PathLabel = styled.span`
margin-right: -4px;
padding: 1px 4px 2px 4px;
background: ${({ theme, hasError }) => theme.colors[hasError ? 'danger100' : 'primary100']};
border-radius: ${({ theme }) => theme.borderRadius};
color: ${({ theme, hasError }) => theme.colors[hasError ? 'danger700' : 'primary700']};
font-size: ${({ theme }) => theme.fontSizes[2]};
font-weight: ${({ theme }) => theme.fontWeights.regular};
line-height: normal;
white-space: nowrap;
display: inline-flex;
align-items: center;
`;
export const Delimiter = styled.span`
margin: 0 2px;
color: ${({ theme, hasError }) => theme.colors[hasError ? 'danger500' : 'primary500']};
font-size: ${({ theme }) => theme.fontSizes[0]};
&:last-child {
margin-right: 0;
}
`;
export const RelativeInputWrapper = styled.div`
display: flex;
flex-direction: column;
position: relative;
`;
export const EndActionWrapper = styled(Box)``;
export const FieldActionWrapper = styled(FieldAction)`
svg {
height: 1rem;
width: 1rem;
path {
fill: ${({ theme }) => theme.colors.neutral400};
}
}
svg:hover {
path {
fill: ${({ theme }) => theme.colors.primary600};
}
}
`;
export const TextValidation = styled(Flex)`
position: absolute;
right: 0;
top: 0;
width: 100px;
pointer-events: none;
svg {
margin-right: ${({ theme }) => theme.spaces[1]};
height: ${12 / 16}rem;
width: ${12 / 16}rem;
path {
fill: ${({ theme, notAvailable }) =>
!notAvailable ? theme.colors.success600 : theme.colors.danger600};
}
}
`;