@times-components/ts-components 1.150.0 → 1.151.0

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/clarkson-says/ClarksonSays.stories.d.ts +1 -0
  3. package/dist/components/clarkson-says/ClarksonSays.stories.js +5 -0
  4. package/dist/components/clarkson-says/assets/ChatIcon.d.ts +1 -0
  5. package/dist/components/clarkson-says/assets/ChatIcon.js +8 -0
  6. package/dist/components/clarkson-says/assets/ChevronDown.d.ts +1 -0
  7. package/dist/components/clarkson-says/assets/ChevronDown.js +7 -0
  8. package/dist/components/clarkson-says/assets/OpenAIIcon.d.ts +1 -0
  9. package/dist/components/clarkson-says/assets/OpenAIIcon.js +8 -0
  10. package/dist/components/clarkson-says/components/CardHero.d.ts +3 -0
  11. package/dist/components/clarkson-says/components/CardHero.js +12 -0
  12. package/dist/components/clarkson-says/components/CategoriesRows.d.ts +6 -0
  13. package/dist/components/clarkson-says/components/CategoriesRows.js +41 -0
  14. package/dist/components/clarkson-says/components/ErrorView.d.ts +6 -0
  15. package/dist/components/clarkson-says/components/ErrorView.js +32 -0
  16. package/dist/components/clarkson-says/components/GradientOverlay.d.ts +1 -0
  17. package/dist/components/clarkson-says/components/GradientOverlay.js +73 -0
  18. package/dist/components/clarkson-says/components/LoadingView.d.ts +7 -0
  19. package/dist/components/clarkson-says/components/LoadingView.js +42 -0
  20. package/dist/components/clarkson-says/components/ProductBetaBadge.d.ts +7 -0
  21. package/dist/components/clarkson-says/components/ProductBetaBadge.js +208 -0
  22. package/dist/components/clarkson-says/components/ResponseCard.d.ts +9 -0
  23. package/dist/components/clarkson-says/components/ResponseCard.js +45 -0
  24. package/dist/components/clarkson-says/components/styles.d.ts +102 -0
  25. package/dist/components/clarkson-says/components/styles.js +379 -0
  26. package/dist/components/clarkson-says/data/clarkson-responses.json +1788 -0
  27. package/dist/components/clarkson-says/index.d.ts +4 -0
  28. package/dist/components/clarkson-says/index.js +84 -0
  29. package/dist/components/clarkson-says/types.d.ts +22 -0
  30. package/dist/components/clarkson-says/types.js +2 -0
  31. package/dist/components/clarkson-says/utils.d.ts +3 -0
  32. package/dist/components/clarkson-says/utils.js +32 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +2 -1
  35. package/jest.config.js +4 -2
  36. package/package.json +13 -13
  37. package/rnw.js +1 -1
  38. package/src/components/clarkson-says/ClarksonSays.stories.tsx +7 -0
  39. package/src/components/clarkson-says/assets/ChatIcon.tsx +33 -0
  40. package/src/components/clarkson-says/assets/ChevronDown.tsx +28 -0
  41. package/src/components/clarkson-says/assets/OpenAIIcon.tsx +34 -0
  42. package/src/components/clarkson-says/components/CardHero.tsx +20 -0
  43. package/src/components/clarkson-says/components/CategoriesRows.tsx +90 -0
  44. package/src/components/clarkson-says/components/ErrorView.tsx +53 -0
  45. package/src/components/clarkson-says/components/GradientOverlay.tsx +83 -0
  46. package/src/components/clarkson-says/components/LoadingView.tsx +70 -0
  47. package/src/components/clarkson-says/components/ProductBetaBadge.tsx +294 -0
  48. package/src/components/clarkson-says/components/ResponseCard.tsx +144 -0
  49. package/src/components/clarkson-says/components/styles.ts +434 -0
  50. package/src/components/clarkson-says/data/clarkson-responses.json +1788 -0
  51. package/src/components/clarkson-says/index.tsx +133 -0
  52. package/src/components/clarkson-says/types.ts +23 -0
  53. package/src/components/clarkson-says/utils.ts +35 -0
  54. package/src/index.ts +1 -0
@@ -0,0 +1,434 @@
1
+ import styled, { keyframes } from 'styled-components';
2
+
3
+ export const PageContainer = styled.div<{ isEmbeddedMode?: boolean }>`
4
+ display: grid;
5
+ place-items: center;
6
+ font-family: Roboto, sans-serif;
7
+ margin: 20px auto 0 auto;
8
+
9
+ h1,
10
+ h2,
11
+ h3,
12
+ h4,
13
+ h5,
14
+ h6,
15
+ p,
16
+ span {
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+ `;
21
+
22
+ export const Card = styled.div<{ isApp?: boolean; embedded?: boolean }>`
23
+ position: relative;
24
+ width: 100%;
25
+ max-width: 680px;
26
+ margin: auto;
27
+ color: ${p => (p.isApp ? '#fff' : '#000')};
28
+ background-color: #fafafa;
29
+ ${p => !p.embedded && `max-width: 680px; margin: 0 auto;`};
30
+ @media (min-width: 769px) {
31
+ min-width: 680px;
32
+ }
33
+ `;
34
+
35
+ export const TopBar = styled.div<{ isApp?: boolean }>`
36
+ width: 100%;
37
+ height: 3px;
38
+ background: ${p => (p.isApp ? '#fff' : '#000')};
39
+ `;
40
+
41
+ export const Section = styled.div`
42
+ padding: 16px;
43
+ @media (min-width: 768px) {
44
+ padding: 32px;
45
+ }
46
+ `;
47
+
48
+ export const HeroRow = styled.div`
49
+ text-align: center;
50
+ `;
51
+
52
+ export const TitleGroup = styled.div`
53
+ margin-bottom: 20px;
54
+ `;
55
+
56
+ export const TitleContainer = styled.div`
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ gap: 16px;
61
+ margin-bottom: 8px;
62
+ `;
63
+
64
+ export const H1 = styled.h1`
65
+ font-size: 32px;
66
+ font-family: Times Modern;
67
+ font-weight: 700;
68
+ line-height: 1.12;
69
+ color: #1a1a1a;
70
+ `;
71
+
72
+ export const H2 = styled.h2<{ isApp?: boolean }>`
73
+ font-size: 20px;
74
+ font-weight: 400;
75
+ font-family: Times Modern, sans-serif;
76
+ line-height: 1.12;
77
+ color: #737373;
78
+ padding: 0 16px;
79
+ `;
80
+
81
+ export const ArticlesHeading = styled.h3`
82
+ font-family: Times Modern;
83
+ font-size: 24px;
84
+ font-weight: 400;
85
+ color: #1a1a1a;
86
+ `;
87
+
88
+ export const TopicCount = styled.span<{ isApp?: boolean }>`
89
+ font-size: 14px;
90
+ line-height: 1.5;
91
+ font-weight: 500;
92
+ font-family: Roboto, sans-serif;
93
+ color: #737373;
94
+ `;
95
+
96
+ export const CategoryHeader = styled.div`
97
+ display: flex;
98
+ align-items: center;
99
+ justify-content: space-between;
100
+ margin-bottom: 16px;
101
+
102
+ @media (max-width: 768px) {
103
+ flex-direction: column;
104
+ align-items: flex-start;
105
+ text-align: left;
106
+ gap: 4px;
107
+ }
108
+ `;
109
+
110
+ export const CategorySubheading = styled.h3`
111
+ margin-bottom: 16px;
112
+ font-family: Roboto, sans-serif;
113
+ font-weight: 500;
114
+ font-size: 20px;
115
+ line-height: 1.25;
116
+ color: #1a1a1a;
117
+ `;
118
+
119
+ export const TopicsRow = styled.div`
120
+ display: flex;
121
+ justify-content: space-between;
122
+ gap: 16px;
123
+ `;
124
+
125
+ export const TopicsWrap = styled.div`
126
+ display: flex;
127
+ flex-wrap: wrap;
128
+ gap: 8px;
129
+ `;
130
+
131
+ export const CategoryRowContainer = styled.div<{ isApp?: boolean }>`
132
+ border: 1px solid #e6e6e6;
133
+ border-radius: 4px;
134
+ padding: 16px;
135
+ margin-bottom: 16px;
136
+ background: #ffffff;
137
+ position: relative;
138
+ `;
139
+
140
+ export const CategoryTopicButton = styled.button<{ isApp?: boolean }>`
141
+ border: 1px solid #cccccc;
142
+ color: #404040;
143
+ padding: 5px 12px;
144
+ background: #ffffff;
145
+ font-size: 16px;
146
+ font-weight: 400;
147
+ text-transform: none;
148
+ border-radius: 16px;
149
+ cursor: pointer;
150
+ &:hover {
151
+ background: #f3f4f6;
152
+ }
153
+ `;
154
+
155
+ export const ShowMoreButtonContainer = styled.div`
156
+ display: flex;
157
+ align-items: center;
158
+ margin-top: 16px;
159
+
160
+ &[aria-expanded='true'] svg {
161
+ transform: rotate(180deg);
162
+ }
163
+ `;
164
+
165
+ export const ShowMoreButton = styled.button<{ isApp?: boolean }>`
166
+ border: none;
167
+ background: transparent;
168
+ color: #005c8a;
169
+ font-size: 14px;
170
+ cursor: pointer;
171
+ text-decoration: underline;
172
+ &:hover {
173
+ opacity: 0.9;
174
+ }
175
+ `;
176
+
177
+ export const TopicButton = styled.button<{ isApp?: boolean }>`
178
+ border: 1px solid ${p => (p.isApp ? '#fff' : '#0f766e')};
179
+ color: ${p => (p.isApp ? '#fff' : '#000')};
180
+ background: transparent;
181
+ padding: 4px 8px;
182
+ font-size: 124x;
183
+ font-weight: 600;
184
+ text-transform: uppercase;
185
+ cursor: pointer;
186
+ &:hover {
187
+ background: ${p => (p.isApp ? '#1f2937' : '#e5e7eb')};
188
+ }
189
+ `;
190
+
191
+ export const IconButton = styled.button<{ isApp?: boolean }>`
192
+ border: none;
193
+ background: transparent;
194
+ cursor: pointer;
195
+ color: ${p => (p.isApp ? '#fff' : '#0f766e')};
196
+ &:hover {
197
+ color: ${p => (p.isApp ? '#e5e7eb' : '#1f2937')};
198
+ }
199
+ `;
200
+
201
+ // Horizontal scrolling carousel styles
202
+ export const CarouselRow = styled.div`
203
+ margin-top: 8px;
204
+ position: relative;
205
+ `;
206
+
207
+ export const CarouselTrack = styled.div`
208
+ display: flex;
209
+ gap: 8px;
210
+ overflow-x: auto;
211
+ -webkit-overflow-scrolling: touch;
212
+ scroll-snap-type: x proximity;
213
+ padding-bottom: 8px;
214
+ margin-right: 40px;
215
+
216
+ /* hide scrollbar in WebKit */
217
+ &::-webkit-scrollbar {
218
+ height: 6px;
219
+ }
220
+ `;
221
+
222
+ export const CarouselItemButton = styled(TopicButton)`
223
+ flex: 0 0 auto;
224
+ scroll-snap-align: start;
225
+ `;
226
+
227
+ export const CarouselNavButton = styled.button<{
228
+ isApp?: boolean;
229
+ side: 'left' | 'right';
230
+ visible?: boolean;
231
+ }>`
232
+ position: absolute;
233
+ top: 0;
234
+ ${p =>
235
+ p.side === 'left' ? 'left: 0px;' : 'right: 0px;'} display: inline-flex;
236
+ align-items: center;
237
+ justify-content: center;
238
+ padding: 4px 8px;
239
+ border-radius: 0;
240
+ border: 1px solid ${p => (p.isApp ? '#fff' : '#000')};
241
+ color: ${p => (p.isApp ? '#fff' : '#000')};
242
+ font-size: 14px;
243
+ font-weight: 600;
244
+ text-transform: uppercase;
245
+ z-index: 2;
246
+ cursor: pointer;
247
+ opacity: ${p => (p.visible ? 1 : 0)};
248
+ pointer-events: ${p => (p.visible ? 'auto' : 'none')};
249
+ transition: opacity 200ms ease;
250
+ &:hover {
251
+ background: ${p => (p.isApp ? '#1f2937' : '#e5e7eb')};
252
+ }
253
+ `;
254
+
255
+ export const CardFooter = styled.div`
256
+ display: flex;
257
+ flex-direction: column;
258
+ align-items: center;
259
+ gap: 8px;
260
+ margin-top: 20px;
261
+ @media (min-width: 768px) {
262
+ flex-direction: row;
263
+ width: 100%;
264
+ gap: 20px;
265
+ justify-content: center;
266
+ }
267
+ `;
268
+
269
+ export const Disclaimer = styled.div<{ isApp?: boolean; marginTop?: number }>`
270
+ display: flex;
271
+ align-items: center;
272
+ justify-content: center;
273
+ gap: 4px;
274
+ margin-top: ${p => (p.marginTop !== undefined ? `${p.marginTop}px` : '0')};
275
+ span {
276
+ font-family: Roboto, sans-serif;
277
+ text-align: center;
278
+ font-size: 12px;
279
+ line-height: 1.5;
280
+ font-weight: 400;
281
+ color: #404040;
282
+ }
283
+ `;
284
+
285
+ export const overlaySpin = keyframes`
286
+ 0% { transform: rotate(0deg); }
287
+ 100% { transform: rotate(360deg); }
288
+ `;
289
+
290
+ export const Overlay = styled.div<{ isApp?: boolean }>`
291
+ position: absolute;
292
+ inset: 0;
293
+ z-index: 3;
294
+ background: ${p => (p.isApp ? '#0f172a' : '#ffffff')};
295
+ `;
296
+
297
+ export const Spinner = styled.div<{ isApp?: boolean }>`
298
+ width: 40px;
299
+ height: 40px;
300
+ border: 3px solid ${p => (p.isApp ? '#fff' : '#1a1a1a')};
301
+ border-top-color: transparent;
302
+ border-radius: 9999px;
303
+ animation: ${overlaySpin} 1s linear infinite;
304
+ margin-bottom: 24px;
305
+ `;
306
+
307
+ export const ProgressBarShell = styled.div<{ isApp?: boolean; width?: number }>`
308
+ height: 3px;
309
+ background: ${p => (p.isApp ? '#fff' : '#1a1a1a')};
310
+ width: ${p =>
311
+ p.width !== undefined && p.width !== null ? `${p.width}%` : '100%'};
312
+ transition: width 300ms ease;
313
+ `;
314
+
315
+ export const BackButton = styled.button<{ isApp?: boolean }>`
316
+ display: inline-flex;
317
+ align-items: center;
318
+ gap: 8px;
319
+ font-weight: 700;
320
+ text-transform: uppercase;
321
+ font-size: 14px;
322
+ color: ${p => (p.isApp ? '#fff' : '#fff')};
323
+ background: ${p => (p.isApp ? '#005c8a' : '#005c8a')};
324
+ padding: 12px 16px;
325
+ border: none;
326
+ cursor: pointer;
327
+ &:hover {
328
+ opacity: 0.9;
329
+ }
330
+ `;
331
+
332
+ export const Label = styled.h2<{ isApp?: boolean }>`
333
+ display: inline-block;
334
+ font-size: 12px;
335
+ font-weight: 400;
336
+ text-transform: uppercase;
337
+ font-family: Roboto, sans-serif;
338
+ letter-spacing: 0.08em;
339
+ color: #404040;
340
+ padding-bottom: 8px !important;
341
+ `;
342
+
343
+ export const Description = styled.p<{ isApp?: boolean }>`
344
+ color: #737373;
345
+ font-family: Roboto, sans-serif;
346
+ text-align: left;
347
+ margin-top: 8px !important;
348
+ margin-bottom: 20px !important;
349
+ font-size: 16px;
350
+ `;
351
+
352
+ export const ArticleCard = styled.a<{ isApp?: boolean; clickable?: boolean }>`
353
+ display: block;
354
+ margin-top: 16px;
355
+ padding: 16px;
356
+ border-radius: 4px;
357
+ border: 1px solid #e6e6e6;
358
+ text-decoration: none;
359
+ background: #ffffff;
360
+ position: relative;
361
+ color: inherit;
362
+ ${p =>
363
+ p.clickable &&
364
+ `cursor: pointer; &:hover { background: ${
365
+ p.isApp ? '#1f2937' : '#f9fafb'
366
+ }; border-color: ${p.isApp ? '#fff' : '#000'}; }`};
367
+ `;
368
+
369
+ export const ArticleRow = styled.div`
370
+ display: flex;
371
+ justify-content: space-between;
372
+ `;
373
+
374
+ export const ArticleDate = styled.p<{ isApp?: boolean }>`
375
+ font-size: 14px;
376
+ font-weight: 500;
377
+ line-height: 1.5;
378
+ margin: 0 0 12px 0 !important;
379
+ color: #727272;
380
+ `;
381
+
382
+ export const ArticleHeadline = styled.p<{ isApp?: boolean }>`
383
+ font-size: 24px;
384
+ font-weight: 400;
385
+ font-family: Times Modern;
386
+ margin: 0 0 12px 0 !important;
387
+ color: #1a1a1a;
388
+ `;
389
+
390
+ export const ArticleSnippet = styled.p<{ isApp?: boolean }>`
391
+ font-style: italic;
392
+ color: #404040;
393
+ font-size: 16px;
394
+ `;
395
+
396
+ export const QuoteBlock = styled.div<{ isApp?: boolean }>`
397
+ position: relative;
398
+ margin-top: 16px;
399
+ padding: 64px 16px;
400
+ border-radius: 12px;
401
+ background: ${p => (p.isApp ? '#1f2937' : '#e5e7eb')};
402
+ color: ${p => (p.isApp ? '#e5e7eb' : '#1f2937')};
403
+ `;
404
+
405
+ export const QuoteMark = styled.span<{
406
+ isApp?: boolean;
407
+ position?: 'left' | 'right';
408
+ }>`
409
+ position: absolute;
410
+ pointer-events: none;
411
+ ${p =>
412
+ p.position === 'left'
413
+ ? 'left: 8px; top: 0; transform: translateY(-20px);'
414
+ : 'right: 8px; bottom: 16px;'} font-family: Georgia, serif;
415
+ font-size: 108px;
416
+ height: 64px;
417
+ line-height: 0.8;
418
+ color: ${p => (p.isApp ? '#64748b' : '#9ca3af')};
419
+ `;
420
+
421
+ export const Signature = styled.span<{ isApp?: boolean }>`
422
+ position: absolute;
423
+ left: 16px;
424
+ bottom: 8px;
425
+ font-weight: 600;
426
+ color: ${p => (p.isApp ? '#fff' : '#000')};
427
+ `;
428
+
429
+ export const ResponseCardFooter = styled.div`
430
+ display: flex;
431
+ flex-direction: column;
432
+ align-items: center;
433
+ margin-top: 32px;
434
+ `;