@apolitical/component-library 1.13.6 → 1.14.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 (46) hide show
  1. package/cards/card/card.d.ts +3 -0
  2. package/cards/card/card.data.d.ts +11 -0
  3. package/cards/card/card.helpers.d.ts +5 -0
  4. package/cards/card/components/details/details.d.ts +9 -0
  5. package/cards/card/components/details/index.d.ts +1 -0
  6. package/cards/card/components/index.d.ts +2 -0
  7. package/cards/card/components/links/index.d.ts +1 -0
  8. package/cards/card/components/links/links.d.ts +13 -0
  9. package/cards/card/index.d.ts +1 -0
  10. package/cards/card-block/card-block.d.ts +15 -0
  11. package/cards/card-block/index.d.ts +1 -0
  12. package/cards/cards.types.d.ts +133 -0
  13. package/cards/carousel/carousel.d.ts +3 -0
  14. package/cards/carousel/components/carousel/carousel.d.ts +8 -0
  15. package/cards/carousel/components/carousel/carousel.helpers.d.ts +1 -0
  16. package/cards/carousel/components/carousel/index.d.ts +1 -0
  17. package/cards/carousel/components/index.d.ts +2 -0
  18. package/cards/carousel/components/title/index.d.ts +1 -0
  19. package/cards/carousel/components/title/title.d.ts +13 -0
  20. package/cards/carousel/index.d.ts +1 -0
  21. package/cards/index.d.ts +3 -0
  22. package/cards/mocks/card.d.ts +235 -0
  23. package/cards/mocks/carousel.d.ts +58 -0
  24. package/cards/mocks/index.d.ts +3 -0
  25. package/cards/mocks/mocks.helpers.d.ts +500 -0
  26. package/helpers/cases.d.ts +1 -0
  27. package/helpers/dates.d.ts +1 -2
  28. package/helpers/index.d.ts +1 -0
  29. package/helpers/intl.d.ts +1 -0
  30. package/hooks/index.d.ts +1 -1
  31. package/hooks/{use-screen-width.d.ts → use-element-width.d.ts} +1 -1
  32. package/index.js +7 -7
  33. package/index.mjs +583 -439
  34. package/layout/content-layout/columns/columns.d.ts +1 -1
  35. package/loaders/loading-state/loading-state.d.ts +8 -2
  36. package/package.json +1 -1
  37. package/style.css +1 -1
  38. package/styles/base/_text.scss +41 -15
  39. package/styles/base/_titles.scss +22 -0
  40. package/styles/mixins/_containers.scss +18 -0
  41. package/styles/mixins/_index.scss +1 -0
  42. package/styles/variables/colors/_theme.scss +33 -1
  43. package/text/empty-state-box/empty-state-box.d.ts +1 -1
  44. package/text/pill/pill.d.ts +6 -4
  45. package/user/contributors/contributors.d.ts +7 -1
  46. package/user/profile-picture/profile-picture.d.ts +2 -0
@@ -0,0 +1,500 @@
1
+ import { MockCardType, CardType } from './../cards.types';
2
+ export declare const CONTENT_TYPES: {
3
+ ARTICLE: string;
4
+ COURSE: string;
5
+ EVENT: string;
6
+ LIST: string;
7
+ QUESTION: string;
8
+ PEOPLE: string;
9
+ LEARNING_HUB: string;
10
+ CUSTOM: string;
11
+ };
12
+ export declare const buildCard: (contentType: string, cardType?: string | null) => {
13
+ contentType: string;
14
+ cardType: string | null;
15
+ sys: {
16
+ id: string;
17
+ linkType: string;
18
+ type: string;
19
+ };
20
+ };
21
+ export declare const cardMapper: {
22
+ [x: string]: {
23
+ oneAuthor: {
24
+ contentType: string;
25
+ banner: {
26
+ description: string;
27
+ height: number;
28
+ type: string;
29
+ url: string;
30
+ width: number;
31
+ aspect: string;
32
+ query: string;
33
+ };
34
+ contributors: {
35
+ name: string;
36
+ image: null;
37
+ }[];
38
+ publishedDate: Date;
39
+ readingTime: number;
40
+ slug: string;
41
+ title: string;
42
+ };
43
+ twoAuthors: {
44
+ contributors: {
45
+ name: string;
46
+ image: null;
47
+ }[];
48
+ contentType: string;
49
+ banner: {
50
+ description: string;
51
+ height: number;
52
+ type: string;
53
+ url: string;
54
+ width: number;
55
+ aspect: string;
56
+ query: string;
57
+ };
58
+ publishedDate: Date;
59
+ readingTime: number;
60
+ slug: string;
61
+ title: string;
62
+ };
63
+ multipleAuthors: {
64
+ contributors: {
65
+ name: string;
66
+ image: null;
67
+ }[];
68
+ contentType: string;
69
+ banner: {
70
+ description: string;
71
+ height: number;
72
+ type: string;
73
+ url: string;
74
+ width: number;
75
+ aspect: string;
76
+ query: string;
77
+ };
78
+ publishedDate: Date;
79
+ readingTime: number;
80
+ slug: string;
81
+ title: string;
82
+ };
83
+ premium?: undefined;
84
+ free?: undefined;
85
+ partner?: undefined;
86
+ registered?: undefined;
87
+ upcoming?: undefined;
88
+ past?: undefined;
89
+ twoSpeakers?: undefined;
90
+ multipleSpeakers?: undefined;
91
+ list?: undefined;
92
+ noAnswers?: undefined;
93
+ oneAnswer?: undefined;
94
+ multipleAnswers?: undefined;
95
+ shortQuestion?: undefined;
96
+ longQuestion?: undefined;
97
+ people?: undefined;
98
+ learningHub?: undefined;
99
+ custom?: undefined;
100
+ } | {
101
+ premium: {
102
+ contentType: string;
103
+ banner: {
104
+ description: string;
105
+ height: number;
106
+ type: string;
107
+ url: string;
108
+ width: number;
109
+ aspect: string;
110
+ query: string;
111
+ };
112
+ slug: string;
113
+ title: string;
114
+ pill: string;
115
+ registered: boolean;
116
+ };
117
+ free: {
118
+ pill: string;
119
+ contentType: string;
120
+ banner: {
121
+ description: string;
122
+ height: number;
123
+ type: string;
124
+ url: string;
125
+ width: number;
126
+ aspect: string;
127
+ query: string;
128
+ };
129
+ slug: string;
130
+ title: string;
131
+ registered: boolean;
132
+ };
133
+ partner: {
134
+ partner: {
135
+ title: string;
136
+ };
137
+ contentType: string;
138
+ banner: {
139
+ description: string;
140
+ height: number;
141
+ type: string;
142
+ url: string;
143
+ width: number;
144
+ aspect: string;
145
+ query: string;
146
+ };
147
+ slug: string;
148
+ title: string;
149
+ pill: string;
150
+ registered: boolean;
151
+ };
152
+ registered: {
153
+ registered: boolean;
154
+ pill: string;
155
+ contentType: string;
156
+ banner: {
157
+ description: string;
158
+ height: number;
159
+ type: string;
160
+ url: string;
161
+ width: number;
162
+ aspect: string;
163
+ query: string;
164
+ };
165
+ slug: string;
166
+ title: string;
167
+ };
168
+ oneAuthor?: undefined;
169
+ twoAuthors?: undefined;
170
+ multipleAuthors?: undefined;
171
+ upcoming?: undefined;
172
+ past?: undefined;
173
+ twoSpeakers?: undefined;
174
+ multipleSpeakers?: undefined;
175
+ list?: undefined;
176
+ noAnswers?: undefined;
177
+ oneAnswer?: undefined;
178
+ multipleAnswers?: undefined;
179
+ shortQuestion?: undefined;
180
+ longQuestion?: undefined;
181
+ people?: undefined;
182
+ learningHub?: undefined;
183
+ custom?: undefined;
184
+ } | {
185
+ upcoming: {
186
+ contentType: string;
187
+ banner: {
188
+ description: string;
189
+ height: number;
190
+ type: string;
191
+ url: string;
192
+ width: number;
193
+ aspect: string;
194
+ query: string;
195
+ };
196
+ dateHasPassed: boolean;
197
+ title: string;
198
+ slug: string;
199
+ contributors: {
200
+ name: string;
201
+ image: null;
202
+ }[];
203
+ startDate: Date;
204
+ };
205
+ past: {
206
+ dateHasPassed: boolean;
207
+ startDate: Date;
208
+ contentType: string;
209
+ banner: {
210
+ description: string;
211
+ height: number;
212
+ type: string;
213
+ url: string;
214
+ width: number;
215
+ aspect: string;
216
+ query: string;
217
+ };
218
+ title: string;
219
+ slug: string;
220
+ contributors: {
221
+ name: string;
222
+ image: null;
223
+ }[];
224
+ };
225
+ twoSpeakers: {
226
+ contributors: {
227
+ name: string;
228
+ image: null;
229
+ }[];
230
+ contentType: string;
231
+ banner: {
232
+ description: string;
233
+ height: number;
234
+ type: string;
235
+ url: string;
236
+ width: number;
237
+ aspect: string;
238
+ query: string;
239
+ };
240
+ dateHasPassed: boolean;
241
+ title: string;
242
+ slug: string;
243
+ startDate: Date;
244
+ };
245
+ multipleSpeakers: {
246
+ contributors: {
247
+ name: string;
248
+ image: null;
249
+ }[];
250
+ contentType: string;
251
+ banner: {
252
+ description: string;
253
+ height: number;
254
+ type: string;
255
+ url: string;
256
+ width: number;
257
+ aspect: string;
258
+ query: string;
259
+ };
260
+ dateHasPassed: boolean;
261
+ title: string;
262
+ slug: string;
263
+ startDate: Date;
264
+ };
265
+ registered: {
266
+ registered: boolean;
267
+ contentType: string;
268
+ banner: {
269
+ description: string;
270
+ height: number;
271
+ type: string;
272
+ url: string;
273
+ width: number;
274
+ aspect: string;
275
+ query: string;
276
+ };
277
+ dateHasPassed: boolean;
278
+ title: string;
279
+ slug: string;
280
+ contributors: {
281
+ name: string;
282
+ image: null;
283
+ }[];
284
+ startDate: Date;
285
+ };
286
+ oneAuthor?: undefined;
287
+ twoAuthors?: undefined;
288
+ multipleAuthors?: undefined;
289
+ premium?: undefined;
290
+ free?: undefined;
291
+ partner?: undefined;
292
+ list?: undefined;
293
+ noAnswers?: undefined;
294
+ oneAnswer?: undefined;
295
+ multipleAnswers?: undefined;
296
+ shortQuestion?: undefined;
297
+ longQuestion?: undefined;
298
+ people?: undefined;
299
+ learningHub?: undefined;
300
+ custom?: undefined;
301
+ } | {
302
+ list: {
303
+ contentType: string;
304
+ banner: {
305
+ description: string;
306
+ height: number;
307
+ type: string;
308
+ url: string;
309
+ width: number;
310
+ aspect: string;
311
+ query: string;
312
+ };
313
+ slug: string;
314
+ title: string;
315
+ };
316
+ oneAuthor?: undefined;
317
+ twoAuthors?: undefined;
318
+ multipleAuthors?: undefined;
319
+ premium?: undefined;
320
+ free?: undefined;
321
+ partner?: undefined;
322
+ registered?: undefined;
323
+ upcoming?: undefined;
324
+ past?: undefined;
325
+ twoSpeakers?: undefined;
326
+ multipleSpeakers?: undefined;
327
+ noAnswers?: undefined;
328
+ oneAnswer?: undefined;
329
+ multipleAnswers?: undefined;
330
+ shortQuestion?: undefined;
331
+ longQuestion?: undefined;
332
+ people?: undefined;
333
+ learningHub?: undefined;
334
+ custom?: undefined;
335
+ } | {
336
+ noAnswers: {
337
+ contentType: string;
338
+ answers: number;
339
+ contributors: {
340
+ id: string;
341
+ name: string;
342
+ }[];
343
+ slug: string;
344
+ title: string;
345
+ createdAt: Date;
346
+ };
347
+ oneAnswer: {
348
+ answers: number;
349
+ contentType: string;
350
+ contributors: {
351
+ id: string;
352
+ name: string;
353
+ }[];
354
+ slug: string;
355
+ title: string;
356
+ createdAt: Date;
357
+ };
358
+ multipleAnswers: {
359
+ answers: number;
360
+ contentType: string;
361
+ contributors: {
362
+ id: string;
363
+ name: string;
364
+ }[];
365
+ slug: string;
366
+ title: string;
367
+ createdAt: Date;
368
+ };
369
+ shortQuestion: {
370
+ title: string;
371
+ answers: number;
372
+ contentType: string;
373
+ contributors: {
374
+ id: string;
375
+ name: string;
376
+ }[];
377
+ slug: string;
378
+ createdAt: Date;
379
+ };
380
+ longQuestion: {
381
+ title: string;
382
+ answers: number;
383
+ contentType: string;
384
+ contributors: {
385
+ id: string;
386
+ name: string;
387
+ }[];
388
+ slug: string;
389
+ createdAt: Date;
390
+ };
391
+ oneAuthor?: undefined;
392
+ twoAuthors?: undefined;
393
+ multipleAuthors?: undefined;
394
+ premium?: undefined;
395
+ free?: undefined;
396
+ partner?: undefined;
397
+ registered?: undefined;
398
+ upcoming?: undefined;
399
+ past?: undefined;
400
+ twoSpeakers?: undefined;
401
+ multipleSpeakers?: undefined;
402
+ list?: undefined;
403
+ people?: undefined;
404
+ learningHub?: undefined;
405
+ custom?: undefined;
406
+ } | {
407
+ people: {
408
+ contentType: string;
409
+ title: string;
410
+ text: string;
411
+ secondaryText: string;
412
+ profile: string;
413
+ slug: string;
414
+ };
415
+ oneAuthor?: undefined;
416
+ twoAuthors?: undefined;
417
+ multipleAuthors?: undefined;
418
+ premium?: undefined;
419
+ free?: undefined;
420
+ partner?: undefined;
421
+ registered?: undefined;
422
+ upcoming?: undefined;
423
+ past?: undefined;
424
+ twoSpeakers?: undefined;
425
+ multipleSpeakers?: undefined;
426
+ list?: undefined;
427
+ noAnswers?: undefined;
428
+ oneAnswer?: undefined;
429
+ multipleAnswers?: undefined;
430
+ shortQuestion?: undefined;
431
+ longQuestion?: undefined;
432
+ learningHub?: undefined;
433
+ custom?: undefined;
434
+ } | {
435
+ learningHub: {
436
+ contentType: string;
437
+ label: string;
438
+ title: string;
439
+ banner: {
440
+ url: string;
441
+ };
442
+ slug: string;
443
+ };
444
+ oneAuthor?: undefined;
445
+ twoAuthors?: undefined;
446
+ multipleAuthors?: undefined;
447
+ premium?: undefined;
448
+ free?: undefined;
449
+ partner?: undefined;
450
+ registered?: undefined;
451
+ upcoming?: undefined;
452
+ past?: undefined;
453
+ twoSpeakers?: undefined;
454
+ multipleSpeakers?: undefined;
455
+ list?: undefined;
456
+ noAnswers?: undefined;
457
+ oneAnswer?: undefined;
458
+ multipleAnswers?: undefined;
459
+ shortQuestion?: undefined;
460
+ longQuestion?: undefined;
461
+ people?: undefined;
462
+ custom?: undefined;
463
+ } | {
464
+ custom: {
465
+ contentType: string;
466
+ slug: null;
467
+ customIcon: string;
468
+ customLabel: string;
469
+ contributors: {
470
+ name: string;
471
+ image: {
472
+ thumbnail: string;
473
+ };
474
+ }[];
475
+ text: string;
476
+ secondaryText: string;
477
+ };
478
+ oneAuthor?: undefined;
479
+ twoAuthors?: undefined;
480
+ multipleAuthors?: undefined;
481
+ premium?: undefined;
482
+ free?: undefined;
483
+ partner?: undefined;
484
+ registered?: undefined;
485
+ upcoming?: undefined;
486
+ past?: undefined;
487
+ twoSpeakers?: undefined;
488
+ multipleSpeakers?: undefined;
489
+ list?: undefined;
490
+ noAnswers?: undefined;
491
+ oneAnswer?: undefined;
492
+ multipleAnswers?: undefined;
493
+ shortQuestion?: undefined;
494
+ longQuestion?: undefined;
495
+ people?: undefined;
496
+ learningHub?: undefined;
497
+ };
498
+ };
499
+ export declare const buildCardDataMock: (card: MockCardType) => Promise<unknown>;
500
+ export declare const buildCustomCardData: (card: CardType) => () => Promise<unknown>;
@@ -0,0 +1 @@
1
+ export declare const camelCaseToDashCase: (str: string) => string;
@@ -1,4 +1,4 @@
1
- type DateType = Date | string;
1
+ export type DateType = Date | string;
2
2
  export declare const getMonth: (date: DateType, locale?: string) => string;
3
3
  export declare const getNumericDay: (date: DateType, locale?: string) => string;
4
4
  export declare const getShortDate: (date: DateType, locale?: string) => string;
@@ -11,4 +11,3 @@ export declare const getShortDateHowLongAgo: (dateInPast: Date | string) => "" |
11
11
  path: string;
12
12
  number: number;
13
13
  };
14
- export {};
@@ -1,5 +1,6 @@
1
1
  export { default as basicReducer } from './basic-reducer';
2
2
  export * from './breakpoints';
3
+ export * from './cases';
3
4
  export * from './dates';
4
5
  export { default as delay } from './delay';
5
6
  export * from './intl';
package/helpers/intl.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export declare const checkIntlPathExists: (path: string) => boolean;
1
2
  export declare const getIntlPath: (callback: (args1: {
2
3
  id: string;
3
4
  }, args2?: object) => string, path: string, key: string, value: string, args?: object) => string;
package/hooks/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default as useCurrentPath } from './use-current-path';
2
2
  export { default as useEffectAfterMount } from './use-effect-after-mount';
3
- export { default as useScreenWidth } from './use-screen-width';
3
+ export { default as useElementWidth } from './use-element-width';
4
4
  export { default as useScrollListener } from './use-scroll-listener';
5
5
  export { default as useScrollToHash } from './use-scroll-to-hash';
@@ -1,2 +1,2 @@
1
- declare function _default(shouldGetWidth?: boolean, shouldAddClass?: boolean): number | undefined;
1
+ declare function _default(shouldGetWidth?: boolean, shouldAddClass?: boolean, element?: string): number | undefined;
2
2
  export default _default;