@apolitical/component-library 3.3.6 → 3.4.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.
- package/cards/cards.types.d.ts +7 -1
- package/cards/mocks/card.d.ts +28 -4
- package/cards/mocks/mocks.helpers.d.ts +50 -0
- package/form/components/form/form.d.ts +1 -1
- package/form/types/signup-form/signup-form.d.ts +9 -9
- package/form/types/signup-form/signup-form.helpers.d.ts +1 -1
- package/form/types/signup-form/signup-form.helpers.get-fields.d.ts +7 -2
- package/helpers/intl.d.ts +13 -0
- package/index.js +18 -18
- package/index.mjs +1427 -1363
- package/layout/page-layout/components/header/header.data.d.ts +14 -6
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/base/_layout.scss +0 -5
- package/styles/base/form/_form.scss +0 -4
- package/styles/variables/sizes/_common.scss +3 -2
- package/text/pill/pill.d.ts +3 -1
package/cards/cards.types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponsiveImageType } from '../general';
|
|
2
2
|
import { CustomIconType } from '../text';
|
|
3
3
|
import { MemberProps } from '../user';
|
|
4
|
-
export type CardContentType = 'customCard' | 'event' | 'learningHub' | 'listPage' | 'microcourse' | 'people' | 'qaQuestion' | 'solutionArticle';
|
|
4
|
+
export type CardContentType = 'customCard' | 'event' | 'learningHub' | 'listPage' | 'microcourse' | 'people' | 'qaQuestion' | 'solutionArticle' | 'communityPage';
|
|
5
5
|
export interface CardCTAType {
|
|
6
6
|
/** The text to show on the CTA button - different content types have different fallbacks */
|
|
7
7
|
text?: string;
|
|
@@ -62,6 +62,12 @@ export interface CardType {
|
|
|
62
62
|
profile?: string;
|
|
63
63
|
/** The number of answers */
|
|
64
64
|
answers?: number;
|
|
65
|
+
/** Community cards */
|
|
66
|
+
members?: {
|
|
67
|
+
memberType: string;
|
|
68
|
+
isMember: boolean;
|
|
69
|
+
count: number;
|
|
70
|
+
};
|
|
65
71
|
}
|
|
66
72
|
export interface MockCardType extends CardType {
|
|
67
73
|
cardType?: string;
|
package/cards/mocks/card.d.ts
CHANGED
|
@@ -214,11 +214,35 @@ export namespace learningHub {
|
|
|
214
214
|
let slug_6: string;
|
|
215
215
|
export { slug_6 as slug };
|
|
216
216
|
}
|
|
217
|
-
export namespace
|
|
217
|
+
export namespace community {
|
|
218
218
|
let contentType_7: string;
|
|
219
219
|
export { contentType_7 as contentType };
|
|
220
|
-
|
|
220
|
+
export namespace sys {
|
|
221
|
+
let id: string;
|
|
222
|
+
}
|
|
223
|
+
let title_10: string;
|
|
224
|
+
export { title_10 as title };
|
|
225
|
+
let slug_7: string;
|
|
221
226
|
export { slug_7 as slug };
|
|
227
|
+
let _private: boolean;
|
|
228
|
+
export { _private as private };
|
|
229
|
+
export let visible: boolean;
|
|
230
|
+
export namespace bannerSection {
|
|
231
|
+
export let eyebrow: string;
|
|
232
|
+
let title_11: string;
|
|
233
|
+
export { title_11 as title };
|
|
234
|
+
let text_1: string;
|
|
235
|
+
export { text_1 as text };
|
|
236
|
+
export let ctaLink: null;
|
|
237
|
+
export let ctaText: null;
|
|
238
|
+
export let image: null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
export namespace custom {
|
|
242
|
+
let contentType_8: string;
|
|
243
|
+
export { contentType_8 as contentType };
|
|
244
|
+
let slug_8: null;
|
|
245
|
+
export { slug_8 as slug };
|
|
222
246
|
export let customIcon: string;
|
|
223
247
|
export let customLabel: string;
|
|
224
248
|
let contributors_7: {
|
|
@@ -228,8 +252,8 @@ export namespace custom {
|
|
|
228
252
|
};
|
|
229
253
|
}[];
|
|
230
254
|
export { contributors_7 as contributors };
|
|
231
|
-
let
|
|
232
|
-
export {
|
|
255
|
+
let text_2: string;
|
|
256
|
+
export { text_2 as text };
|
|
233
257
|
let secondaryText_1: string;
|
|
234
258
|
export { secondaryText_1 as secondaryText };
|
|
235
259
|
}
|
|
@@ -7,6 +7,7 @@ export declare const CONTENT_TYPES: {
|
|
|
7
7
|
QUESTION: string;
|
|
8
8
|
PEOPLE: string;
|
|
9
9
|
LEARNING_HUB: string;
|
|
10
|
+
COMMUNITY: string;
|
|
10
11
|
CUSTOM: string;
|
|
11
12
|
};
|
|
12
13
|
export declare const buildCard: (contentType: string, cardType?: string | null) => {
|
|
@@ -98,6 +99,7 @@ export declare const cardMapper: {
|
|
|
98
99
|
customLink?: undefined;
|
|
99
100
|
learningHub?: undefined;
|
|
100
101
|
custom?: undefined;
|
|
102
|
+
community?: undefined;
|
|
101
103
|
} | {
|
|
102
104
|
premium: {
|
|
103
105
|
contentType: string;
|
|
@@ -183,6 +185,7 @@ export declare const cardMapper: {
|
|
|
183
185
|
customLink?: undefined;
|
|
184
186
|
learningHub?: undefined;
|
|
185
187
|
custom?: undefined;
|
|
188
|
+
community?: undefined;
|
|
186
189
|
} | {
|
|
187
190
|
upcoming: {
|
|
188
191
|
contentType: string;
|
|
@@ -301,6 +304,7 @@ export declare const cardMapper: {
|
|
|
301
304
|
customLink?: undefined;
|
|
302
305
|
learningHub?: undefined;
|
|
303
306
|
custom?: undefined;
|
|
307
|
+
community?: undefined;
|
|
304
308
|
} | {
|
|
305
309
|
list: {
|
|
306
310
|
contentType: string;
|
|
@@ -336,6 +340,7 @@ export declare const cardMapper: {
|
|
|
336
340
|
customLink?: undefined;
|
|
337
341
|
learningHub?: undefined;
|
|
338
342
|
custom?: undefined;
|
|
343
|
+
community?: undefined;
|
|
339
344
|
} | {
|
|
340
345
|
noAnswers: {
|
|
341
346
|
contentType: string;
|
|
@@ -408,6 +413,7 @@ export declare const cardMapper: {
|
|
|
408
413
|
customLink?: undefined;
|
|
409
414
|
learningHub?: undefined;
|
|
410
415
|
custom?: undefined;
|
|
416
|
+
community?: undefined;
|
|
411
417
|
} | {
|
|
412
418
|
people: {
|
|
413
419
|
contentType: string;
|
|
@@ -445,6 +451,7 @@ export declare const cardMapper: {
|
|
|
445
451
|
longQuestion?: undefined;
|
|
446
452
|
learningHub?: undefined;
|
|
447
453
|
custom?: undefined;
|
|
454
|
+
community?: undefined;
|
|
448
455
|
} | {
|
|
449
456
|
learningHub: {
|
|
450
457
|
contentType: string;
|
|
@@ -475,6 +482,7 @@ export declare const cardMapper: {
|
|
|
475
482
|
people?: undefined;
|
|
476
483
|
customLink?: undefined;
|
|
477
484
|
custom?: undefined;
|
|
485
|
+
community?: undefined;
|
|
478
486
|
} | {
|
|
479
487
|
custom: {
|
|
480
488
|
contentType: string;
|
|
@@ -510,7 +518,49 @@ export declare const cardMapper: {
|
|
|
510
518
|
people?: undefined;
|
|
511
519
|
customLink?: undefined;
|
|
512
520
|
learningHub?: undefined;
|
|
521
|
+
community?: undefined;
|
|
522
|
+
} | {
|
|
523
|
+
community: {
|
|
524
|
+
contentType: string;
|
|
525
|
+
sys: {
|
|
526
|
+
id: string;
|
|
527
|
+
};
|
|
528
|
+
title: string;
|
|
529
|
+
slug: string;
|
|
530
|
+
private: boolean;
|
|
531
|
+
visible: boolean;
|
|
532
|
+
bannerSection: {
|
|
533
|
+
eyebrow: string;
|
|
534
|
+
title: string;
|
|
535
|
+
text: string;
|
|
536
|
+
ctaLink: null;
|
|
537
|
+
ctaText: null;
|
|
538
|
+
image: null;
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
oneAuthor?: undefined;
|
|
542
|
+
twoAuthors?: undefined;
|
|
543
|
+
multipleAuthors?: undefined;
|
|
544
|
+
premium?: undefined;
|
|
545
|
+
free?: undefined;
|
|
546
|
+
partner?: undefined;
|
|
547
|
+
registered?: undefined;
|
|
548
|
+
upcoming?: undefined;
|
|
549
|
+
past?: undefined;
|
|
550
|
+
twoSpeakers?: undefined;
|
|
551
|
+
multipleSpeakers?: undefined;
|
|
552
|
+
list?: undefined;
|
|
553
|
+
noAnswers?: undefined;
|
|
554
|
+
oneAnswer?: undefined;
|
|
555
|
+
multipleAnswers?: undefined;
|
|
556
|
+
shortQuestion?: undefined;
|
|
557
|
+
longQuestion?: undefined;
|
|
558
|
+
people?: undefined;
|
|
559
|
+
customLink?: undefined;
|
|
560
|
+
learningHub?: undefined;
|
|
561
|
+
custom?: undefined;
|
|
513
562
|
};
|
|
514
563
|
};
|
|
515
564
|
export declare const buildCardDataMock: (card: MockCardType) => Promise<unknown>;
|
|
516
565
|
export declare const buildCustomCardData: (card: CardType) => () => Promise<unknown>;
|
|
566
|
+
export declare const buildCommunityCardData: (card: CardType, memberType: string) => () => Promise<unknown>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IFormProps } from './form.types';
|
|
2
|
-
declare const Form: ({ fields, className, id: formId, formRef: ref, intlPath, button, secondaryActionButton, meta, gtm, functions: { onSuccess, onCancel, onCatch, onFailure, }, ...props }: IFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
declare const Form: ({ fields, className, id: formId, formRef: ref, intlPath, button, secondaryActionButton, meta: { shouldShowCancelButton, shouldReset, showRequiredLabels, showSuccessMessage, }, gtm, functions: { onSuccess, onCancel, onCatch, onFailure, }, ...props }: IFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export default Form;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export interface IShouldShowProps {
|
|
2
|
-
title?: boolean;
|
|
3
|
-
expectation?: boolean;
|
|
4
|
-
url?: boolean;
|
|
5
|
-
logInButton?: boolean;
|
|
6
|
-
successMessage?: boolean;
|
|
7
|
-
}
|
|
8
1
|
interface ISignupForm {
|
|
9
2
|
className?: string;
|
|
10
3
|
functions: {
|
|
@@ -15,11 +8,18 @@ interface ISignupForm {
|
|
|
15
8
|
/** Callback function to resend verification code (used when user already signed up but not verified) */
|
|
16
9
|
resendVerificationCode: () => void;
|
|
17
10
|
};
|
|
18
|
-
shouldShow:
|
|
11
|
+
shouldShow: {
|
|
12
|
+
title?: boolean;
|
|
13
|
+
expectation: boolean;
|
|
14
|
+
url?: boolean;
|
|
15
|
+
logInButton: boolean;
|
|
16
|
+
successMessage?: boolean;
|
|
17
|
+
};
|
|
19
18
|
dataToSubmit: {
|
|
20
19
|
[key: string]: string;
|
|
21
20
|
};
|
|
22
21
|
submitButton: string;
|
|
22
|
+
showSuccessMessage?: boolean;
|
|
23
23
|
}
|
|
24
|
-
declare const SignupForm: ({ className, functions, shouldShow
|
|
24
|
+
declare const SignupForm: ({ className, functions, shouldShow, submitButton, dataToSubmit, ...props }: ISignupForm) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export default SignupForm;
|
|
@@ -7,7 +7,7 @@ interface IBlurEmailField {
|
|
|
7
7
|
}
|
|
8
8
|
declare const blurEmailField: ({ ref, validateEmail, dispatch }: IBlurEmailField) => Promise<void>;
|
|
9
9
|
declare const transformFormData: (formData: FormData) => {
|
|
10
|
-
name:
|
|
10
|
+
name: FormDataEntryValue;
|
|
11
11
|
email: string;
|
|
12
12
|
jobTitle: FormDataEntryValue;
|
|
13
13
|
organization: FormDataEntryValue;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IField } from '../../../form/components/form/form.types';
|
|
3
|
-
import { IShouldShowProps } from './signup-form';
|
|
4
3
|
interface Props {
|
|
5
|
-
shouldShow:
|
|
4
|
+
shouldShow: {
|
|
5
|
+
title?: boolean;
|
|
6
|
+
expectation: boolean;
|
|
7
|
+
url?: boolean;
|
|
8
|
+
logInButton: boolean;
|
|
9
|
+
successMessage?: boolean;
|
|
10
|
+
};
|
|
6
11
|
functions: {
|
|
7
12
|
validateEmail: (arg: any) => Promise<any>;
|
|
8
13
|
createAccount: (arg: any) => Promise<any>;
|
package/helpers/intl.d.ts
CHANGED
|
@@ -6,6 +6,13 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
6
6
|
dates_weeks: string;
|
|
7
7
|
dates_years: string;
|
|
8
8
|
card_carousel_viewAll: string;
|
|
9
|
+
card_label_communityPage: string;
|
|
10
|
+
card_label_event: string;
|
|
11
|
+
card_label_learningHub: string;
|
|
12
|
+
card_label_listPage: string;
|
|
13
|
+
card_label_microcourse: string;
|
|
14
|
+
card_label_qaQuestion: string;
|
|
15
|
+
card_label_solutionArticle: string;
|
|
9
16
|
card_bootcamp: string;
|
|
10
17
|
card_ended: string;
|
|
11
18
|
card_registered: string;
|
|
@@ -16,6 +23,9 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
16
23
|
card_time_ago: string;
|
|
17
24
|
card_time_read: string;
|
|
18
25
|
card_watch: string;
|
|
26
|
+
card_member_type_owner: string;
|
|
27
|
+
card_member_type_member: string;
|
|
28
|
+
card_member_count: string;
|
|
19
29
|
card_cta_people: string;
|
|
20
30
|
card_cta_event: string;
|
|
21
31
|
card_cta_microcourse: string;
|
|
@@ -254,6 +264,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
254
264
|
footer_platform_courses: string;
|
|
255
265
|
footer_platform_qanda: string;
|
|
256
266
|
footer_platform_articles: string;
|
|
267
|
+
footer_platform_communities: string;
|
|
257
268
|
footer_community: string;
|
|
258
269
|
footer_community_support: string;
|
|
259
270
|
footer_community_post: string;
|
|
@@ -298,6 +309,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
298
309
|
header_topics_explore_courses: string;
|
|
299
310
|
'header_topics_explore_q-and-a': string;
|
|
300
311
|
header_topics_explore_articles: string;
|
|
312
|
+
header_topics_explore_communities: string;
|
|
301
313
|
header_topics_topics: string;
|
|
302
314
|
header_topics_topics_climate: string;
|
|
303
315
|
'header_topics_topics_cities-and-local-government': string;
|
|
@@ -349,6 +361,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
349
361
|
navigationMenu_links_microcourses: string;
|
|
350
362
|
'navigationMenu_links_q-and-a': string;
|
|
351
363
|
navigationMenu_links_articles: string;
|
|
364
|
+
navigationMenu_links_communities: string;
|
|
352
365
|
navigationMenu_profile: string;
|
|
353
366
|
shareLinks_label: string;
|
|
354
367
|
shareLinks_link_linkedin: string;
|