This repository was archived by the owner on Jan 29, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.tsx
More file actions
150 lines (130 loc) · 3.51 KB
/
elements.tsx
File metadata and controls
150 lines (130 loc) · 3.51 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import {
Container as BaseContainer,
maxLinesMixin,
Text,
} from '@titicaca/tds-ui'
import styled, { css } from 'styled-components'
import { reservationInfoTheme } from './theme-provider'
const RESERVATION_INFO_MIN_CONTENT_HEIGHT = 40
const PRODUCT_INFO_MIN_CONTENT_HEIGHT = 21
export const Container = styled(BaseContainer)`
padding: 12px;
box-shadow: 0 0 20px 0
${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).shadowColor};
border-radius: 12px;
border: 1px solid
${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).borderColor};
background-color: ${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).backgroundColor};
margin: 8px 15px 0;
`
export const Details = styled.dl<{ expanded: boolean }>`
margin-top: ${({ expanded }) => (expanded ? '4px' : '1.5px')};
display: flex;
flex-direction: column;
gap: 2px;
font-size: 12px;
line-height: 16px;
letter-spacing: 0;
> div {
display: flex;
align-items: flex-start;
dt {
flex-shrink: 0;
color: ${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).detail.labelColor};
margin-right: 8px;
width: 42px;
}
dd {
display: inline;
color: ${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).detail.valueColor};
${({ expanded }) => !expanded && maxLinesMixin({ maxLines: 1 })}
& + dd {
&::before {
content: '';
display: inline-block;
margin: 0 8px;
width: 1px;
height: 8px;
background-color: #ddd;
}
}
}
}
`
export const ContentContainer = styled(BaseContainer)`
display: flex;
flex-direction: row;
position: relative;
`
export const Thumbnail = styled.img<{ small?: boolean }>`
width: ${({ small = false }) => (small ? '30' : '40')}px;
height: ${({ small = false }) => (small ? '30' : '40')}px;
border-radius: 6px;
margin-right: 12px;
`
export const DetailContainer = styled(BaseContainer)<{ expanded: boolean }>`
max-height: ${({ expanded }) =>
expanded ? 'none' : `${PRODUCT_INFO_MIN_CONTENT_HEIGHT}px`};
overflow: hidden;
flex: 1;
&:has(${Details}) {
max-height: ${({ expanded }) =>
expanded ? 'none' : `${RESERVATION_INFO_MIN_CONTENT_HEIGHT}px`};
}
`
export const ArrowButton = styled.button.attrs({ type: 'button' })<{
expanded: boolean
}>`
position: absolute;
right: 0;
width: 12px;
height: 12px;
display: flex;
& > svg {
transform: rotate(${({ expanded }) => (expanded ? '0deg' : '180deg')});
}
`
export const TitleContainer = styled(BaseContainer)`
display: flex;
flex-direction: row;
gap: 16px;
&:has(${ArrowButton}) {
padding-right: 18px;
}
`
export const Title = styled(Text).attrs({
size: 14,
lineHeight: '19px',
bold: true,
})`
padding-top: 1.5px;
color: ${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).titleColor};
flex-grow: 1;
`
export type LabelColor = 'blue' | 'red' | 'gray'
export const Label = styled(Text).attrs({
size: 11,
lineHeight: '16px',
bold: true,
})<{ color?: LabelColor }>`
flex-shrink: 0;
padding: 3px 6px;
border-radius: 6px;
height: fit-content;
${({ color }) =>
color &&
css`
background-color: ${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).label[color]
.backgroundColor || 'transparent'};
color: ${({ theme }) =>
(theme.reservationInfo || reservationInfoTheme).label[color].color ||
'inherit'};
`}
`