@times-components/ts-components 1.145.1-b32ea924749bafdf12e3e8515023538fa20e7808.3 → 1.145.1-cfea81c4084e6f91221ea00fec9fc730d5b933cb.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/carousel-component/CarouselComponent.stories.js +146 -0
- package/dist/components/carousel-component/CarouselItem.d.ts +3 -0
- package/dist/components/carousel-component/CarouselItem.js +11 -0
- package/dist/components/carousel-component/DefaultNavigationArrow.d.ts +8 -0
- package/dist/components/carousel-component/DefaultNavigationArrow.js +6 -0
- package/dist/components/carousel-component/DefaultPageDot.d.ts +8 -0
- package/dist/components/carousel-component/DefaultPageDot.js +4 -0
- package/dist/components/carousel-component/__tests__/CarouselComponent.test.d.ts +1 -0
- package/dist/components/carousel-component/__tests__/CarouselComponent.test.js +163 -0
- package/dist/components/carousel-component/__tests__/CarouselItem.test.d.ts +1 -0
- package/dist/components/carousel-component/__tests__/CarouselItem.test.js +80 -0
- package/dist/components/carousel-component/__tests__/DefaultNavigationArrow.test.d.ts +1 -0
- package/dist/components/carousel-component/__tests__/DefaultNavigationArrow.test.js +62 -0
- package/dist/components/carousel-component/__tests__/DefaultPageDot.test.d.ts +1 -0
- package/dist/components/carousel-component/__tests__/DefaultPageDot.test.js +68 -0
- package/dist/components/carousel-component/hooks/__tests__/useCarousel.test.d.ts +1 -0
- package/dist/components/carousel-component/hooks/__tests__/useCarousel.test.js +314 -0
- package/dist/components/carousel-component/hooks/useCarousel.d.ts +2 -0
- package/dist/components/carousel-component/hooks/useCarousel.js +140 -0
- package/dist/components/carousel-component/index.d.ts +4 -0
- package/dist/components/carousel-component/index.js +20 -0
- package/dist/components/carousel-component/styles.d.ts +30 -0
- package/dist/components/carousel-component/styles.js +120 -0
- package/dist/components/carousel-component/types.d.ts +46 -0
- package/dist/components/carousel-component/types.js +2 -0
- package/dist/components/opta/cricket/scorecard/OptaCricketScorecard.js +2 -10
- package/dist/components/opta/cricket/scorecard/__tests__/OptaCricketScorecard.test.js +17 -94
- package/dist/components/opta/football/summary/OptaFootballSummary.js +2 -10
- package/dist/components/opta/football/summary/__tests__/OptaFootballSummary.test.js +18 -95
- package/dist/components/opta/rugby/summary/OptaRugbySummary.js +2 -10
- package/dist/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.js +17 -94
- package/dist/components/trip-cards/SkeletonCard.d.ts +2 -0
- package/dist/components/trip-cards/SkeletonCard.js +21 -0
- package/dist/components/trip-cards/TripCard.d.ts +3 -0
- package/dist/components/trip-cards/TripCard.js +47 -0
- package/dist/components/trip-cards/TripCards.stories.d.ts +1 -0
- package/dist/components/trip-cards/TripCards.stories.js +40 -0
- package/dist/components/trip-cards/TripCardsLayout.d.ts +3 -0
- package/dist/components/trip-cards/TripCardsLayout.js +26 -0
- package/dist/components/trip-cards/__tests__/SkeletonCard.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/SkeletonCard.test.js +139 -0
- package/dist/components/trip-cards/__tests__/TripCard.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/TripCard.test.js +95 -0
- package/dist/components/trip-cards/__tests__/TripCardsLayout.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/TripCardsLayout.test.js +277 -0
- package/dist/components/trip-cards/__tests__/assets.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/assets.test.js +165 -0
- package/dist/components/trip-cards/__tests__/helpers.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/helpers.test.js +135 -0
- package/dist/components/trip-cards/__tests__/index.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/index.test.js +437 -0
- package/dist/components/trip-cards/__tests__/mockData.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/mockData.test.js +57 -0
- package/dist/components/trip-cards/__tests__/skeletonStyles.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/skeletonStyles.test.js +194 -0
- package/dist/components/trip-cards/assets/BoatIcon.d.ts +1 -0
- package/dist/components/trip-cards/assets/BoatIcon.js +4 -0
- package/dist/components/trip-cards/assets/CalendarIcon.d.ts +1 -0
- package/dist/components/trip-cards/assets/CalendarIcon.js +4 -0
- package/dist/components/trip-cards/assets/ChevronRightIcon.d.ts +1 -0
- package/dist/components/trip-cards/assets/ChevronRightIcon.js +4 -0
- package/dist/components/trip-cards/assets/LocationIcon.d.ts +1 -0
- package/dist/components/trip-cards/assets/LocationIcon.js +4 -0
- package/dist/components/trip-cards/assets/MoonIcon.d.ts +1 -0
- package/dist/components/trip-cards/assets/MoonIcon.js +4 -0
- package/dist/components/trip-cards/assets/index.d.ts +6 -0
- package/dist/components/trip-cards/assets/index.js +7 -0
- package/dist/components/trip-cards/helpers.d.ts +4 -0
- package/dist/components/trip-cards/helpers.js +74 -0
- package/dist/components/trip-cards/index.d.ts +4 -0
- package/dist/components/trip-cards/index.js +70 -0
- package/dist/components/trip-cards/mockData.d.ts +3 -0
- package/dist/components/trip-cards/mockData.js +323 -0
- package/dist/components/trip-cards/skeletonStyles.d.ts +9 -0
- package/dist/components/trip-cards/skeletonStyles.js +37 -0
- package/dist/components/trip-cards/styles.d.ts +39 -0
- package/dist/components/trip-cards/styles.js +387 -0
- package/dist/components/trip-cards/types.d.ts +87 -0
- package/dist/components/trip-cards/types.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/package.json +3 -3
- package/rnw.js +1 -1
- package/src/components/carousel-component/CarouselComponent.stories.tsx +220 -0
- package/src/components/carousel-component/CarouselItem.tsx +20 -0
- package/src/components/carousel-component/DefaultNavigationArrow.tsx +37 -0
- package/src/components/carousel-component/DefaultPageDot.tsx +20 -0
- package/src/components/carousel-component/__tests__/CarouselComponent.test.tsx +259 -0
- package/src/components/carousel-component/__tests__/CarouselItem.test.tsx +140 -0
- package/src/components/carousel-component/__tests__/DefaultNavigationArrow.test.tsx +153 -0
- package/src/components/carousel-component/__tests__/DefaultPageDot.test.tsx +105 -0
- package/src/components/carousel-component/hooks/__tests__/useCarousel.test.ts +438 -0
- package/src/components/carousel-component/hooks/useCarousel.ts +187 -0
- package/src/components/carousel-component/index.tsx +88 -0
- package/src/components/carousel-component/styles.ts +140 -0
- package/src/components/carousel-component/types.ts +51 -0
- package/src/components/opta/cricket/scorecard/OptaCricketScorecard.tsx +0 -13
- package/src/components/opta/cricket/scorecard/__tests__/OptaCricketScorecard.test.tsx +16 -126
- package/src/components/opta/cricket/scorecard/__tests__/__snapshots__/OptaCricketScorecard.test.tsx.snap +6 -5
- package/src/components/opta/football/summary/OptaFootballSummary.tsx +0 -13
- package/src/components/opta/football/summary/__tests__/OptaFootballSummary.test.tsx +18 -127
- package/src/components/opta/football/summary/__tests__/__snapshots__/OptaFootballSummary.test.tsx.snap +6 -5
- package/src/components/opta/rugby/summary/OptaRugbySummary.tsx +0 -13
- package/src/components/opta/rugby/summary/__tests__/OptaRugbySummary.test.tsx +17 -127
- package/src/components/opta/rugby/summary/__tests__/__snapshots__/OptaRugbySummary.test.tsx.snap +6 -5
- package/src/components/trip-cards/SkeletonCard.tsx +54 -0
- package/src/components/trip-cards/TripCard.tsx +135 -0
- package/src/components/trip-cards/TripCards.stories.tsx +67 -0
- package/src/components/trip-cards/TripCardsLayout.tsx +75 -0
- package/src/components/trip-cards/__tests__/SkeletonCard.test.tsx +169 -0
- package/src/components/trip-cards/__tests__/TripCard.test.tsx +120 -0
- package/src/components/trip-cards/__tests__/TripCardsLayout.test.tsx +532 -0
- package/src/components/trip-cards/__tests__/assets.test.tsx +206 -0
- package/src/components/trip-cards/__tests__/helpers.test.ts +165 -0
- package/src/components/trip-cards/__tests__/index.test.tsx +499 -0
- package/src/components/trip-cards/__tests__/mockData.test.ts +67 -0
- package/src/components/trip-cards/__tests__/skeletonStyles.test.tsx +256 -0
- package/src/components/trip-cards/assets/BoatIcon.tsx +17 -0
- package/src/components/trip-cards/assets/CalendarIcon.tsx +17 -0
- package/src/components/trip-cards/assets/ChevronRightIcon.tsx +20 -0
- package/src/components/trip-cards/assets/LocationIcon.tsx +17 -0
- package/src/components/trip-cards/assets/MoonIcon.tsx +17 -0
- package/src/components/trip-cards/assets/index.ts +7 -0
- package/src/components/trip-cards/helpers.ts +99 -0
- package/src/components/trip-cards/index.tsx +104 -0
- package/src/components/trip-cards/mockData.ts +351 -0
- package/src/components/trip-cards/skeletonStyles.ts +46 -0
- package/src/components/trip-cards/styles.ts +426 -0
- package/src/components/trip-cards/types.ts +91 -0
- package/src/index.ts +2 -0
- package/dist/components/opta/utils/__tests__/emitEvent.test.js +0 -264
- package/dist/components/opta/utils/emitEvent.d.ts +0 -1
- package/dist/components/opta/utils/emitEvent.js +0 -9
- package/src/components/opta/utils/__tests__/emitEvent.test.tsx +0 -415
- package/src/components/opta/utils/emitEvent.ts +0 -11
- /package/dist/components/{opta/utils/__tests__/emitEvent.test.d.ts → carousel-component/CarouselComponent.stories.d.ts} +0 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const breakpoints = {
|
|
4
|
+
sm: '390px',
|
|
5
|
+
md: '768px',
|
|
6
|
+
lg: '1024px',
|
|
7
|
+
xl: '1320px'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const colors = {
|
|
11
|
+
primary: '#005C8A', // interactivePrimary030
|
|
12
|
+
titleBlue: '#145683', // Title color
|
|
13
|
+
ink: '#333333', // inkBase
|
|
14
|
+
inkBrand: '#01000D', // inkBrand010 - active dot
|
|
15
|
+
secondary: '#696969', // Secondary text
|
|
16
|
+
border: '#E4E4E4', // Card border
|
|
17
|
+
offerBg: '#FFEECF', // Offer label background
|
|
18
|
+
offerBorder: '#FFB329', // Offer label left border
|
|
19
|
+
strikethrough: '#9F0000', // Slashed price color
|
|
20
|
+
dotActive: '#01000D', // inkBrand010
|
|
21
|
+
dotInactive: '#AAAAAA', // inkNonEssential
|
|
22
|
+
iconBlue: '#236FA3', // Data point icons
|
|
23
|
+
white: '#FFFFFF'
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Container = styled.div`
|
|
27
|
+
max-width: 800px;
|
|
28
|
+
margin: 0 auto;
|
|
29
|
+
padding: 80px 0 40px;
|
|
30
|
+
|
|
31
|
+
@media (max-width: ${breakpoints.md}) {
|
|
32
|
+
padding: 40px 0;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const TitleSection = styled.div`
|
|
37
|
+
padding: 0;
|
|
38
|
+
margin-bottom: 16px;
|
|
39
|
+
|
|
40
|
+
@media (max-width: ${breakpoints.md}) {
|
|
41
|
+
padding: 0 10px;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const TitleBar = styled.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 12px;
|
|
50
|
+
border-top: 1px dashed ${colors.border};
|
|
51
|
+
border-bottom: 1px dashed ${colors.border};
|
|
52
|
+
padding: 20px 0px;
|
|
53
|
+
|
|
54
|
+
@media (max-width: ${breakpoints.md}) {
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export const TitleContent = styled.div`
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 4px;
|
|
63
|
+
|
|
64
|
+
@media (min-width: ${breakpoints.md}) {
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
align-items: baseline;
|
|
67
|
+
gap: 8px;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
export const Title = styled.h2`
|
|
72
|
+
font-family: 'Times Modern', serif;
|
|
73
|
+
font-size: 24px;
|
|
74
|
+
font-weight: 800;
|
|
75
|
+
line-height: 1.13;
|
|
76
|
+
color: #145683;
|
|
77
|
+
margin: 0;
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
export const Subtitle = styled.p`
|
|
81
|
+
font-family: 'Times Modern', serif;
|
|
82
|
+
font-size: 20px;
|
|
83
|
+
font-weight: 400;
|
|
84
|
+
line-height: 1.13;
|
|
85
|
+
color: #333333;
|
|
86
|
+
margin: 0;
|
|
87
|
+
vertical-align: bottom;
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
export const TitleLink = styled.a`
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
width: 32px;
|
|
95
|
+
height: 32px;
|
|
96
|
+
padding: 8px;
|
|
97
|
+
background: #eeeeee;
|
|
98
|
+
border-radius: 33.33px;
|
|
99
|
+
text-decoration: none;
|
|
100
|
+
transition: background-color 0.2s ease;
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
|
|
103
|
+
&:hover {
|
|
104
|
+
background: #dddddd;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
svg {
|
|
108
|
+
width: 16px;
|
|
109
|
+
height: 16px;
|
|
110
|
+
color: ${colors.ink};
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
export const Description = styled.p`
|
|
115
|
+
font-family: 'Roboto', sans-serif;
|
|
116
|
+
font-size: 16px;
|
|
117
|
+
line-height: 1.5;
|
|
118
|
+
color: ${colors.secondary};
|
|
119
|
+
margin: 0 0 20px 0;
|
|
120
|
+
`;
|
|
121
|
+
|
|
122
|
+
export const StaticCardsGrid = styled.div`
|
|
123
|
+
display: grid;
|
|
124
|
+
grid-template-columns: 1fr;
|
|
125
|
+
gap: 20px;
|
|
126
|
+
padding: 0;
|
|
127
|
+
|
|
128
|
+
@media (min-width: ${breakpoints.md}) {
|
|
129
|
+
grid-template-columns: repeat(2, 1fr);
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
// Card Styles
|
|
134
|
+
export const CardContainer = styled.div`
|
|
135
|
+
width: 100%;
|
|
136
|
+
height: 100%;
|
|
137
|
+
border: 1.2px solid ${colors.border};
|
|
138
|
+
background: ${colors.white};
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
`;
|
|
143
|
+
|
|
144
|
+
export const ImageContainer = styled.div`
|
|
145
|
+
position: relative;
|
|
146
|
+
width: 100%;
|
|
147
|
+
aspect-ratio: 3 / 2;
|
|
148
|
+
height: 100%;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
flex-shrink: 0;
|
|
151
|
+
|
|
152
|
+
@media (min-width: ${breakpoints.sm}) {
|
|
153
|
+
height: 213px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@media (min-width: ${breakpoints.md}) {
|
|
157
|
+
height: 173px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (min-width: ${breakpoints.xl}) {
|
|
161
|
+
height: 200px;
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
164
|
+
|
|
165
|
+
export const CardImage = styled.img`
|
|
166
|
+
position: absolute;
|
|
167
|
+
top: 0;
|
|
168
|
+
left: 0;
|
|
169
|
+
width: 100%;
|
|
170
|
+
height: 100%;
|
|
171
|
+
object-fit: cover;
|
|
172
|
+
object-position: center;
|
|
173
|
+
`;
|
|
174
|
+
|
|
175
|
+
export const OfferLabel = styled.div`
|
|
176
|
+
position: absolute;
|
|
177
|
+
bottom: 12px;
|
|
178
|
+
left: 0;
|
|
179
|
+
background: ${colors.offerBg};
|
|
180
|
+
border-left: 1.2px solid ${colors.offerBorder};
|
|
181
|
+
padding: 12px 16px;
|
|
182
|
+
font-family: 'Roboto', sans-serif;
|
|
183
|
+
font-size: 14px;
|
|
184
|
+
font-weight: 400;
|
|
185
|
+
line-height: 1.5;
|
|
186
|
+
color: ${colors.ink};
|
|
187
|
+
`;
|
|
188
|
+
|
|
189
|
+
export const GiftBanner = styled.div`
|
|
190
|
+
position: absolute;
|
|
191
|
+
bottom: 12px;
|
|
192
|
+
left: 0;
|
|
193
|
+
max-width: 80%;
|
|
194
|
+
background: ${colors.offerBg};
|
|
195
|
+
padding: 12px 16px;
|
|
196
|
+
font-family: 'Roboto', sans-serif;
|
|
197
|
+
font-size: 14px;
|
|
198
|
+
font-weight: 400;
|
|
199
|
+
line-height: 1.5;
|
|
200
|
+
color: ${colors.ink};
|
|
201
|
+
text-align: left;
|
|
202
|
+
`;
|
|
203
|
+
|
|
204
|
+
export const CardContent = styled.div`
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
flex: 1;
|
|
208
|
+
padding: 20px 16px 16px 16px;
|
|
209
|
+
gap: 32px;
|
|
210
|
+
`;
|
|
211
|
+
|
|
212
|
+
export const TopContainer = styled.div`
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: 16px;
|
|
216
|
+
flex: 1;
|
|
217
|
+
`;
|
|
218
|
+
|
|
219
|
+
export const BottomContainer = styled.div`
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
gap: 16px;
|
|
223
|
+
`;
|
|
224
|
+
|
|
225
|
+
export const Headline = styled.h3`
|
|
226
|
+
font-family: 'Times Modern', serif;
|
|
227
|
+
font-size: 20px;
|
|
228
|
+
font-weight: 700;
|
|
229
|
+
line-height: 1.125;
|
|
230
|
+
color: ${colors.ink};
|
|
231
|
+
margin: 0;
|
|
232
|
+
`;
|
|
233
|
+
|
|
234
|
+
export const DataPointsList = styled.div`
|
|
235
|
+
display: flex;
|
|
236
|
+
flex-direction: column;
|
|
237
|
+
gap: 2px;
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
export const DataPoint = styled.div`
|
|
241
|
+
display: flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
gap: 8px;
|
|
244
|
+
font-family: 'Roboto', sans-serif;
|
|
245
|
+
font-size: 14px;
|
|
246
|
+
line-height: 1.5;
|
|
247
|
+
color: ${colors.secondary};
|
|
248
|
+
min-height: 21px;
|
|
249
|
+
`;
|
|
250
|
+
|
|
251
|
+
export const DataIcon = styled.span`
|
|
252
|
+
width: 17px;
|
|
253
|
+
height: 17px;
|
|
254
|
+
display: flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
justify-content: center;
|
|
257
|
+
flex-shrink: 0;
|
|
258
|
+
color: ${colors.iconBlue};
|
|
259
|
+
font-size: 17px;
|
|
260
|
+
`;
|
|
261
|
+
|
|
262
|
+
export const PriceSection = styled.div`
|
|
263
|
+
display: flex;
|
|
264
|
+
flex-direction: row;
|
|
265
|
+
align-items: center;
|
|
266
|
+
gap: 12px;
|
|
267
|
+
`;
|
|
268
|
+
|
|
269
|
+
export const PriceContainer = styled.div`
|
|
270
|
+
display: flex;
|
|
271
|
+
flex-direction: column;
|
|
272
|
+
gap: 12px;
|
|
273
|
+
flex: 1;
|
|
274
|
+
`;
|
|
275
|
+
|
|
276
|
+
export const OfferContainer = styled.div`
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
gap: 4px;
|
|
280
|
+
`;
|
|
281
|
+
|
|
282
|
+
export const PriceLabel = styled.span`
|
|
283
|
+
font-family: 'Roboto', sans-serif;
|
|
284
|
+
font-size: 14px;
|
|
285
|
+
line-height: 1.5;
|
|
286
|
+
color: ${colors.secondary};
|
|
287
|
+
`;
|
|
288
|
+
|
|
289
|
+
export const OriginalPrice = styled.span`
|
|
290
|
+
font-family: 'Roboto', sans-serif;
|
|
291
|
+
font-size: 14px;
|
|
292
|
+
font-weight: 500;
|
|
293
|
+
line-height: 1.5;
|
|
294
|
+
color: ${colors.strikethrough};
|
|
295
|
+
text-decoration: line-through;
|
|
296
|
+
`;
|
|
297
|
+
|
|
298
|
+
export const CurrentPrice = styled.span`
|
|
299
|
+
font-family: 'Times Modern', serif;
|
|
300
|
+
font-size: 44px;
|
|
301
|
+
font-weight: 300;
|
|
302
|
+
line-height: 1.125;
|
|
303
|
+
color: ${colors.ink};
|
|
304
|
+
`;
|
|
305
|
+
|
|
306
|
+
export const LogoContainer = styled.div`
|
|
307
|
+
width: 88px;
|
|
308
|
+
height: 44px;
|
|
309
|
+
display: flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
|
|
312
|
+
a {
|
|
313
|
+
display: flex;
|
|
314
|
+
align-items: center;
|
|
315
|
+
width: 100%;
|
|
316
|
+
height: 100%;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
img {
|
|
320
|
+
max-width: 100%;
|
|
321
|
+
max-height: 100%;
|
|
322
|
+
object-fit: contain;
|
|
323
|
+
}
|
|
324
|
+
`;
|
|
325
|
+
|
|
326
|
+
export const CTAButton = styled.a`
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
justify-content: center;
|
|
330
|
+
width: 100%;
|
|
331
|
+
padding: 12px 16px;
|
|
332
|
+
background: ${colors.primary};
|
|
333
|
+
color: ${colors.white};
|
|
334
|
+
font-family: 'Roboto', sans-serif;
|
|
335
|
+
font-size: 16px;
|
|
336
|
+
font-weight: 500;
|
|
337
|
+
line-height: 1.5;
|
|
338
|
+
text-decoration: none;
|
|
339
|
+
transition: background 0.2s ease;
|
|
340
|
+
|
|
341
|
+
&:hover {
|
|
342
|
+
background: #004a6e;
|
|
343
|
+
}
|
|
344
|
+
`;
|
|
345
|
+
|
|
346
|
+
// Navigation Arrow - positioned on sides of carousel
|
|
347
|
+
export const NavigationArrow = styled.button<{
|
|
348
|
+
direction: 'left' | 'right';
|
|
349
|
+
disabled?: boolean;
|
|
350
|
+
}>`
|
|
351
|
+
display: none;
|
|
352
|
+
position: absolute;
|
|
353
|
+
top: 50%;
|
|
354
|
+
transform: translateY(-50%);
|
|
355
|
+
${({ direction }) =>
|
|
356
|
+
direction === 'left' ? 'left: -65px;' : 'right: -65px;'} z-index: 10;
|
|
357
|
+
width: 48px;
|
|
358
|
+
height: 48px;
|
|
359
|
+
border: none;
|
|
360
|
+
border-radius: 50%;
|
|
361
|
+
background: ${({ disabled }) => (disabled ? '#CCCCCC' : colors.primary)};
|
|
362
|
+
cursor: ${({ disabled }) => (disabled ? 'default' : 'pointer')};
|
|
363
|
+
align-items: center;
|
|
364
|
+
justify-content: center;
|
|
365
|
+
transition: background 0.2s ease;
|
|
366
|
+
pointer-events: ${({ disabled }) => (disabled ? 'none' : 'auto')};
|
|
367
|
+
|
|
368
|
+
svg {
|
|
369
|
+
width: 24px;
|
|
370
|
+
height: 24px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
svg path {
|
|
374
|
+
stroke: ${colors.white};
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
&:hover:not(:disabled) {
|
|
378
|
+
background: #004a6e;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@media (min-width: ${breakpoints.lg}) {
|
|
382
|
+
display: flex;
|
|
383
|
+
}
|
|
384
|
+
`;
|
|
385
|
+
|
|
386
|
+
export const PageControl = styled.div`
|
|
387
|
+
display: flex;
|
|
388
|
+
justify-content: center;
|
|
389
|
+
align-items: center;
|
|
390
|
+
gap: 10px;
|
|
391
|
+
padding: 12px;
|
|
392
|
+
background: ${colors.white};
|
|
393
|
+
`;
|
|
394
|
+
|
|
395
|
+
export const PageDot = styled.button<{ active: boolean }>`
|
|
396
|
+
width: 8px;
|
|
397
|
+
height: 8px;
|
|
398
|
+
border-radius: 1000px;
|
|
399
|
+
border: none;
|
|
400
|
+
padding: 0;
|
|
401
|
+
background: ${({ active }) => (active ? '#01000D' : '#AAAAAA')};
|
|
402
|
+
cursor: pointer;
|
|
403
|
+
transition: background 0.2s ease;
|
|
404
|
+
|
|
405
|
+
&:hover {
|
|
406
|
+
background: #01000d;
|
|
407
|
+
}
|
|
408
|
+
`;
|
|
409
|
+
|
|
410
|
+
export const LoadingContainer = styled.div`
|
|
411
|
+
display: flex;
|
|
412
|
+
justify-content: center;
|
|
413
|
+
align-items: center;
|
|
414
|
+
min-height: 400px;
|
|
415
|
+
font-family: 'Roboto', sans-serif;
|
|
416
|
+
color: ${colors.secondary};
|
|
417
|
+
`;
|
|
418
|
+
|
|
419
|
+
export const ErrorContainer = styled.div`
|
|
420
|
+
display: flex;
|
|
421
|
+
justify-content: center;
|
|
422
|
+
align-items: center;
|
|
423
|
+
min-height: 200px;
|
|
424
|
+
font-family: 'Roboto', sans-serif;
|
|
425
|
+
color: ${colors.strikethrough};
|
|
426
|
+
`;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TripCardsElement {
|
|
4
|
+
class?: string;
|
|
5
|
+
tripcards: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
titleUrl?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface TripCardsProps {
|
|
12
|
+
element: TripCardsElement;
|
|
13
|
+
useMockData?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface DecodedTripCard {
|
|
17
|
+
cruise_id: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface TripCardApiData {
|
|
21
|
+
cruise_id: string;
|
|
22
|
+
image: string;
|
|
23
|
+
offer_label?: string;
|
|
24
|
+
gift_banner?: string;
|
|
25
|
+
headline: string;
|
|
26
|
+
date: string;
|
|
27
|
+
duration: string;
|
|
28
|
+
route: string;
|
|
29
|
+
ship: string;
|
|
30
|
+
original_price?: string;
|
|
31
|
+
price: string;
|
|
32
|
+
logo: string;
|
|
33
|
+
logo_url: string;
|
|
34
|
+
cta_url: string;
|
|
35
|
+
cta_text: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TripCardProps {
|
|
39
|
+
card: TripCardApiData;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ApiCruiseResult {
|
|
43
|
+
post_id: number;
|
|
44
|
+
cruise_id: number;
|
|
45
|
+
cruise_title: string;
|
|
46
|
+
cruise_line: {
|
|
47
|
+
name: string;
|
|
48
|
+
link: string;
|
|
49
|
+
logo: string;
|
|
50
|
+
};
|
|
51
|
+
ship: {
|
|
52
|
+
name: string;
|
|
53
|
+
link: string;
|
|
54
|
+
image: string;
|
|
55
|
+
};
|
|
56
|
+
departs: string;
|
|
57
|
+
ends: string;
|
|
58
|
+
date_label: string;
|
|
59
|
+
destination: string[];
|
|
60
|
+
duration: number;
|
|
61
|
+
itinerary: string[];
|
|
62
|
+
prices: {
|
|
63
|
+
cheapest_price: number | string;
|
|
64
|
+
inside: string | number;
|
|
65
|
+
outside: string | number;
|
|
66
|
+
balcony: string | number;
|
|
67
|
+
suite: string | number;
|
|
68
|
+
};
|
|
69
|
+
was_prices: {
|
|
70
|
+
cheapest_price: number | string;
|
|
71
|
+
inside: number;
|
|
72
|
+
outside: number;
|
|
73
|
+
balcony: number;
|
|
74
|
+
suite: number;
|
|
75
|
+
};
|
|
76
|
+
link: string;
|
|
77
|
+
campaigns: string[];
|
|
78
|
+
extras: {
|
|
79
|
+
date: string;
|
|
80
|
+
duration: string;
|
|
81
|
+
destination: string;
|
|
82
|
+
info: string;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface TripCardsLayoutProps {
|
|
87
|
+
element: TripCardsElement;
|
|
88
|
+
items: Array<{ id: string | number; data?: TripCardApiData }>;
|
|
89
|
+
CardComponent: ComponentType<any>;
|
|
90
|
+
itemsPerPage: number;
|
|
91
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -104,6 +104,8 @@ export {
|
|
|
104
104
|
default as ArticleHeader
|
|
105
105
|
} from './components/article-header/ArticleHeader';
|
|
106
106
|
|
|
107
|
+
export { TripCards } from './components/trip-cards';
|
|
108
|
+
|
|
107
109
|
export {
|
|
108
110
|
UpdatedTimestamp
|
|
109
111
|
} from './components/updated-timestamp/UpdatedTimestamp';
|