-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyled.tsx
123 lines (103 loc) · 3.18 KB
/
styled.tsx
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import styled, { keyframes } from 'styled-components'
import { SupportedAIEventTypes } from '@mexit/core'
import { BodyFont } from '../../Style/Search'
const getEventColor = (type: SupportedAIEventTypes | undefined, saturation = 100, lightness = 75) => {
if (!type) return `hsl(-210, 100%, 75%)`
let hash = 0
for (let i = 0; i < type.length; i++) {
hash = type.charCodeAt(i) + ((hash << 7) - hash)
hash = hash & hash
}
return `hsl(${hash % 360}, ${saturation}%, ${lightness}%)`
}
const float = keyframes`
0% {
opacity: 0.4;
transform: scale(0.9);
transform: translateY(-0.25rem);
}
70% {
transform: scale(1.005)
}
100% {
opacity: 1;
transform: translateY(0rem);
transform: scale(1);
}
`
export const AIResult = styled.div`
font-weight: bold;
line-height: 1.25;
color: ${({ theme }) => theme.tokens.text.default};
`
export const StyledAIResults = styled.div`
display: flex;
flex-direction: column;
gap: ${({ theme }) => theme.spacing.small};
`
export const GenerateResultContainer = styled.div``
export const AIContainerHeader = styled.header`
display: flex;
align-items: center;
justify-content: space-between;
padding: ${({ theme }) => theme.spacing.small};
border-radius: ${({ theme }) => theme.borderRadius.small};
`
export const AIResponseContainer = styled.div`
${BodyFont}
padding: ${({ theme }) => `${theme.spacing.small} ${theme.spacing.medium}`};
max-height: 16rem;
`
export const AIContainerSection = styled.section`
flex: 1;
overflow: hidden auto;
`
export const AIContainerFooter = styled.footer`
padding: ${({ theme }) => theme.spacing.small};
display: flex;
gap: ${({ theme }) => theme.spacing.small};
align-items: center;
`
export const StyledAIHistoryContainer = styled.div`
display: flex;
align-items: center;
flex: 1;
`
export const StyledAIHistory = styled.span<{ type: SupportedAIEventTypes }>`
:hover {
cursor: pointer;
background: ${({ theme }) => theme.tokens.surfaces.s[4]};
box-shadow: ${({ theme }) => theme.tokens.shadow.medium};
}
padding: ${({ theme }) => theme.spacing.tiny};
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: ${({ theme }) => theme.borderRadius.small};
span {
padding: ${({ theme }) => theme.spacing.tiny};
border-radius: ${({ theme }) => theme.borderRadius.small};
background-color: ${({ type }) => getEventColor(type)};
}
`
export const FloaterContainer = styled.div`
color: ${({ theme }) => theme.tokens.text.default};
border-radius: ${({ theme }) => theme.borderRadius.small};
background-color: rgba(${({ theme }) => theme.rgbTokens.surfaces.modal}, 0.8);
box-shadow: inset ${({ theme }) => theme.tokens.shadow.medium};
backdrop-filter: blur(2rem);
border: 1px solid ${({ theme }) => theme.tokens.surfaces.app};
transform-origin: top;
z-index: 11;
border: 1px solid ${({ theme }) => theme.tokens.surfaces.s[3]};
animation: ${float} 150ms ease-out;
`
export const StyledAIContainer = styled.div`
width: 40rem;
height: 24rem;
max-width: 40rem;
max-height: 24rem;
display: flex;
flex-direction: column;
overflow: hidden;
`