@times-components/ts-components 1.146.2-a0ffbb6bc2acbec91d140a39f6be06256e702094.5 → 1.146.2-c12ed7999a41984c2ba8c437357e7a5df1914881.48
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.d.ts +1 -0
- 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 +12 -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 +459 -0
- package/dist/components/carousel-component/hooks/useCarousel.d.ts +2 -0
- package/dist/components/carousel-component/hooks/useCarousel.js +167 -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 +28 -0
- package/dist/components/carousel-component/styles.js +172 -0
- package/dist/components/carousel-component/types.d.ts +53 -0
- package/dist/components/carousel-component/types.js +2 -0
- package/dist/components/social-embed/SocialMediaEmbed.js +15 -122
- package/dist/components/social-embed/SocialVendor.d.ts +16 -1
- package/dist/components/social-embed/SocialVendor.js +2 -41
- package/dist/components/social-embed/__tests__/SocialVendor.test.js +1 -8
- package/dist/components/social-embed/constants.d.ts +0 -1
- package/dist/components/social-embed/constants.js +2 -3
- package/dist/components/social-embed/helpers/socialMediaVendors.js +1 -6
- package/dist/components/social-embed/styles.d.ts +0 -1
- package/dist/components/social-embed/styles.js +1 -28
- package/dist/components/trip-cards/SkeletonCard.d.ts +7 -0
- package/dist/components/trip-cards/SkeletonCard.js +22 -0
- package/dist/components/trip-cards/TripCard.d.ts +3 -0
- package/dist/components/trip-cards/TripCard.js +61 -0
- package/dist/components/trip-cards/TripCards.stories.d.ts +1 -0
- package/dist/components/trip-cards/TripCards.stories.js +159 -0
- package/dist/components/trip-cards/TripCardsLayout.d.ts +3 -0
- package/dist/components/trip-cards/TripCardsLayout.js +63 -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 +165 -0
- package/dist/components/trip-cards/__tests__/TripCardsLayout.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/TripCardsLayout.test.js +353 -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 +221 -0
- package/dist/components/trip-cards/__tests__/index.test.d.ts +1 -0
- package/dist/components/trip-cards/__tests__/index.test.js +482 -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 +11 -0
- package/dist/components/trip-cards/helpers.js +144 -0
- package/dist/components/trip-cards/index.d.ts +4 -0
- package/dist/components/trip-cards/index.js +68 -0
- package/dist/components/trip-cards/mockData.d.ts +3 -0
- package/dist/components/trip-cards/mockData.js +317 -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 +43 -0
- package/dist/components/trip-cards/styles.js +404 -0
- package/dist/components/trip-cards/types.d.ts +121 -0
- package/dist/components/trip-cards/types.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/utils/cookie.d.ts +1 -0
- package/dist/utils/cookie.js +8 -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 +26 -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 +625 -0
- package/src/components/carousel-component/hooks/useCarousel.ts +229 -0
- package/src/components/carousel-component/index.tsx +92 -0
- package/src/components/carousel-component/styles.ts +188 -0
- package/src/components/carousel-component/types.ts +62 -0
- package/src/components/social-embed/SocialMediaEmbed.tsx +1 -111
- package/src/components/social-embed/SocialVendor.tsx +1 -46
- package/src/components/social-embed/__tests__/SocialVendor.test.tsx +0 -11
- package/src/components/social-embed/constants.ts +1 -2
- package/src/components/social-embed/helpers/socialMediaVendors.ts +0 -5
- package/src/components/social-embed/styles.ts +0 -30
- package/src/components/trip-cards/SkeletonCard.tsx +64 -0
- package/src/components/trip-cards/TripCard.tsx +172 -0
- package/src/components/trip-cards/TripCards.stories.tsx +224 -0
- package/src/components/trip-cards/TripCardsLayout.tsx +162 -0
- package/src/components/trip-cards/__tests__/SkeletonCard.test.tsx +169 -0
- package/src/components/trip-cards/__tests__/TripCard.test.tsx +255 -0
- package/src/components/trip-cards/__tests__/TripCardsLayout.test.tsx +671 -0
- package/src/components/trip-cards/__tests__/assets.test.tsx +206 -0
- package/src/components/trip-cards/__tests__/helpers.test.ts +273 -0
- package/src/components/trip-cards/__tests__/index.test.tsx +554 -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 +181 -0
- package/src/components/trip-cards/index.tsx +120 -0
- package/src/components/trip-cards/mockData.ts +345 -0
- package/src/components/trip-cards/skeletonStyles.ts +46 -0
- package/src/components/trip-cards/styles.ts +450 -0
- package/src/components/trip-cards/types.ts +130 -0
- package/src/index.ts +2 -0
- package/src/utils/cookie.ts +8 -0
- package/dist/components/social-embed/components/FacebookComponent.d.ts +0 -6
- package/dist/components/social-embed/components/FacebookComponent.js +0 -74
- package/src/components/social-embed/components/FacebookComponent.tsx +0 -93
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
ContainerProps,
|
|
4
|
+
CurrentPriceProps,
|
|
5
|
+
ImageContainerProps
|
|
6
|
+
} from './types';
|
|
7
|
+
|
|
8
|
+
const breakpoints = {
|
|
9
|
+
xs: '0px',
|
|
10
|
+
sm: '520px',
|
|
11
|
+
md: '768px',
|
|
12
|
+
lg: '1024px',
|
|
13
|
+
xl: '1320px'
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const colors = {
|
|
17
|
+
primary: '#005C8A', // interactivePrimary030
|
|
18
|
+
titleBlue: '#145683', // Title color
|
|
19
|
+
ink: '#333333', // inkBase
|
|
20
|
+
inkBrand: '#01000D', // inkBrand010 - active dot
|
|
21
|
+
secondary: '#696969', // Secondary text
|
|
22
|
+
border: '#E4E4E4', // Card border
|
|
23
|
+
offerBg: '#FFEECF', // Offer label background
|
|
24
|
+
offerBorder: '#FFB329', // Offer label left border
|
|
25
|
+
strikethrough: '#9F0000', // Slashed price color
|
|
26
|
+
dotActive: '#01000D', // inkBrand010
|
|
27
|
+
dotInactive: '#AAAAAA', // inkNonEssential
|
|
28
|
+
iconBlue: '#236FA3', // Data point icons
|
|
29
|
+
white: '#FFFFFF'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Container = styled.div<ContainerProps>`
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
margin: 0 auto;
|
|
35
|
+
padding: 80px 0 40px;
|
|
36
|
+
|
|
37
|
+
@media (min-width: ${breakpoints.md}) {
|
|
38
|
+
max-width: var(
|
|
39
|
+
--wp--style--global--content-size,
|
|
40
|
+
${props => props.tablet || '100%'}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (min-width: ${breakpoints.lg}) {
|
|
45
|
+
max-width: var(
|
|
46
|
+
--wp--style--global--content-size,
|
|
47
|
+
${props => props.desktop || '100%'}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (min-width: ${breakpoints.xl}) {
|
|
52
|
+
max-width: var(
|
|
53
|
+
--wp--style--global--content-size,
|
|
54
|
+
${props => props.xl || '100%'}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (max-width: ${breakpoints.md}) {
|
|
59
|
+
padding: 40px 0 0 ${props => (props.mobile ? '10px' : '20px')};
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
export const TitleSection = styled.div`
|
|
64
|
+
padding: 0;
|
|
65
|
+
margin-bottom: 16px;
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export const TitleBar = styled.div<{ applyRightPadding?: boolean }>`
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: row;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 12px;
|
|
73
|
+
border-top: 1px dashed ${colors.border};
|
|
74
|
+
border-bottom: 1px dashed ${colors.border};
|
|
75
|
+
padding: 20px ${props => (props.applyRightPadding ? '10px' : '20px')} 20px 0px;
|
|
76
|
+
|
|
77
|
+
@media (max-width: ${breakpoints.md}) {
|
|
78
|
+
justify-content: space-between;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
|
|
82
|
+
export const TitleContent = styled.div`
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
align-items: baseline;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
export const Title = styled.h2`
|
|
91
|
+
font-family: 'Times Modern', serif;
|
|
92
|
+
font-size: 24px;
|
|
93
|
+
font-weight: 800;
|
|
94
|
+
line-height: 1.13;
|
|
95
|
+
color: #145683;
|
|
96
|
+
margin: 0;
|
|
97
|
+
`;
|
|
98
|
+
|
|
99
|
+
export const Subtitle = styled.p`
|
|
100
|
+
font-family: 'Times Modern', serif;
|
|
101
|
+
font-size: 20px;
|
|
102
|
+
font-weight: 400;
|
|
103
|
+
line-height: 1.13;
|
|
104
|
+
color: #333333;
|
|
105
|
+
margin: 0;
|
|
106
|
+
vertical-align: bottom;
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
export const TitleLink = styled.a`
|
|
110
|
+
display: inline-flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
width: 32px;
|
|
114
|
+
height: 32px;
|
|
115
|
+
padding: 8px;
|
|
116
|
+
background: #eeeeee;
|
|
117
|
+
border-radius: 33.33px;
|
|
118
|
+
text-decoration: none;
|
|
119
|
+
transition: background-color 0.2s ease;
|
|
120
|
+
flex-shrink: 0;
|
|
121
|
+
|
|
122
|
+
&:hover {
|
|
123
|
+
background: #dddddd;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
svg {
|
|
127
|
+
width: 16px;
|
|
128
|
+
height: 16px;
|
|
129
|
+
color: ${colors.ink};
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
export const Description = styled.p`
|
|
134
|
+
font-family: 'Roboto', sans-serif;
|
|
135
|
+
font-size: 16px;
|
|
136
|
+
line-height: 1.5;
|
|
137
|
+
color: ${colors.secondary};
|
|
138
|
+
margin: 0 0 20px 0;
|
|
139
|
+
`;
|
|
140
|
+
|
|
141
|
+
export const StaticCardsGrid = styled.div<{
|
|
142
|
+
$minWidthMobile?: string;
|
|
143
|
+
$minWidthTablet?: string;
|
|
144
|
+
$minWidthDesktop?: string;
|
|
145
|
+
$minWidthXl?: string;
|
|
146
|
+
}>`
|
|
147
|
+
display: flex;
|
|
148
|
+
gap: 20px;
|
|
149
|
+
padding: 0;
|
|
150
|
+
flex-wrap: nowrap;
|
|
151
|
+
overflow-x: auto;
|
|
152
|
+
scroll-snap-type: x mandatory;
|
|
153
|
+
scrollbar-width: none;
|
|
154
|
+
-ms-overflow-style: none;
|
|
155
|
+
scroll-behavior: smooth;
|
|
156
|
+
align-items: stretch;
|
|
157
|
+
|
|
158
|
+
&::-webkit-scrollbar {
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
> * {
|
|
163
|
+
flex: 0 0 ${props => props.$minWidthMobile || '90%'};
|
|
164
|
+
min-width: ${props => props.$minWidthMobile || '280px'};
|
|
165
|
+
scroll-snap-align: start;
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@media (min-width: ${breakpoints.md}) {
|
|
171
|
+
overflow-x: visible;
|
|
172
|
+
|
|
173
|
+
> * {
|
|
174
|
+
flex: 1 1 0;
|
|
175
|
+
min-width: 0;
|
|
176
|
+
max-width: calc(50% - 10px);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@media (min-width: ${breakpoints.lg}) {
|
|
181
|
+
> * {
|
|
182
|
+
flex: 1 1 0;
|
|
183
|
+
min-width: 0;
|
|
184
|
+
max-width: ${props => props.$minWidthDesktop || 'calc(50% - 10px)'};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@media (min-width: ${breakpoints.xl}) {
|
|
189
|
+
> * {
|
|
190
|
+
flex: 1 1 0;
|
|
191
|
+
min-width: 0;
|
|
192
|
+
max-width: ${props => props.$minWidthXl || 'calc(50% - 10px)'};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
`;
|
|
196
|
+
|
|
197
|
+
// Card Styles
|
|
198
|
+
export const CardContainer = styled.div`
|
|
199
|
+
flex: 1;
|
|
200
|
+
border: 1.2px solid ${colors.border};
|
|
201
|
+
background: ${colors.white};
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: column;
|
|
205
|
+
`;
|
|
206
|
+
|
|
207
|
+
export const ImageContainer = styled.div<ImageContainerProps>`
|
|
208
|
+
position: relative;
|
|
209
|
+
width: auto;
|
|
210
|
+
aspect-ratio: 3 / 2;
|
|
211
|
+
height: ${({ isStaticGrid, $heightXs }) =>
|
|
212
|
+
!isStaticGrid && $heightXs ? $heightXs : '100%'};
|
|
213
|
+
overflow: hidden;
|
|
214
|
+
flex-shrink: 0;
|
|
215
|
+
|
|
216
|
+
${({ isStaticGrid, $heightSm, $heightMd, $heightLg, $heightXl }) =>
|
|
217
|
+
!isStaticGrid &&
|
|
218
|
+
`
|
|
219
|
+
|
|
220
|
+
@media (min-width: ${breakpoints.sm}) {
|
|
221
|
+
${$heightSm && `height: ${$heightSm};`}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@media (min-width: ${breakpoints.md}) {
|
|
225
|
+
${$heightMd && `height: ${$heightMd};`}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@media (min-width: ${breakpoints.lg}) {
|
|
229
|
+
${$heightLg && `height: ${$heightLg};`}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@media (min-width: ${breakpoints.xl}) {
|
|
233
|
+
${$heightXl && `height: ${$heightXl};`}
|
|
234
|
+
}
|
|
235
|
+
`};
|
|
236
|
+
`;
|
|
237
|
+
|
|
238
|
+
export const CardImage = styled.img<{ isLoaded?: boolean }>`
|
|
239
|
+
position: absolute;
|
|
240
|
+
top: 0;
|
|
241
|
+
left: 0;
|
|
242
|
+
width: 100%;
|
|
243
|
+
height: 100%;
|
|
244
|
+
object-fit: cover;
|
|
245
|
+
object-position: center;
|
|
246
|
+
display: ${props => (props.isLoaded ? 'block' : 'none')};
|
|
247
|
+
`;
|
|
248
|
+
|
|
249
|
+
export const StyledLink = styled.a`
|
|
250
|
+
text-decoration: none;
|
|
251
|
+
color: inherit;
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
export const OfferLabel = styled.div`
|
|
255
|
+
position: absolute;
|
|
256
|
+
bottom: 12px;
|
|
257
|
+
left: 0;
|
|
258
|
+
background: ${colors.offerBg};
|
|
259
|
+
border-left: 1.2px solid ${colors.offerBorder};
|
|
260
|
+
padding: 12px 16px;
|
|
261
|
+
font-family: 'Roboto', sans-serif;
|
|
262
|
+
font-size: 14px;
|
|
263
|
+
font-weight: 400;
|
|
264
|
+
line-height: 1.5;
|
|
265
|
+
color: ${colors.ink};
|
|
266
|
+
`;
|
|
267
|
+
|
|
268
|
+
export const GiftBanner = styled.div`
|
|
269
|
+
position: absolute;
|
|
270
|
+
bottom: 12px;
|
|
271
|
+
left: 0;
|
|
272
|
+
max-width: 80%;
|
|
273
|
+
background: ${colors.offerBg};
|
|
274
|
+
padding: 12px 16px;
|
|
275
|
+
font-family: 'Roboto', sans-serif;
|
|
276
|
+
font-size: 14px;
|
|
277
|
+
font-weight: 400;
|
|
278
|
+
line-height: 1.5;
|
|
279
|
+
color: ${colors.ink};
|
|
280
|
+
text-align: left;
|
|
281
|
+
`;
|
|
282
|
+
|
|
283
|
+
export const CardContent = styled.div`
|
|
284
|
+
display: flex;
|
|
285
|
+
flex-direction: column;
|
|
286
|
+
flex: 1;
|
|
287
|
+
padding: 20px 16px 16px 16px;
|
|
288
|
+
gap: 32px;
|
|
289
|
+
`;
|
|
290
|
+
|
|
291
|
+
export const TopContainer = styled.div`
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: column;
|
|
294
|
+
gap: 16px;
|
|
295
|
+
flex: 1;
|
|
296
|
+
`;
|
|
297
|
+
|
|
298
|
+
export const BottomContainer = styled.div`
|
|
299
|
+
display: flex;
|
|
300
|
+
flex-direction: column;
|
|
301
|
+
gap: 16px;
|
|
302
|
+
`;
|
|
303
|
+
|
|
304
|
+
export const Headline = styled.h3`
|
|
305
|
+
font-family: 'Times Modern', serif;
|
|
306
|
+
font-size: 20px;
|
|
307
|
+
font-weight: 700;
|
|
308
|
+
line-height: 1.125;
|
|
309
|
+
color: ${colors.ink};
|
|
310
|
+
margin: 0;
|
|
311
|
+
`;
|
|
312
|
+
|
|
313
|
+
export const DataPointsList = styled.div`
|
|
314
|
+
display: flex;
|
|
315
|
+
flex-direction: column;
|
|
316
|
+
gap: 2px;
|
|
317
|
+
`;
|
|
318
|
+
|
|
319
|
+
export const DataPoint = styled.div`
|
|
320
|
+
display: flex;
|
|
321
|
+
align-items: center;
|
|
322
|
+
gap: 8px;
|
|
323
|
+
font-family: 'Roboto', sans-serif;
|
|
324
|
+
font-size: 14px;
|
|
325
|
+
line-height: 1.5;
|
|
326
|
+
color: ${colors.secondary};
|
|
327
|
+
min-height: 21px;
|
|
328
|
+
`;
|
|
329
|
+
|
|
330
|
+
export const DataIcon = styled.span`
|
|
331
|
+
width: 17px;
|
|
332
|
+
height: 17px;
|
|
333
|
+
display: flex;
|
|
334
|
+
align-items: center;
|
|
335
|
+
justify-content: center;
|
|
336
|
+
flex-shrink: 0;
|
|
337
|
+
color: ${colors.iconBlue};
|
|
338
|
+
font-size: 17px;
|
|
339
|
+
`;
|
|
340
|
+
|
|
341
|
+
export const PriceSection = styled.div`
|
|
342
|
+
display: flex;
|
|
343
|
+
flex-direction: row;
|
|
344
|
+
align-items: center;
|
|
345
|
+
gap: 12px;
|
|
346
|
+
`;
|
|
347
|
+
|
|
348
|
+
export const PriceContainer = styled.div`
|
|
349
|
+
display: flex;
|
|
350
|
+
flex-direction: column;
|
|
351
|
+
gap: 12px;
|
|
352
|
+
flex: 1;
|
|
353
|
+
`;
|
|
354
|
+
|
|
355
|
+
export const OfferContainer = styled.div`
|
|
356
|
+
display: flex;
|
|
357
|
+
align-items: center;
|
|
358
|
+
gap: 4px;
|
|
359
|
+
`;
|
|
360
|
+
|
|
361
|
+
export const PriceLabel = styled.span`
|
|
362
|
+
font-family: 'Roboto', sans-serif;
|
|
363
|
+
font-size: 14px;
|
|
364
|
+
line-height: 1.5;
|
|
365
|
+
color: ${colors.secondary};
|
|
366
|
+
`;
|
|
367
|
+
|
|
368
|
+
export const OriginalPrice = styled.span`
|
|
369
|
+
font-family: 'Roboto', sans-serif;
|
|
370
|
+
font-size: 14px;
|
|
371
|
+
font-weight: 500;
|
|
372
|
+
line-height: 1.5;
|
|
373
|
+
color: ${colors.strikethrough};
|
|
374
|
+
text-decoration: line-through;
|
|
375
|
+
`;
|
|
376
|
+
|
|
377
|
+
export const CurrentPrice = styled.span<CurrentPriceProps>`
|
|
378
|
+
font-family: 'Times Modern', serif;
|
|
379
|
+
font-size: ${props => (props.$isEnquire ? '24px' : '32px')};
|
|
380
|
+
font-weight: 300;
|
|
381
|
+
line-height: 1.125;
|
|
382
|
+
color: ${colors.ink};
|
|
383
|
+
`;
|
|
384
|
+
|
|
385
|
+
export const PriceSuffix = styled.span`
|
|
386
|
+
font-family: 'Times Modern', serif;
|
|
387
|
+
font-size: 24px;
|
|
388
|
+
font-weight: 300;
|
|
389
|
+
line-height: 1.125;
|
|
390
|
+
color: ${colors.ink};
|
|
391
|
+
`;
|
|
392
|
+
|
|
393
|
+
export const LogoContainer = styled.div`
|
|
394
|
+
width: 88px;
|
|
395
|
+
height: 44px;
|
|
396
|
+
display: flex;
|
|
397
|
+
align-items: center;
|
|
398
|
+
|
|
399
|
+
a {
|
|
400
|
+
display: flex;
|
|
401
|
+
align-items: center;
|
|
402
|
+
width: 100%;
|
|
403
|
+
height: 100%;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
img {
|
|
407
|
+
max-width: 100%;
|
|
408
|
+
max-height: 100%;
|
|
409
|
+
object-fit: contain;
|
|
410
|
+
}
|
|
411
|
+
`;
|
|
412
|
+
|
|
413
|
+
export const CTAButton = styled.a`
|
|
414
|
+
display: flex;
|
|
415
|
+
align-items: center;
|
|
416
|
+
justify-content: center;
|
|
417
|
+
width: 100%;
|
|
418
|
+
padding: 12px 16px;
|
|
419
|
+
background: ${colors.primary};
|
|
420
|
+
color: ${colors.white};
|
|
421
|
+
font-family: 'Roboto', sans-serif;
|
|
422
|
+
font-size: 16px;
|
|
423
|
+
font-weight: 500;
|
|
424
|
+
line-height: 1.5;
|
|
425
|
+
text-decoration: none;
|
|
426
|
+
transition: background 0.2s ease;
|
|
427
|
+
|
|
428
|
+
&:hover {
|
|
429
|
+
background: #004a6e;
|
|
430
|
+
}
|
|
431
|
+
`;
|
|
432
|
+
|
|
433
|
+
// Navigation Arrow - positioned on sides of carousel
|
|
434
|
+
export const LoadingContainer = styled.div`
|
|
435
|
+
display: flex;
|
|
436
|
+
justify-content: center;
|
|
437
|
+
align-items: center;
|
|
438
|
+
min-height: 400px;
|
|
439
|
+
font-family: 'Roboto', sans-serif;
|
|
440
|
+
color: ${colors.secondary};
|
|
441
|
+
`;
|
|
442
|
+
|
|
443
|
+
export const ErrorContainer = styled.div`
|
|
444
|
+
display: flex;
|
|
445
|
+
justify-content: center;
|
|
446
|
+
align-items: center;
|
|
447
|
+
min-height: 200px;
|
|
448
|
+
font-family: 'Roboto', sans-serif;
|
|
449
|
+
color: ${colors.strikethrough};
|
|
450
|
+
`;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ResponsiveConfig {
|
|
4
|
+
xs?: string;
|
|
5
|
+
mobile?: string;
|
|
6
|
+
tablet?: string;
|
|
7
|
+
desktop?: string;
|
|
8
|
+
xl?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ResponsiveConfigNoXs = Omit<ResponsiveConfig, 'xs'>;
|
|
12
|
+
|
|
13
|
+
export interface ImageHeightConfig {
|
|
14
|
+
$heightXs?: string;
|
|
15
|
+
$heightSm?: string;
|
|
16
|
+
$heightMd?: string;
|
|
17
|
+
$heightLg?: string;
|
|
18
|
+
$heightXl?: string;
|
|
19
|
+
isStaticGrid?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface TripCardsElement {
|
|
23
|
+
class?: string;
|
|
24
|
+
tripcards: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
titleurl?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TripCardsProps {
|
|
31
|
+
element: TripCardsElement;
|
|
32
|
+
useMockData?: boolean;
|
|
33
|
+
widthContainerConfig?: ResponsiveConfig;
|
|
34
|
+
widthItemConfig?: ResponsiveConfig;
|
|
35
|
+
maxWidthItemConfig?: ResponsiveConfig;
|
|
36
|
+
imgHeight?: ImageHeightConfig;
|
|
37
|
+
forceStaticGrid?: boolean;
|
|
38
|
+
hostName?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface DecodedTripCard {
|
|
42
|
+
cruise_id: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface TripCardApiData {
|
|
46
|
+
cruise_id: string;
|
|
47
|
+
image: string;
|
|
48
|
+
offer_label?: string;
|
|
49
|
+
gift_banner?: string;
|
|
50
|
+
headline: string;
|
|
51
|
+
date: string;
|
|
52
|
+
duration: string;
|
|
53
|
+
route: string;
|
|
54
|
+
ship: string;
|
|
55
|
+
original_price?: string;
|
|
56
|
+
price: string;
|
|
57
|
+
logo: string;
|
|
58
|
+
logo_url: string;
|
|
59
|
+
logo_name: string;
|
|
60
|
+
cta_url: string;
|
|
61
|
+
cta_text?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface TripCardProps {
|
|
65
|
+
card: TripCardApiData;
|
|
66
|
+
isStaticGrid?: boolean;
|
|
67
|
+
imgHeight?: ImageHeightConfig;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ApiCruiseResult {
|
|
71
|
+
post_id: number;
|
|
72
|
+
cruise_id: number;
|
|
73
|
+
cruise_title: string;
|
|
74
|
+
cruise_line: {
|
|
75
|
+
name: string;
|
|
76
|
+
link: string;
|
|
77
|
+
logo: string;
|
|
78
|
+
};
|
|
79
|
+
ship: {
|
|
80
|
+
name: string;
|
|
81
|
+
link: string;
|
|
82
|
+
image: string;
|
|
83
|
+
};
|
|
84
|
+
departs: string;
|
|
85
|
+
ends: string;
|
|
86
|
+
date_label: string;
|
|
87
|
+
destination: string[];
|
|
88
|
+
duration: number;
|
|
89
|
+
itinerary: string[];
|
|
90
|
+
prices: {
|
|
91
|
+
cheapest_price: number | string;
|
|
92
|
+
inside: string | number;
|
|
93
|
+
outside: string | number;
|
|
94
|
+
balcony: string | number;
|
|
95
|
+
suite: string | number;
|
|
96
|
+
};
|
|
97
|
+
was_prices: {
|
|
98
|
+
inside: number;
|
|
99
|
+
outside: number;
|
|
100
|
+
balcony: number;
|
|
101
|
+
suite: number;
|
|
102
|
+
};
|
|
103
|
+
link: string;
|
|
104
|
+
campaigns: string[];
|
|
105
|
+
extras: {
|
|
106
|
+
date: string;
|
|
107
|
+
duration: string;
|
|
108
|
+
destination: string;
|
|
109
|
+
info: string;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface TripCardsLayoutProps {
|
|
113
|
+
element: TripCardsElement;
|
|
114
|
+
items: Array<{ id: string | number; data?: TripCardApiData }>;
|
|
115
|
+
CardComponent: ComponentType<any>;
|
|
116
|
+
itemsPerPage: number;
|
|
117
|
+
widthContainerConfig?: ResponsiveConfig;
|
|
118
|
+
widthItemConfig?: ResponsiveConfig;
|
|
119
|
+
maxWidthItemConfig?: ResponsiveConfig;
|
|
120
|
+
imgHeight?: ImageHeightConfig;
|
|
121
|
+
forceStaticGrid?: boolean;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export type ImageContainerProps = ImageHeightConfig;
|
|
125
|
+
|
|
126
|
+
export type ContainerProps = Partial<ResponsiveConfig>;
|
|
127
|
+
|
|
128
|
+
export interface CurrentPriceProps {
|
|
129
|
+
$isEnquire?: boolean;
|
|
130
|
+
}
|
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';
|
package/src/utils/cookie.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export const hasCookieConsent = () =>
|
|
2
2
|
typeof window !== 'undefined' &&
|
|
3
3
|
window.document.cookie.indexOf('nuk-consent-personalisation=1') >= 0;
|
|
4
|
+
|
|
5
|
+
export const getPreferredEdition = () => {
|
|
6
|
+
if (!window || !window.nuk) {
|
|
7
|
+
return 'uk';
|
|
8
|
+
}
|
|
9
|
+
const edition = window.nuk.getCookieValue('nuk_preferred_edition') || 'uk';
|
|
10
|
+
return edition.toLowerCase();
|
|
11
|
+
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import { FacebookContainer } from "../styles";
|
|
3
|
-
import { useSocialEmbedsContext } from "../../../contexts/SocialEmbedsProvider";
|
|
4
|
-
export const Facebook = ({ url }) => {
|
|
5
|
-
const { isSocialEmbedAllowed, isAllowedOnce } = useSocialEmbedsContext();
|
|
6
|
-
// Only render and load SDK if consent is given
|
|
7
|
-
const allowed = isSocialEmbedAllowed.facebook === true || isAllowedOnce.facebook === true;
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (!allowed)
|
|
10
|
-
return; // Don't load SDK if user hasn't consented
|
|
11
|
-
// Create fb-root only once
|
|
12
|
-
if (!document.getElementById("fb-root")) {
|
|
13
|
-
const fbRoot = document.createElement("div");
|
|
14
|
-
fbRoot.id = "fb-root";
|
|
15
|
-
document.body.appendChild(fbRoot);
|
|
16
|
-
}
|
|
17
|
-
// Load SDK only once
|
|
18
|
-
if (!window.FB) {
|
|
19
|
-
const script = document.createElement("script");
|
|
20
|
-
script.src =
|
|
21
|
-
"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v18.0";
|
|
22
|
-
script.async = true;
|
|
23
|
-
script.defer = true;
|
|
24
|
-
script.crossOrigin = "anonymous";
|
|
25
|
-
document.body.appendChild(script);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
// Re-parse if SDK already loaded
|
|
29
|
-
window.FB.XFBML.parse();
|
|
30
|
-
}
|
|
31
|
-
}, [allowed]); // Re-run if consent changes
|
|
32
|
-
if (!allowed) {
|
|
33
|
-
return null; // Block rendering if no consent
|
|
34
|
-
}
|
|
35
|
-
return (React.createElement(FacebookContainer, { className: "fb-post", "data-href": url, "data-width": "500", "data-show-text": "true" }));
|
|
36
|
-
};
|
|
37
|
-
/* import React, { useEffect } from 'react';
|
|
38
|
-
import { FacebookContainer } from '../styles';
|
|
39
|
-
import { Placeholder } from '@times-components/image';
|
|
40
|
-
|
|
41
|
-
export const Facebook = ({ url }: { url: string }) => {
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (!document.getElementById('fb-root')) {
|
|
44
|
-
const fbRoot = document.createElement('div');
|
|
45
|
-
fbRoot.id = 'fb-root';
|
|
46
|
-
document.body.appendChild(fbRoot);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Load SDK only once
|
|
50
|
-
if (!(window as any).FB) {
|
|
51
|
-
const script = document.createElement('script');
|
|
52
|
-
script.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v18.0';
|
|
53
|
-
script.async = true;
|
|
54
|
-
script.defer = true;
|
|
55
|
-
script.crossOrigin = 'anonymous';
|
|
56
|
-
document.body.appendChild(script);
|
|
57
|
-
} else {
|
|
58
|
-
// If SDK already loaded, re-parse
|
|
59
|
-
(window as any).FB.XFBML.parse();
|
|
60
|
-
}
|
|
61
|
-
}, []);
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<FacebookContainer
|
|
65
|
-
className="fb-post"
|
|
66
|
-
data-href={url}
|
|
67
|
-
data-width="500"
|
|
68
|
-
data-show-text="true"
|
|
69
|
-
>
|
|
70
|
-
<Placeholder />
|
|
71
|
-
</FacebookContainer>
|
|
72
|
-
);
|
|
73
|
-
}; */
|
|
74
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRmFjZWJvb2tDb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9zb2NpYWwtZW1iZWQvY29tcG9uZW50cy9GYWNlYm9va0NvbXBvbmVudC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsRUFBRSxTQUFTLEVBQUUsTUFBTSxPQUFPLENBQUM7QUFDekMsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sV0FBVyxDQUFDO0FBQzlDLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLHdDQUF3QyxDQUFDO0FBT2hGLE1BQU0sQ0FBQyxNQUFNLFFBQVEsR0FBNEIsQ0FBQyxFQUFFLEdBQUcsRUFBRSxFQUFFLEVBQUU7SUFDM0QsTUFBTSxFQUFFLG9CQUFvQixFQUFFLGFBQWEsRUFBRSxHQUFHLHNCQUFzQixFQUFFLENBQUM7SUFFekUsK0NBQStDO0lBQy9DLE1BQU0sT0FBTyxHQUNYLG9CQUFvQixDQUFDLFFBQVEsS0FBSyxJQUFJLElBQUksYUFBYSxDQUFDLFFBQVEsS0FBSyxJQUFJLENBQUM7SUFFNUUsU0FBUyxDQUFDLEdBQUcsRUFBRTtRQUNiLElBQUksQ0FBQyxPQUFPO1lBQUUsT0FBTyxDQUFDLDBDQUEwQztRQUVoRSwyQkFBMkI7UUFDM0IsSUFBSSxDQUFDLFFBQVEsQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLEVBQUU7WUFDdkMsTUFBTSxNQUFNLEdBQUcsUUFBUSxDQUFDLGFBQWEsQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUM3QyxNQUFNLENBQUMsRUFBRSxHQUFHLFNBQVMsQ0FBQztZQUN0QixRQUFRLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsQ0FBQztTQUNuQztRQUVELHFCQUFxQjtRQUNyQixJQUFJLENBQUUsTUFBYyxDQUFDLEVBQUUsRUFBRTtZQUN2QixNQUFNLE1BQU0sR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1lBQ2hELE1BQU0sQ0FBQyxHQUFHO2dCQUNSLGlFQUFpRSxDQUFDO1lBQ3BFLE1BQU0sQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDO1lBQ3BCLE1BQU0sQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDO1lBQ3BCLE1BQU0sQ0FBQyxXQUFXLEdBQUcsV0FBVyxDQUFDO1lBQ2pDLFFBQVEsQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1NBQ25DO2FBQU07WUFDTCxpQ0FBaUM7WUFDaEMsTUFBYyxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsS0FBSyxFQUFFLENBQUM7U0FDbEM7SUFDSCxDQUFDLEVBQUUsQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsNEJBQTRCO0lBRTNDLElBQUksQ0FBQyxPQUFPLEVBQUU7UUFDWixPQUFPLElBQUksQ0FBQyxDQUFDLGdDQUFnQztLQUM5QztJQUVELE9BQU8sQ0FDTCxvQkFBQyxpQkFBaUIsSUFDaEIsU0FBUyxFQUFDLFNBQVMsZUFDUixHQUFHLGdCQUNILEtBQUssb0JBQ0QsTUFBTSxHQUNyQixDQUNILENBQUM7QUFDSixDQUFDLENBQUM7QUFFRjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0tBb0NLIn0=
|