@apolitical/component-library 3.3.0 → 3.3.1-ac.5
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/accessibility/visually-hidden/visually-hidden.d.ts +1 -3
- package/banners/index.d.ts +0 -1
- package/{text/content-type-label/content-type-label.helpers.d.ts → cards/card/card.helpers.d.ts} +1 -1
- package/cards/cards.types.d.ts +11 -5
- package/cards/mocks/card.d.ts +28 -4
- package/cards/mocks/mocks.helpers.d.ts +49 -16
- package/constants/index.d.ts +0 -1
- package/context/flags/flags.provider.d.ts +1 -1
- package/context/intl/intl.provider.d.ts +1 -13
- package/general/index.d.ts +0 -2
- package/general/link/link.d.ts +1 -3
- package/helpers/cases.d.ts +0 -2
- package/helpers/intl.d.ts +1 -379
- package/index.d.ts +1 -3
- package/index.js +18 -18
- package/index.mjs +5860 -6392
- package/layout/page-layout/components/header/header.data.d.ts +14 -6
- package/loaders/progress-bar/progress-bar.d.ts +1 -11
- package/modals/invite-modal/invite-modal.d.ts +2 -2
- package/navigation/language-switcher/language-switcher.d.ts +8 -2
- package/navigation/language-switcher/language-switcher.helpers.d.ts +2 -6
- package/navigation/load-more/load-more.d.ts +1 -2
- package/package.json +1 -1
- package/sections/full-width-section/full-width-section.d.ts +0 -2
- package/sections/logo-section/logo-section.d.ts +1 -11
- package/style.css +1 -1
- package/styles/base/_layout.scss +2 -12
- package/styles/base/_lists.scss +1 -29
- package/styles/base/_text.scss +1 -1
- package/styles/base/_titles.scss +0 -14
- package/styles/base/buttons/_button-wrapper.scss +0 -2
- package/styles/base/buttons/_icons.scss +0 -9
- package/styles/variables/colors/theme/_banners.scss +0 -8
- package/styles/variables/colors/theme/_base.scss +0 -2
- package/styles/variables/colors/theme/_general.scss +0 -2
- package/styles/variables/colors/theme/_index.scss +4 -5
- package/styles/variables/colors/theme/_layout.scss +0 -1
- package/styles/variables/colors/theme/_loaders.scss +0 -4
- package/styles/variables/colors/theme/_text.scss +0 -12
- package/styles/variables/sizes/_common.scss +0 -3
- package/text/collapsible-section/collapsible-section.d.ts +4 -4
- package/text/highlighted-text-box/highlighted-text-box.d.ts +2 -9
- package/text/index.d.ts +0 -2
- package/text/markdown-text/components/div/div.d.ts +1 -1
- package/text/markdown-text/markdown-text.d.ts +1 -5
- package/text/pill/pill.d.ts +4 -2
- package/banners/custom-content-banner/custom-content-banner.d.ts +0 -13
- package/banners/custom-content-banner/index.d.ts +0 -1
- package/constants/courses.d.ts +0 -5
- package/courses/course-progression/course-progression.d.ts +0 -7
- package/courses/course-progression/course-progression.types.d.ts +0 -28
- package/courses/course-progression/index.d.ts +0 -1
- package/courses/course-structure/course-structure.d.ts +0 -3
- package/courses/course-structure/course-structure.mock.d.ts +0 -122
- package/courses/course-structure/course-structure.types.d.ts +0 -55
- package/courses/course-structure/index.d.ts +0 -1
- package/courses/index.d.ts +0 -5
- package/courses/lesson-name/index.d.ts +0 -1
- package/courses/lesson-name/lesson-name.d.ts +0 -19
- package/courses/lesson-type/index.d.ts +0 -1
- package/courses/lesson-type/lesson-type.d.ts +0 -10
- package/courses/mark-complete-button/index.d.ts +0 -1
- package/courses/mark-complete-button/mark-complete-button.d.ts +0 -7
- package/general/table-of-contents/index.d.ts +0 -1
- package/general/table-of-contents/table-of-contents.d.ts +0 -16
- package/general/time-to-complete/index.d.ts +0 -1
- package/general/time-to-complete/time-to-complete.d.ts +0 -14
- package/styles/variables/colors/theme/_courses.scss +0 -22
- package/text/collapsible-section/accordian.d.ts +0 -16
- package/text/content-type-label/content-type-label.d.ts +0 -14
- package/text/content-type-label/content-type-label.types.d.ts +0 -1
- package/text/content-type-label/index.d.ts +0 -2
- package/text/icon-bulleted-list/icon-bulleted-list.d.ts +0 -31
- package/text/icon-bulleted-list/index.d.ts +0 -1
|
@@ -10,10 +10,8 @@ interface Props {
|
|
|
10
10
|
href?: string;
|
|
11
11
|
/** `for`, for labels */
|
|
12
12
|
htmlFor?: string;
|
|
13
|
-
/** Additional classes */
|
|
14
|
-
className?: string;
|
|
15
13
|
}
|
|
16
|
-
declare const _default: React.MemoExoticComponent<({ element, showOnFocus, children,
|
|
14
|
+
declare const _default: React.MemoExoticComponent<({ element, showOnFocus, children, ...props }: Props) => React.DetailedReactHTMLElement<{
|
|
17
15
|
className: string;
|
|
18
16
|
children: React.ReactNode | JSX.Element;
|
|
19
17
|
/** An `href`, for links */
|
package/banners/index.d.ts
CHANGED
package/cards/cards.types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResponsiveImageType } from '../general';
|
|
2
|
-
import { CustomIconType } from '../text';
|
|
3
2
|
import { MemberProps } from '../user';
|
|
4
|
-
export type CardContentType = 'customCard' | 'event' | 'learningHub' | 'listPage' | 'microcourse' | 'people' | 'qaQuestion' | 'solutionArticle';
|
|
3
|
+
export type CardContentType = 'customCard' | 'event' | 'learningHub' | 'listPage' | 'microcourse' | 'people' | 'qaQuestion' | 'solutionArticle' | 'communityPage';
|
|
4
|
+
export type CustomIconType = 'calendar' | 'cube' | 'document' | 'download' | 'globe' | 'graduationCap' | 'link' | 'person' | 'star' | 'speech';
|
|
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;
|
|
@@ -25,7 +25,9 @@ export interface CardType {
|
|
|
25
25
|
/** Details of contributors, such as speakers or authors */
|
|
26
26
|
contributors?: MemberProps[];
|
|
27
27
|
/** Details of partners - this is similar to `contributors`, but won't show profile pictures */
|
|
28
|
-
partner?:
|
|
28
|
+
partner?: {
|
|
29
|
+
title: string;
|
|
30
|
+
};
|
|
29
31
|
/** The title of the card */
|
|
30
32
|
title?: string;
|
|
31
33
|
/** The primary text */
|
|
@@ -44,8 +46,6 @@ export interface CardType {
|
|
|
44
46
|
customIcon?: CustomIconType;
|
|
45
47
|
/** The label to use */
|
|
46
48
|
customLabel?: string;
|
|
47
|
-
/** The link text to use */
|
|
48
|
-
customLinkText?: string;
|
|
49
49
|
/** Event cards */
|
|
50
50
|
/** The date the event starts */
|
|
51
51
|
startDate?: 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) => {
|
|
@@ -95,9 +96,9 @@ export declare const cardMapper: {
|
|
|
95
96
|
shortQuestion?: undefined;
|
|
96
97
|
longQuestion?: undefined;
|
|
97
98
|
people?: undefined;
|
|
98
|
-
customLink?: undefined;
|
|
99
99
|
learningHub?: undefined;
|
|
100
100
|
custom?: undefined;
|
|
101
|
+
community?: undefined;
|
|
101
102
|
} | {
|
|
102
103
|
premium: {
|
|
103
104
|
contentType: string;
|
|
@@ -180,9 +181,9 @@ export declare const cardMapper: {
|
|
|
180
181
|
shortQuestion?: undefined;
|
|
181
182
|
longQuestion?: undefined;
|
|
182
183
|
people?: undefined;
|
|
183
|
-
customLink?: undefined;
|
|
184
184
|
learningHub?: undefined;
|
|
185
185
|
custom?: undefined;
|
|
186
|
+
community?: undefined;
|
|
186
187
|
} | {
|
|
187
188
|
upcoming: {
|
|
188
189
|
contentType: string;
|
|
@@ -298,9 +299,9 @@ export declare const cardMapper: {
|
|
|
298
299
|
shortQuestion?: undefined;
|
|
299
300
|
longQuestion?: undefined;
|
|
300
301
|
people?: undefined;
|
|
301
|
-
customLink?: undefined;
|
|
302
302
|
learningHub?: undefined;
|
|
303
303
|
custom?: undefined;
|
|
304
|
+
community?: undefined;
|
|
304
305
|
} | {
|
|
305
306
|
list: {
|
|
306
307
|
contentType: string;
|
|
@@ -333,9 +334,9 @@ export declare const cardMapper: {
|
|
|
333
334
|
shortQuestion?: undefined;
|
|
334
335
|
longQuestion?: undefined;
|
|
335
336
|
people?: undefined;
|
|
336
|
-
customLink?: undefined;
|
|
337
337
|
learningHub?: undefined;
|
|
338
338
|
custom?: undefined;
|
|
339
|
+
community?: undefined;
|
|
339
340
|
} | {
|
|
340
341
|
noAnswers: {
|
|
341
342
|
contentType: string;
|
|
@@ -405,9 +406,9 @@ export declare const cardMapper: {
|
|
|
405
406
|
multipleSpeakers?: undefined;
|
|
406
407
|
list?: undefined;
|
|
407
408
|
people?: undefined;
|
|
408
|
-
customLink?: undefined;
|
|
409
409
|
learningHub?: undefined;
|
|
410
410
|
custom?: undefined;
|
|
411
|
+
community?: undefined;
|
|
411
412
|
} | {
|
|
412
413
|
people: {
|
|
413
414
|
contentType: string;
|
|
@@ -417,15 +418,6 @@ export declare const cardMapper: {
|
|
|
417
418
|
profile: string;
|
|
418
419
|
slug: string;
|
|
419
420
|
};
|
|
420
|
-
customLink: {
|
|
421
|
-
slug: string;
|
|
422
|
-
customLinkText: string;
|
|
423
|
-
contentType: string;
|
|
424
|
-
title: string;
|
|
425
|
-
text: string;
|
|
426
|
-
secondaryText: string;
|
|
427
|
-
profile: string;
|
|
428
|
-
};
|
|
429
421
|
oneAuthor?: undefined;
|
|
430
422
|
twoAuthors?: undefined;
|
|
431
423
|
multipleAuthors?: undefined;
|
|
@@ -445,6 +437,7 @@ export declare const cardMapper: {
|
|
|
445
437
|
longQuestion?: undefined;
|
|
446
438
|
learningHub?: undefined;
|
|
447
439
|
custom?: undefined;
|
|
440
|
+
community?: undefined;
|
|
448
441
|
} | {
|
|
449
442
|
learningHub: {
|
|
450
443
|
contentType: string;
|
|
@@ -473,8 +466,8 @@ export declare const cardMapper: {
|
|
|
473
466
|
shortQuestion?: undefined;
|
|
474
467
|
longQuestion?: undefined;
|
|
475
468
|
people?: undefined;
|
|
476
|
-
customLink?: undefined;
|
|
477
469
|
custom?: undefined;
|
|
470
|
+
community?: undefined;
|
|
478
471
|
} | {
|
|
479
472
|
custom: {
|
|
480
473
|
contentType: string;
|
|
@@ -508,9 +501,49 @@ export declare const cardMapper: {
|
|
|
508
501
|
shortQuestion?: undefined;
|
|
509
502
|
longQuestion?: undefined;
|
|
510
503
|
people?: undefined;
|
|
511
|
-
customLink?: undefined;
|
|
512
504
|
learningHub?: undefined;
|
|
505
|
+
community?: undefined;
|
|
506
|
+
} | {
|
|
507
|
+
community: {
|
|
508
|
+
contentType: string;
|
|
509
|
+
sys: {
|
|
510
|
+
id: string;
|
|
511
|
+
};
|
|
512
|
+
title: string;
|
|
513
|
+
slug: string;
|
|
514
|
+
private: boolean;
|
|
515
|
+
visible: boolean;
|
|
516
|
+
bannerSection: {
|
|
517
|
+
eyebrow: string;
|
|
518
|
+
title: string;
|
|
519
|
+
text: string;
|
|
520
|
+
ctaLink: null;
|
|
521
|
+
ctaText: null;
|
|
522
|
+
image: null;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
oneAuthor?: undefined;
|
|
526
|
+
twoAuthors?: undefined;
|
|
527
|
+
multipleAuthors?: undefined;
|
|
528
|
+
premium?: undefined;
|
|
529
|
+
free?: undefined;
|
|
530
|
+
partner?: undefined;
|
|
531
|
+
registered?: undefined;
|
|
532
|
+
upcoming?: undefined;
|
|
533
|
+
past?: undefined;
|
|
534
|
+
twoSpeakers?: undefined;
|
|
535
|
+
multipleSpeakers?: undefined;
|
|
536
|
+
list?: undefined;
|
|
537
|
+
noAnswers?: undefined;
|
|
538
|
+
oneAnswer?: undefined;
|
|
539
|
+
multipleAnswers?: undefined;
|
|
540
|
+
shortQuestion?: undefined;
|
|
541
|
+
longQuestion?: undefined;
|
|
542
|
+
people?: undefined;
|
|
543
|
+
learningHub?: undefined;
|
|
544
|
+
custom?: undefined;
|
|
513
545
|
};
|
|
514
546
|
};
|
|
515
547
|
export declare const buildCardDataMock: (card: MockCardType) => Promise<unknown>;
|
|
516
548
|
export declare const buildCustomCardData: (card: CardType) => () => Promise<unknown>;
|
|
549
|
+
export declare const buildCommunityCardData: (card: CardType, memberType: string) => () => Promise<unknown>;
|
package/constants/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ interface Props {
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
user: IUserContext;
|
|
6
6
|
}
|
|
7
|
-
export declare const FlagsProvider: ({ children, user }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare const FlagsProvider: ({ children, user }: Props) => string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
8
8
|
export {};
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export type LanguageType = keyof typeof supportedLanguages;
|
|
3
2
|
export interface IIntlContext {
|
|
4
|
-
locale?:
|
|
3
|
+
locale?: 'en' | 'fr';
|
|
5
4
|
messages?: Record<string, string>;
|
|
6
5
|
}
|
|
7
6
|
interface Props extends IIntlContext {
|
|
8
7
|
children: React.ReactNode;
|
|
9
8
|
}
|
|
10
|
-
interface ILanguageContext {
|
|
11
|
-
language?: LanguageType;
|
|
12
|
-
updateLanguage?: (lang: string) => void;
|
|
13
|
-
}
|
|
14
9
|
export declare const IntlProvider: ({ children, locale, messages }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare const LanguageContext: React.Context<ILanguageContext>;
|
|
16
|
-
export declare const supportedLanguages: {
|
|
17
|
-
en: string;
|
|
18
|
-
es: string;
|
|
19
|
-
fr: string;
|
|
20
|
-
pt: string;
|
|
21
|
-
};
|
|
22
10
|
export {};
|
package/general/index.d.ts
CHANGED
package/general/link/link.d.ts
CHANGED
|
@@ -22,8 +22,6 @@ interface Props {
|
|
|
22
22
|
ariaLabel?: string;
|
|
23
23
|
/** Test id for link */
|
|
24
24
|
'data-testid'?: string;
|
|
25
|
-
/** Data attributes for the link */
|
|
26
|
-
'data-before'?: string;
|
|
27
25
|
}
|
|
28
|
-
declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: Props) =>
|
|
26
|
+
declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: Props) => string | JSX.Element | JSX.Element[];
|
|
29
27
|
export default Link;
|
package/helpers/cases.d.ts
CHANGED