@apolitical/component-library 3.3.1-ac.5 → 3.3.1-beta.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 (75) hide show
  1. package/accessibility/visually-hidden/visually-hidden.d.ts +3 -1
  2. package/banners/custom-content-banner/custom-content-banner.d.ts +13 -0
  3. package/banners/custom-content-banner/index.d.ts +1 -0
  4. package/banners/index.d.ts +1 -0
  5. package/cards/cards.types.d.ts +5 -11
  6. package/cards/mocks/card.d.ts +4 -28
  7. package/cards/mocks/mocks.helpers.d.ts +16 -49
  8. package/constants/courses.d.ts +5 -0
  9. package/constants/index.d.ts +1 -0
  10. package/context/flags/flags.provider.d.ts +1 -1
  11. package/context/intl/intl.provider.d.ts +13 -1
  12. package/courses/course-progression/course-progression.d.ts +7 -0
  13. package/courses/course-progression/course-progression.types.d.ts +28 -0
  14. package/courses/course-progression/index.d.ts +1 -0
  15. package/courses/course-structure/course-structure.d.ts +3 -0
  16. package/courses/course-structure/course-structure.mock.d.ts +122 -0
  17. package/courses/course-structure/course-structure.types.d.ts +55 -0
  18. package/courses/course-structure/index.d.ts +1 -0
  19. package/courses/index.d.ts +5 -0
  20. package/courses/lesson-name/index.d.ts +1 -0
  21. package/courses/lesson-name/lesson-name.d.ts +19 -0
  22. package/courses/lesson-type/index.d.ts +1 -0
  23. package/courses/lesson-type/lesson-type.d.ts +10 -0
  24. package/courses/mark-complete-button/index.d.ts +1 -0
  25. package/courses/mark-complete-button/mark-complete-button.d.ts +7 -0
  26. package/general/index.d.ts +2 -0
  27. package/general/link/link.d.ts +3 -1
  28. package/general/table-of-contents/index.d.ts +1 -0
  29. package/general/table-of-contents/table-of-contents.d.ts +16 -0
  30. package/general/time-to-complete/index.d.ts +1 -0
  31. package/general/time-to-complete/time-to-complete.d.ts +14 -0
  32. package/helpers/cases.d.ts +2 -0
  33. package/helpers/intl.d.ts +381 -1
  34. package/index.d.ts +3 -1
  35. package/index.js +18 -18
  36. package/index.mjs +6404 -5868
  37. package/layout/page-layout/components/header/header.data.d.ts +6 -14
  38. package/loaders/progress-bar/progress-bar.d.ts +11 -1
  39. package/modals/invite-modal/invite-modal.d.ts +2 -2
  40. package/navigation/language-switcher/language-switcher.d.ts +2 -8
  41. package/navigation/language-switcher/language-switcher.helpers.d.ts +6 -2
  42. package/navigation/load-more/load-more.d.ts +2 -1
  43. package/package.json +1 -1
  44. package/sections/full-width-section/full-width-section.d.ts +2 -0
  45. package/sections/logo-section/logo-section.d.ts +11 -1
  46. package/style.css +1 -1
  47. package/styles/base/_layout.scss +12 -2
  48. package/styles/base/_lists.scss +29 -1
  49. package/styles/base/_text.scss +1 -1
  50. package/styles/base/_titles.scss +14 -0
  51. package/styles/base/buttons/_button-wrapper.scss +2 -0
  52. package/styles/base/buttons/_icons.scss +9 -0
  53. package/styles/variables/colors/theme/_banners.scss +8 -0
  54. package/styles/variables/colors/theme/_base.scss +2 -0
  55. package/styles/variables/colors/theme/_courses.scss +22 -0
  56. package/styles/variables/colors/theme/_general.scss +2 -0
  57. package/styles/variables/colors/theme/_index.scss +5 -4
  58. package/styles/variables/colors/theme/_layout.scss +1 -0
  59. package/styles/variables/colors/theme/_loaders.scss +4 -0
  60. package/styles/variables/colors/theme/_text.scss +12 -0
  61. package/styles/variables/sizes/_common.scss +3 -0
  62. package/text/collapsible-section/accordian.d.ts +16 -0
  63. package/text/collapsible-section/collapsible-section.d.ts +4 -4
  64. package/text/content-type-label/content-type-label.d.ts +14 -0
  65. package/{cards/card/card.helpers.d.ts → text/content-type-label/content-type-label.helpers.d.ts} +1 -1
  66. package/text/content-type-label/content-type-label.types.d.ts +1 -0
  67. package/text/content-type-label/index.d.ts +2 -0
  68. package/text/highlighted-text-box/highlighted-text-box.d.ts +9 -2
  69. package/text/icon-bulleted-list/icon-bulleted-list.d.ts +31 -0
  70. package/text/icon-bulleted-list/index.d.ts +1 -0
  71. package/text/index.d.ts +2 -0
  72. package/text/markdown-text/components/div/div.d.ts +1 -1
  73. package/text/markdown-text/markdown-text.d.ts +5 -1
  74. package/text/pill/pill.d.ts +2 -4
  75. package/user/contributors/contributors.d.ts +3 -1
@@ -10,8 +10,10 @@ interface Props {
10
10
  href?: string;
11
11
  /** `for`, for labels */
12
12
  htmlFor?: string;
13
+ /** Additional classes */
14
+ className?: string;
13
15
  }
14
- declare const _default: React.MemoExoticComponent<({ element, showOnFocus, children, ...props }: Props) => React.DetailedReactHTMLElement<{
16
+ declare const _default: React.MemoExoticComponent<({ element, showOnFocus, children, className, ...props }: Props) => React.DetailedReactHTMLElement<{
15
17
  className: string;
16
18
  children: React.ReactNode | JSX.Element;
17
19
  /** An `href`, for links */
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ /** The image to show on the banner */
4
+ image?: string;
5
+ /** The color variant of the list */
6
+ variant?: 'default' | 'dark';
7
+ /** The content to show */
8
+ children: React.ReactNode;
9
+ /** Additional classes */
10
+ className?: string;
11
+ }
12
+ declare const CustomContentBanner: ({ image, variant, children, className, }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ export default CustomContentBanner;
@@ -0,0 +1 @@
1
+ export { default as CustomContentBanner } from './custom-content-banner';
@@ -1,4 +1,5 @@
1
1
  export * from './banner';
2
2
  export * from './banner-section';
3
+ export * from './custom-content-banner';
3
4
  export * from './highlight-section';
4
5
  export * from './marketing-block';
@@ -1,7 +1,7 @@
1
1
  import { ResponsiveImageType } from '../general';
2
+ import { CustomIconType } from '../text';
2
3
  import { MemberProps } from '../user';
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';
4
+ export type CardContentType = 'customCard' | 'event' | 'learningHub' | 'listPage' | 'microcourse' | 'people' | 'qaQuestion' | 'solutionArticle';
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,9 +25,7 @@ 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?: {
29
- title: string;
30
- };
28
+ partner?: string[];
31
29
  /** The title of the card */
32
30
  title?: string;
33
31
  /** The primary text */
@@ -46,6 +44,8 @@ export interface CardType {
46
44
  customIcon?: CustomIconType;
47
45
  /** The label to use */
48
46
  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,12 +62,6 @@ 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
- };
71
65
  }
72
66
  export interface MockCardType extends CardType {
73
67
  cardType?: string;
@@ -214,35 +214,11 @@ export namespace learningHub {
214
214
  let slug_6: string;
215
215
  export { slug_6 as slug };
216
216
  }
217
- export namespace community {
217
+ export namespace custom {
218
218
  let contentType_7: string;
219
219
  export { contentType_7 as contentType };
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;
220
+ let slug_7: null;
226
221
  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 };
246
222
  export let customIcon: string;
247
223
  export let customLabel: string;
248
224
  let contributors_7: {
@@ -252,8 +228,8 @@ export namespace custom {
252
228
  };
253
229
  }[];
254
230
  export { contributors_7 as contributors };
255
- let text_2: string;
256
- export { text_2 as text };
231
+ let text_1: string;
232
+ export { text_1 as text };
257
233
  let secondaryText_1: string;
258
234
  export { secondaryText_1 as secondaryText };
259
235
  }
@@ -7,7 +7,6 @@ export declare const CONTENT_TYPES: {
7
7
  QUESTION: string;
8
8
  PEOPLE: string;
9
9
  LEARNING_HUB: string;
10
- COMMUNITY: string;
11
10
  CUSTOM: string;
12
11
  };
13
12
  export declare const buildCard: (contentType: string, cardType?: string | null) => {
@@ -96,9 +95,9 @@ export declare const cardMapper: {
96
95
  shortQuestion?: undefined;
97
96
  longQuestion?: undefined;
98
97
  people?: undefined;
98
+ customLink?: undefined;
99
99
  learningHub?: undefined;
100
100
  custom?: undefined;
101
- community?: undefined;
102
101
  } | {
103
102
  premium: {
104
103
  contentType: string;
@@ -181,9 +180,9 @@ export declare const cardMapper: {
181
180
  shortQuestion?: undefined;
182
181
  longQuestion?: undefined;
183
182
  people?: undefined;
183
+ customLink?: undefined;
184
184
  learningHub?: undefined;
185
185
  custom?: undefined;
186
- community?: undefined;
187
186
  } | {
188
187
  upcoming: {
189
188
  contentType: string;
@@ -299,9 +298,9 @@ export declare const cardMapper: {
299
298
  shortQuestion?: undefined;
300
299
  longQuestion?: undefined;
301
300
  people?: undefined;
301
+ customLink?: undefined;
302
302
  learningHub?: undefined;
303
303
  custom?: undefined;
304
- community?: undefined;
305
304
  } | {
306
305
  list: {
307
306
  contentType: string;
@@ -334,9 +333,9 @@ export declare const cardMapper: {
334
333
  shortQuestion?: undefined;
335
334
  longQuestion?: undefined;
336
335
  people?: undefined;
336
+ customLink?: undefined;
337
337
  learningHub?: undefined;
338
338
  custom?: undefined;
339
- community?: undefined;
340
339
  } | {
341
340
  noAnswers: {
342
341
  contentType: string;
@@ -406,9 +405,9 @@ export declare const cardMapper: {
406
405
  multipleSpeakers?: undefined;
407
406
  list?: undefined;
408
407
  people?: undefined;
408
+ customLink?: undefined;
409
409
  learningHub?: undefined;
410
410
  custom?: undefined;
411
- community?: undefined;
412
411
  } | {
413
412
  people: {
414
413
  contentType: string;
@@ -418,6 +417,15 @@ export declare const cardMapper: {
418
417
  profile: string;
419
418
  slug: string;
420
419
  };
420
+ customLink: {
421
+ slug: string;
422
+ customLinkText: string;
423
+ contentType: string;
424
+ title: string;
425
+ text: string;
426
+ secondaryText: string;
427
+ profile: string;
428
+ };
421
429
  oneAuthor?: undefined;
422
430
  twoAuthors?: undefined;
423
431
  multipleAuthors?: undefined;
@@ -437,7 +445,6 @@ export declare const cardMapper: {
437
445
  longQuestion?: undefined;
438
446
  learningHub?: undefined;
439
447
  custom?: undefined;
440
- community?: undefined;
441
448
  } | {
442
449
  learningHub: {
443
450
  contentType: string;
@@ -466,8 +473,8 @@ export declare const cardMapper: {
466
473
  shortQuestion?: undefined;
467
474
  longQuestion?: undefined;
468
475
  people?: undefined;
476
+ customLink?: undefined;
469
477
  custom?: undefined;
470
- community?: undefined;
471
478
  } | {
472
479
  custom: {
473
480
  contentType: string;
@@ -501,49 +508,9 @@ export declare const cardMapper: {
501
508
  shortQuestion?: undefined;
502
509
  longQuestion?: undefined;
503
510
  people?: undefined;
511
+ customLink?: undefined;
504
512
  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;
545
513
  };
546
514
  };
547
515
  export declare const buildCardDataMock: (card: MockCardType) => Promise<unknown>;
548
516
  export declare const buildCustomCardData: (card: CardType) => () => Promise<unknown>;
549
- export declare const buildCommunityCardData: (card: CardType, memberType: string) => () => Promise<unknown>;
@@ -0,0 +1,5 @@
1
+ export declare const COURSE_CONTENT_TYPES: {
2
+ ARTICLE: string;
3
+ DISCUSSION: string;
4
+ QUIZ: string;
5
+ };
@@ -1,3 +1,4 @@
1
1
  export * from './assets';
2
2
  export * from './contact-details';
3
+ export * from './courses';
3
4
  export * from './number-of-users';
@@ -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) => string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
7
+ export declare const FlagsProvider: ({ children, user }: Props) => import("react/jsx-runtime").JSX.Element | null;
8
8
  export {};
@@ -1,10 +1,22 @@
1
1
  import React from 'react';
2
+ export type LanguageType = keyof typeof supportedLanguages;
2
3
  export interface IIntlContext {
3
- locale?: 'en' | 'fr';
4
+ locale?: LanguageType;
4
5
  messages?: Record<string, string>;
5
6
  }
6
7
  interface Props extends IIntlContext {
7
8
  children: React.ReactNode;
8
9
  }
10
+ interface ILanguageContext {
11
+ language?: LanguageType;
12
+ updateLanguage?: (lang: string) => void;
13
+ }
9
14
  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
+ };
10
22
  export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ICourseProgressionTypes } from './course-progression.types';
3
+ declare const CourseProgression: ({ element, data: { timeLeftToFinish, percentageCompleted: { inTime, inLessons }, shouldShowTimes, }, graph, styling, className, }: ICourseProgressionTypes) => React.DetailedReactHTMLElement<{
4
+ className: string;
5
+ children: import("react/jsx-runtime").JSX.Element;
6
+ }, HTMLElement>;
7
+ export default CourseProgression;
@@ -0,0 +1,28 @@
1
+ export interface ICourseProgressionData {
2
+ /** The amount of time the remaining, completeable lessons will take to finish, in minutes */
3
+ timeLeftToFinish: number;
4
+ /** The percentage of the course that has been completed */
5
+ percentageCompleted: {
6
+ /** The percentage of timed lessons complete - this is used when the course shows the time for lessons */
7
+ inTime?: number;
8
+ /** The percentage of total, completeable lessons complete - this is used when the course hides the time for lessons */
9
+ inLessons?: number;
10
+ };
11
+ /** Whether the course shows the time for lessons */
12
+ shouldShowTimes?: boolean;
13
+ }
14
+ export interface ICourseProgressionTypes {
15
+ /** The element to wrap the course progression in */
16
+ element?: 'p' | 'aside' | 'div';
17
+ /** The data to display */
18
+ data: ICourseProgressionData;
19
+ /** The type of graph to display */
20
+ graph?: 'bar' | 'circle' | false;
21
+ /** Styling options */
22
+ styling?: {
23
+ /** Whether to highlight the percentage text */
24
+ highlightPercentage?: boolean;
25
+ };
26
+ /** Additional classes */
27
+ className?: string;
28
+ }
@@ -0,0 +1 @@
1
+ export { default as CourseProgression } from './course-progression';
@@ -0,0 +1,3 @@
1
+ import { ICourseStructure } from './course-structure.types';
2
+ declare const CourseStructure: ({ course: { articles, canAccessCourse, description, hideTimes, isEnrolled, sectionId, sectionTime, slug: microcourseSlug, timeLeft, title, }, quizScores, }: ICourseStructure) => import("react/jsx-runtime").JSX.Element;
3
+ export default CourseStructure;
@@ -0,0 +1,122 @@
1
+ export default data;
2
+ declare namespace data {
3
+ namespace course {
4
+ let articles: ({
5
+ title: string;
6
+ slug: string;
7
+ subsectionId: number;
8
+ humanTranslation: boolean;
9
+ completionTime: number;
10
+ type: string;
11
+ icon: string;
12
+ content: {
13
+ sys: {
14
+ type: string;
15
+ linkType: string;
16
+ id: string;
17
+ };
18
+ };
19
+ optional: boolean;
20
+ contentType: string;
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ image: null;
24
+ isIntroduction: boolean;
25
+ completed: boolean;
26
+ sectionId: number;
27
+ description?: undefined;
28
+ questions?: undefined;
29
+ question?: undefined;
30
+ } | {
31
+ title: string;
32
+ slug: string;
33
+ subsectionId: number;
34
+ humanTranslation: boolean;
35
+ completionTime: number;
36
+ type: string;
37
+ icon: string;
38
+ content: {
39
+ sys: {
40
+ type: string;
41
+ linkType: string;
42
+ id: string;
43
+ };
44
+ };
45
+ optional: boolean;
46
+ contentType: string;
47
+ createdAt: string;
48
+ updatedAt: string;
49
+ image: string;
50
+ isIntroduction: boolean;
51
+ completed: boolean;
52
+ sectionId: number;
53
+ description?: undefined;
54
+ questions?: undefined;
55
+ question?: undefined;
56
+ } | {
57
+ title: string;
58
+ slug: string;
59
+ subsectionId: number;
60
+ description: string;
61
+ questions: {
62
+ sys: {
63
+ type: string;
64
+ linkType: string;
65
+ id: string;
66
+ };
67
+ }[];
68
+ optional: boolean;
69
+ contentType: string;
70
+ createdAt: string;
71
+ updatedAt: string;
72
+ icon: string;
73
+ type: string;
74
+ completed: boolean;
75
+ sectionId: number;
76
+ humanTranslation?: undefined;
77
+ completionTime?: undefined;
78
+ content?: undefined;
79
+ image?: undefined;
80
+ isIntroduction?: undefined;
81
+ question?: undefined;
82
+ } | {
83
+ title: string;
84
+ slug: string;
85
+ subsectionId: number;
86
+ description: string;
87
+ question: {
88
+ sys: {
89
+ type: string;
90
+ linkType: string;
91
+ id: string;
92
+ };
93
+ };
94
+ optional: boolean;
95
+ contentType: string;
96
+ createdAt: string;
97
+ updatedAt: string;
98
+ icon: string;
99
+ type: string;
100
+ completed: boolean;
101
+ sectionId: number;
102
+ humanTranslation?: undefined;
103
+ completionTime?: undefined;
104
+ content?: undefined;
105
+ image?: undefined;
106
+ isIntroduction?: undefined;
107
+ questions?: undefined;
108
+ })[];
109
+ let canAccessCourse: boolean;
110
+ let description: string;
111
+ let hideTimes: boolean;
112
+ let isEnrolled: boolean;
113
+ let sectionId: number;
114
+ let sectionTime: number;
115
+ let slug: string;
116
+ let timeLeft: number;
117
+ let title: string;
118
+ }
119
+ let quizScores: {
120
+ 'check-what-youve-learned-vaw-data-1': number;
121
+ };
122
+ }
@@ -0,0 +1,55 @@
1
+ export interface ILessonType {
2
+ /** The time it takes to complete the article */
3
+ completionTime: number;
4
+ /** The article's icon */
5
+ icon: string;
6
+ /** Whether the article is optional */
7
+ optional: boolean;
8
+ /** The article's type */
9
+ type: string;
10
+ }
11
+ export interface ICourseStructureArticles extends ILessonType {
12
+ /** The article's content type */
13
+ contentType: string;
14
+ /** Whether the use has completed the article */
15
+ completed: boolean;
16
+ /** The article's image */
17
+ image?: string;
18
+ /** Whether the article is an introduction, which is visible whether the user is enrolled or not */
19
+ isIntroduction: boolean;
20
+ /** The article's slug */
21
+ slug: string;
22
+ /** The subsection ID */
23
+ subsectionId: number;
24
+ /** The article's title */
25
+ title: string;
26
+ }
27
+ export interface ICourseStructureCourse {
28
+ /** Articles in the course */
29
+ articles: ICourseStructureArticles[];
30
+ /** Whether the user can access the course */
31
+ canAccessCourse: boolean;
32
+ /** Description of the course */
33
+ description: string;
34
+ /** Whether to hide the times */
35
+ hideTimes: boolean;
36
+ /** Whether the user is enrolled in the course */
37
+ isEnrolled: boolean;
38
+ /** The section ID */
39
+ sectionId: number;
40
+ /** The time it takes to complete the course */
41
+ sectionTime: number;
42
+ /** The course slug */
43
+ slug: string;
44
+ /** The time left to complete the course */
45
+ timeLeft: number;
46
+ /** The course title */
47
+ title: string;
48
+ }
49
+ export interface ICourseStructure {
50
+ /** Details about the course */
51
+ course: ICourseStructureCourse;
52
+ quizScores?: {
53
+ [key: string]: number;
54
+ };
55
+ }
@@ -0,0 +1 @@
1
+ export { default as CourseStructure } from './course-structure';
@@ -0,0 +1,5 @@
1
+ export * from './course-progression';
2
+ export * from './course-structure';
3
+ export * from './lesson-name';
4
+ export * from './lesson-type';
5
+ export * from './mark-complete-button';
@@ -0,0 +1 @@
1
+ export { default as LessonName } from './lesson-name';
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ /** The element to use for the lesson name */
4
+ element?: 'h1' | 'span';
5
+ /** The ID of the lesson section */
6
+ sectionId: number;
7
+ /** The ID of the section article */
8
+ subsectionId: number;
9
+ /** The title of the lesson */
10
+ title: string;
11
+ /** Additional classes */
12
+ className?: string;
13
+ }
14
+ declare const LessonName: ({ element, sectionId, subsectionId, title, className, }: Props) => React.DetailedReactHTMLElement<{
15
+ className: string;
16
+ 'data-number': string;
17
+ children: string;
18
+ }, HTMLElement>;
19
+ export default LessonName;
@@ -0,0 +1 @@
1
+ export { default as LessonType } from './lesson-type';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ILessonType } from './../course-structure/course-structure.types';
3
+ interface LessonTypeProps extends ILessonType {
4
+ /** The size of the component */
5
+ size?: 'default' | 'large';
6
+ /** Optional children */
7
+ children?: React.ReactNode;
8
+ }
9
+ declare const LessonType: ({ size, completionTime, icon, optional, type, children, }: LessonTypeProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default LessonType;
@@ -0,0 +1 @@
1
+ export { default as MarkCompleteButton } from './mark-complete-button';
@@ -0,0 +1,7 @@
1
+ import { ButtonPropsType } from '../../general';
2
+ interface MarkCompleteButtonProps extends ButtonPropsType {
3
+ /** Whether the lesson is complete */
4
+ isComplete?: boolean;
5
+ }
6
+ declare const MarkCompleteButton: ({ isComplete, onClick, ...props }: MarkCompleteButtonProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default MarkCompleteButton;
@@ -4,4 +4,6 @@ export * from './image-container';
4
4
  export * from './link';
5
5
  export * from './responsive-image';
6
6
  export * from './return-to-nav-button';
7
+ export * from './table-of-contents';
8
+ export * from './time-to-complete';
7
9
  export * from './tooltip';
@@ -22,6 +22,8 @@ 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;
25
27
  }
26
- declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: Props) => string | JSX.Element | JSX.Element[];
28
+ declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
27
29
  export default Link;
@@ -0,0 +1 @@
1
+ export { default as TableOfContents } from './table-of-contents';
@@ -0,0 +1,16 @@
1
+ interface TableOfContentsItem {
2
+ /** The id of the element to link to */
3
+ id: string;
4
+ /** The text to show in the link */
5
+ text: string;
6
+ }
7
+ interface Props {
8
+ /** The items to show. This will default to all h1-h6s inside the `selector`. */
9
+ items?: TableOfContentsItem[];
10
+ /** A parent selector for all h1-h6s, to use if no items have been passed in. */
11
+ selector?: string;
12
+ /** Additional classes */
13
+ className?: string;
14
+ }
15
+ declare const TableOfContents: ({ items: originalItems, selector, className, }: Props) => false | import("react/jsx-runtime").JSX.Element;
16
+ export default TableOfContents;
@@ -0,0 +1 @@
1
+ export { default as TimeToComplete } from './time-to-complete';
@@ -0,0 +1,14 @@
1
+ interface Props {
2
+ /** The time to display, in minutes */
3
+ time: number;
4
+ /** An optional number to add to `time`, showing a range rather than a specific number, like `1h 45m - 2h` */
5
+ rangeTime?: number;
6
+ /** Text to show before the time */
7
+ prependedText?: string;
8
+ /** Text to show after the time */
9
+ appendedText?: string;
10
+ /** Additional classes */
11
+ className?: string;
12
+ }
13
+ declare const TimeToComplete: ({ time, rangeTime, prependedText, appendedText, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
14
+ export default TimeToComplete;
@@ -1 +1,3 @@
1
1
  export declare const camelCaseToDashCase: (str: string) => string;
2
+ export declare const toCamelCase: (str?: string) => string;
3
+ export declare const toSentenceCase: (str?: string) => string;