@apolitical/component-library 2.2.3 → 2.3.0-beta.1

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 (66) 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/card/components/links/links.d.ts +1 -1
  6. package/cards/cards.types.d.ts +3 -1
  7. package/cards/mocks/mocks.helpers.d.ts +16 -0
  8. package/constants/courses.d.ts +5 -0
  9. package/constants/index.d.ts +1 -0
  10. package/courses/course-progression/course-progression.d.ts +7 -0
  11. package/courses/course-progression/course-progression.types.d.ts +28 -0
  12. package/courses/course-progression/index.d.ts +1 -0
  13. package/courses/course-structure/course-structure.d.ts +3 -0
  14. package/courses/course-structure/course-structure.mock.d.ts +122 -0
  15. package/courses/course-structure/course-structure.types.d.ts +55 -0
  16. package/courses/course-structure/index.d.ts +1 -0
  17. package/courses/index.d.ts +5 -0
  18. package/courses/lesson-name/index.d.ts +1 -0
  19. package/courses/lesson-name/lesson-name.d.ts +19 -0
  20. package/courses/lesson-type/index.d.ts +1 -0
  21. package/courses/lesson-type/lesson-type.d.ts +10 -0
  22. package/courses/mark-complete-button/index.d.ts +1 -0
  23. package/courses/mark-complete-button/mark-complete-button.d.ts +7 -0
  24. package/general/index.d.ts +2 -0
  25. package/general/link/link.d.ts +2 -0
  26. package/general/table-of-contents/index.d.ts +1 -0
  27. package/general/table-of-contents/table-of-contents.d.ts +16 -0
  28. package/general/time-to-complete/index.d.ts +1 -0
  29. package/general/time-to-complete/time-to-complete.d.ts +12 -0
  30. package/helpers/cases.d.ts +2 -0
  31. package/helpers/intl.d.ts +376 -1
  32. package/index.d.ts +3 -1
  33. package/index.js +18 -18
  34. package/index.mjs +6053 -5532
  35. package/loaders/progress-bar/progress-bar.d.ts +11 -1
  36. package/modals/invite-modal/invite-modal.d.ts +2 -2
  37. package/navigation/load-more/load-more.d.ts +2 -1
  38. package/package.json +1 -1
  39. package/sections/full-width-section/full-width-section.d.ts +2 -0
  40. package/sections/logo-section/logo-section.d.ts +11 -1
  41. package/style.css +1 -1
  42. package/styles/base/_layout.scss +2 -0
  43. package/styles/base/_lists.scss +29 -1
  44. package/styles/base/_titles.scss +14 -0
  45. package/styles/base/buttons/_button-wrapper.scss +1 -0
  46. package/styles/base/buttons/_icons.scss +9 -0
  47. package/styles/variables/colors/theme/_banners.scss +8 -0
  48. package/styles/variables/colors/theme/_base.scss +2 -0
  49. package/styles/variables/colors/theme/_courses.scss +22 -0
  50. package/styles/variables/colors/theme/_general.scss +2 -0
  51. package/styles/variables/colors/theme/_index.scss +5 -4
  52. package/styles/variables/colors/theme/_layout.scss +1 -0
  53. package/styles/variables/colors/theme/_loaders.scss +4 -0
  54. package/styles/variables/colors/theme/_text.scss +12 -0
  55. package/text/collapsible-section/accordian.d.ts +15 -0
  56. package/text/collapsible-section/collapsible-section.d.ts +4 -4
  57. package/text/content-type-label/content-type-label.d.ts +14 -0
  58. package/{cards/card/card.helpers.d.ts → text/content-type-label/content-type-label.helpers.d.ts} +1 -1
  59. package/text/content-type-label/content-type-label.types.d.ts +1 -0
  60. package/text/content-type-label/index.d.ts +2 -0
  61. package/text/highlighted-text-box/highlighted-text-box.d.ts +9 -2
  62. package/text/icon-bulleted-list/icon-bulleted-list.d.ts +31 -0
  63. package/text/icon-bulleted-list/index.d.ts +1 -0
  64. package/text/index.d.ts +2 -0
  65. package/text/markdown-text/markdown-text.d.ts +5 -1
  66. package/text/pill/pill.d.ts +1 -1
@@ -7,6 +7,8 @@
7
7
 
8
8
  .center {
9
9
  text-align: center;
10
+ margin-right: auto;
11
+ margin-left: auto;
10
12
  }
11
13
 
12
14
  .content-slim {
@@ -1,9 +1,14 @@
1
- @import './../functions';
1
+ @import './../mixins', './../functions', './../variables';
2
2
 
3
3
  $ul: (
4
4
  'margin-bottom': 16,
5
5
  'padding-left': 40,
6
6
  );
7
+ $checkmarks: (
8
+ 'width': 16,
9
+ 'top': 7,
10
+ 'margin-right': 12,
11
+ );
7
12
  $li: (
8
13
  'margin-bottom': 18,
9
14
  'margin-bottom_sm': 12,
@@ -18,6 +23,29 @@ $li: (
18
23
  display: block;
19
24
  }
20
25
 
26
+ ul.checkmarks {
27
+ list-style: none;
28
+
29
+ li {
30
+ position: relative;
31
+ padding-left: px-to-rem(
32
+ get-map($checkmarks, 'width') + get-map($checkmarks, 'margin-right')
33
+ );
34
+
35
+ &::before {
36
+ @include image('icons/check-inside-circle.svg', true);
37
+
38
+ content: '';
39
+ width: px-to-rem(get-map($checkmarks, 'width'));
40
+ height: px-to-rem(get-map($checkmarks, 'width'));
41
+ background: get-map($theme, 'list_checkmarks_bg');
42
+ position: absolute;
43
+ top: px-to-rem(get-map($checkmarks, 'top'));
44
+ left: 0;
45
+ }
46
+ }
47
+ }
48
+
21
49
  li {
22
50
  margin-bottom: px-to-rem(get-map($li, 'margin-bottom'));
23
51
 
@@ -5,6 +5,9 @@ $highlight: (
5
5
  'height': 4,
6
6
  'margin-top': 12,
7
7
  'border-radius': 8,
8
+ 'width_vertical': 4,
9
+ 'height_vertical': 24,
10
+ 'bottom_vertical': 26,
8
11
  );
9
12
  $pre-title: (
10
13
  'font-size': 14,
@@ -104,6 +107,17 @@ $count-icon: (
104
107
  left: 50%;
105
108
  transform: translateX(-50%);
106
109
  }
110
+ } @else if $align == 'vertical' {
111
+ padding-left: px-to-rem(
112
+ get-map($highlight, 'height') + get-map($highlight, 'margin-top')
113
+ );
114
+
115
+ &::after {
116
+ width: px-to-rem(get-map($highlight, 'width_vertical'));
117
+ height: px-to-rem(get-map($highlight, 'height_vertical'));
118
+ bottom: px-to-rem(get-map($highlight, 'bottom_vertical'));
119
+ max-height: 100%;
120
+ }
107
121
  }
108
122
  }
109
123
 
@@ -22,6 +22,7 @@ $button-wrapper-button: (
22
22
  }
23
23
 
24
24
  li {
25
+ line-height: normal;
25
26
  display: flex;
26
27
  align-content: center;
27
28
 
@@ -9,9 +9,18 @@
9
9
 
10
10
  $icons: ('arrow_left', (d, d, 3, 8), (d, d, 3, 8), (d, d, 4, 7)),
11
11
  ('arrow_right', (d, d, 3, 8), (d, d, 3, 8), (d, d, 4, 7)),
12
+ ('arrow_rotating', (20, 20, 2, d), (d, d, 2, d), (15, 15, d, d)),
12
13
  ('arrow_corner-down_right', (12, 12, 6, 8), (12, 12, 4, 12), (d, d, d, d)),
13
14
  ('arrow_corner-down_left', (12, 12, 6, 8), (12, 12, 4, 12), (d, d, d, d)),
14
15
  ('arrow-down', (d, d, 4, 10), (d, d, 3, 8), (d, d, 4, d)),
16
+ ('check-inside-circle', (28, 28, -2, d), (d, d, 3, d), (d, d, d, d)),
17
+ ('check-inside-circle_no-overlap', (28, 28, -2, d), (24, 24, -2, d), (d, d, 2, d)),
18
+ (
19
+ 'check-inside-circle_no-overlap_inverted',
20
+ (28, 28, -2, d),
21
+ (24, 24, -2, d),
22
+ (d, d, 2, d)
23
+ ),
15
24
  ('chevron_left', (16, 16, 4, 8), (14, 14, 3, 8), (14, 14, d, d)),
16
25
  ('chevron_right', (16, 16, 4, 8), (14, 14, 3, 8), (14, 14, d, d)),
17
26
  ('close', (48, 48, 0, 0), (32, 32, 0, 0), (24, 24, 0, 0)),
@@ -14,6 +14,14 @@ $banners: (
14
14
  banner-section_eyebrow: get-map($c, 'y300'),
15
15
  banner-section_light_eyebrow: get-map($c, 'b700'),
16
16
  banner-section_light_title: get-map($c, 'n900'),
17
+ custom-content-banner: get-map($c, 'n900'),
18
+ custom-content-banner_bg: get-map($c, 'n50'),
19
+ custom-content-banner_overlay:
20
+ linear-gradient(90deg, #{get-map($c, 'n50')} 50%, rgb(240 245 255 / 0%) 100%),
21
+ custom-content-banner_dark: get-map($c, 'white'),
22
+ custom-content-banner_dark_bg: get-map($c, 'b900'),
23
+ custom-content-banner_dark_overlay:
24
+ linear-gradient(273deg, rgb(126 115 182 / 0%) 5.36%, #{get-map($c, 'b900')} 47.32%),
17
25
  marketing-block_title: get-map($c, 'n900'),
18
26
  marketing-block_tertiary_title: get-map($c, 'white'),
19
27
  marketing-block_text: get-map($c, 'n700'),
@@ -85,4 +85,6 @@ $base: (
85
85
  table_th: get-map($c, 'white'),
86
86
  table_th_bg: get-map($c, 'n600'),
87
87
  overlay: rgb(21 25 33 / 25%),
88
+ list_checkmarks_bg:
89
+ linear-gradient(140deg, rgba(107 62 205 / 100%), rgba(0 179 191 / 100%)),
88
90
  );
@@ -0,0 +1,22 @@
1
+ @import './../colors';
2
+ @import './../../../functions';
3
+
4
+ $c: $default-colors;
5
+ $courses: (
6
+ course-structure_border: get-map($c, 'n100'),
7
+ course-structure_summary_small: get-map($c, 'b700'),
8
+ course-structure_link_bg: get-map($c, 'white'),
9
+ course-structure_link_hover_bg: get-map($c, 'b100'),
10
+ course-structure_icon: get-map($c, 'n700'),
11
+ course-structure_icon_bg: get-map($c, 'white'),
12
+ course-structure_overlay_icon: get-map($c, 'white'),
13
+ course-structure_locked_icon_bg: get-map($c, 'p500'),
14
+ course-structure_completed_icon_bg: get-map($c, 'g600'),
15
+ course-structure_content-type: get-map($c, 'n700'),
16
+ course-progressions: get-map($c, 'n600'),
17
+ course-progressions_percentage: get-map($c, 'b700'),
18
+ course-progressions_progress-bar: get-map($c, 'n100'),
19
+ course-progressions_progress-bar_bg: get-map($c, 'g300'),
20
+ lesson-type_large_time: get-map($c, 'n700'),
21
+ mark-complete-button_completed: get-map($c, 'g600'),
22
+ );
@@ -9,6 +9,8 @@ $general: (
9
9
  return_to_nav_box_shadow: get-map($c, 'black'),
10
10
  return_to_nav_bg_focus_active: get-map($c, 'white'),
11
11
  return_to_nav_bg_before_after: get-map($c, 'b700'),
12
+ table-of-contents_border: get-map($c, 'b200'),
13
+ time-to-complete: get-map($c, 'p500'),
12
14
  tooltip: get-map($c, 'white'),
13
15
  tooltip_bg: color.adjust(get-map($c, 'n900'), $alpha: -0.1),
14
16
  );
@@ -1,8 +1,9 @@
1
1
  @import './../../../functions';
2
- @import 'banners', 'base', 'cards', 'communities', 'discussion', 'form', 'general',
3
- 'layout', 'loaders', 'modals', 'navigation', 'pages', 'sections', 'text', 'user';
2
+ @import 'banners', 'base', 'cards', 'communities', 'courses', 'discussion', 'form',
3
+ 'general', 'layout', 'loaders', 'modals', 'navigation', 'pages', 'sections', 'text',
4
+ 'user';
4
5
 
5
6
  $theme: merge-maps(
6
- $banners $base $cards $communities $discussion $form $general $layout $loaders $modals
7
- $navigation $pages $sections $text $user
7
+ $banners $base $cards $communities $courses $discussion $form $general $layout $loaders
8
+ $modals $navigation $pages $sections $text $user
8
9
  );
@@ -38,6 +38,7 @@ $layout: (
38
38
  header_border: get-map($c, 'n100'),
39
39
  logos_title: get-map($c, 'n700'),
40
40
  logos_small: get-map($c, 'n600'),
41
+ logos_wrapped-logo_bg: get-map($c, 'white'),
41
42
  page-layout_gradient_bg_1: get-map($c, 'n50'),
42
43
  page-layout_subtle_bg: rgb(43 137 117 / 10%),
43
44
  page-layout_gradient_bg_2: rgb(240 245 255 / 0%),
@@ -17,4 +17,8 @@ $loaders: (
17
17
  progress-bar_75_bg_2: get-map($c, 'b200'),
18
18
  progress-bar_100_bg_1: get-map($c, 'b200'),
19
19
  progress-bar_100_bg_2: get-map($c, 'g100'),
20
+ progress-bar_circle_inner: get-map($c, 'white'),
21
+ progress-bar_circle_bg: get-map($c, 'n100'),
22
+ progress-bar_circle_progress: get-map($c, 'g300'),
23
+ progress-bar_circle_dark_progress: get-map($c, 'b700'),
20
24
  );
@@ -18,25 +18,37 @@ $text: (
18
18
  highlighted-text-box_bg: get-map($c, 'n50'),
19
19
  highlighted-text-box_secondary_bg: get-map($c, 'y50'),
20
20
  highlighted-text-box_tertiary_bg: get-map($c, 'error50'),
21
+ highlighted-text-box_quaternary_bg: get-map($c, 'g50'),
21
22
  highlighted-text-box_subtle_bg: get-map($c, 'white'),
23
+ highlighted-text-box_subtle-alt_dark_bg: get-map($c, 'n50'),
22
24
  highlighted-text-box_bold_bg:
23
25
  linear-gradient(135deg, get-map($c, 'b100'), get-map($c, 'g50')),
24
26
  highlighted-text-box_subtle_gradient:
25
27
  linear-gradient(rgba(255 255 255 / 0%), rgba(255 255 255 / 100%)),
26
28
  highlighted-text-box_bold_icon: get-map($c, 'b500'),
27
29
  highlighted-text-box_subtle_border: get-map($c, 'n100'),
30
+ highlighted-text-box_subtle-alt_border: get-map($c, 'n200'),
28
31
  highlighted-text-box_muted_bg: get-map($c, 'n40'),
29
32
  highlighted-text-box_muted_icon: get-map($c, 'n600'),
33
+ highlighted-text-box_quaternary_highlight: get-map($c, 'g300'),
34
+ highlighted-text-box_subtle-alt_highlight: get-map($c, 'g300'),
35
+ icon-bulleted-list: get-map($c, 'b700'),
36
+ icon-bulleted-list_light: get-map($c, 'y300'),
37
+ icon-bulleted-list_muted: get-map($c, 'n700'),
38
+ icon-bulleted-list_border: get-map($c, 'n200'),
39
+ icon-bulleted-list_zebra_bg: get-map($c, 'n50'),
30
40
  page-heading_bg:
31
41
  linear-gradient(180deg, get-map($c, 'n50') 0%, rgb(240 245 255 / 0%) 100%),
32
42
  page-heading_subtitle: get-map($c, 'n700'),
33
43
  page-user_location_text: get-map($c, 'p500'),
34
44
  pill: get-map($c, 'n900'),
35
45
  pill_highlighted: get-map($c, 'n700'),
46
+ pill_highlighted-light: get-map($c, 'n900'),
36
47
  pill_registered: get-map($c, 'g700'),
37
48
  pill_bg: get-map($c, 'n200'),
38
49
  pill_subtle_bg: get-map($c, 'white'),
39
50
  pill_highlighted_bg: get-map($c, 'y300'),
51
+ pill_highlighted-light_bg: get-map($c, 'y100'),
40
52
  pill_light_bg: get-map($c, 'info50'),
41
53
  pill_information_bg: get-map($c, 'g100'),
42
54
  pill_registered_bg: get-map($c, 'g50'),
@@ -0,0 +1,15 @@
1
+ export default Accordion;
2
+ declare class Accordion {
3
+ constructor(el: any);
4
+ el: any;
5
+ summary: any;
6
+ content: any;
7
+ animation: any;
8
+ isClosing: boolean;
9
+ isExpanding: boolean;
10
+ onClick(e: any): void;
11
+ shrink(): void;
12
+ open(): void;
13
+ expand(): void;
14
+ onAnimationFinish(open: any): void;
15
+ }
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
3
  /** The text to show when the section is collapsed */
4
- label?: string | false;
4
+ label?: string | React.ReactNode | false;
5
5
  /** Additional classes to add to the `details` */
6
6
  className?: string;
7
7
  /** The content to show when the section is expanded */
8
8
  children?: React.ReactNode;
9
- /** The language to use for the text */
10
- locale?: string;
9
+ /** Whether the section should animate when opening/closing */
10
+ shouldAnimate?: boolean;
11
11
  }
12
- declare const CollapsibleSection: ({ label, className, children }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ declare const CollapsibleSection: ({ label, className, children, shouldAnimate, }: Props) => import("react/jsx-runtime").JSX.Element;
13
13
  export default CollapsibleSection;
@@ -0,0 +1,14 @@
1
+ import { CardContentType } from '../../cards';
2
+ import { CustomIconType } from './content-type-label.types';
3
+ interface Props {
4
+ /** The Contentful content model type */
5
+ contentType: CardContentType;
6
+ /** The icon to use */
7
+ customIcon?: CustomIconType;
8
+ /** The label to use */
9
+ customLabel?: string;
10
+ /** Additional classes */
11
+ className?: string;
12
+ }
13
+ declare const ContentTypeLabel: ({ contentType, customIcon, customLabel, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
14
+ export default ContentTypeLabel;
@@ -1,4 +1,4 @@
1
- import { CustomIconType } from '../../cards/cards.types';
1
+ import { CustomIconType } from './content-type-label.types';
2
2
  export declare const fileNames: {
3
3
  [key in CustomIconType]?: string;
4
4
  };
@@ -0,0 +1 @@
1
+ export type CustomIconType = 'calendar' | 'cube' | 'document' | 'download' | 'globe' | 'graduationCap' | 'link' | 'person' | 'star' | 'speech';
@@ -0,0 +1,2 @@
1
+ export type { CustomIconType } from './content-type-label.types';
2
+ export { default as ContentTypeLabel } from './content-type-label';
@@ -1,9 +1,16 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
3
  /** The style of box being rendered */
4
- variant?: 'primary' | 'secondary' | 'tertiary' | 'subtle' | 'bold' | 'muted';
4
+ variant?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'subtle' | 'subtle-alt' | 'bold' | 'muted';
5
5
  /** The name of an icon file to display at the top */
6
6
  icon?: string;
7
+ /** Optional styling for the box */
8
+ styling?: {
9
+ /** Whether to show a highlight at the bottom of the box, for `subtle-alt` */
10
+ showHighlight?: boolean;
11
+ /** The background of the box, for `subtle-alt`. Defaults to `default` */
12
+ background?: 'default' | 'dark';
13
+ };
7
14
  /** Additional classes to add to the box */
8
15
  className?: string;
9
16
  /** The content to display */
@@ -11,5 +18,5 @@ interface Props {
11
18
  /** Additional props to pass to the box */
12
19
  style?: React.CSSProperties;
13
20
  }
14
- declare const HighlightedTextBoxWrapper: ({ variant, icon, className, children, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
21
+ declare const HighlightedTextBoxWrapper: ({ variant, icon, styling, className, children, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
15
22
  export default HighlightedTextBoxWrapper;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ element?: 'ul' | 'ol' | 'dl';
4
+ /** The layout of the list; `dls` cannot have a horizontal layout */
5
+ layout?: 'vertical' | 'horizontal';
6
+ /** The color variant of the list */
7
+ variant?: 'default' | 'light' | 'muted';
8
+ /** Text for list */
9
+ items: {
10
+ /** The file name of the icon */
11
+ icon: string;
12
+ /** The text to display in the `dt` (only used when the element is `dl`) */
13
+ dt?: string;
14
+ /** The text to display */
15
+ text: string;
16
+ }[];
17
+ /** Additional styling */
18
+ styling?: {
19
+ /** If the list should have a border */
20
+ hasBorder?: boolean;
21
+ /** If the list should have alternating colours (zebra stripes) */
22
+ zebraStriping?: boolean;
23
+ };
24
+ /** Additional classes */
25
+ className?: string;
26
+ }
27
+ declare const IconBulletedList: ({ element, layout, variant, items, styling, className, }: Props) => React.DetailedReactHTMLElement<{
28
+ className: string;
29
+ children: import("react/jsx-runtime").JSX.Element[];
30
+ }, HTMLElement>;
31
+ export default IconBulletedList;
@@ -0,0 +1 @@
1
+ export { default as IconBulletedList } from './icon-bulleted-list';
package/text/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  export * from './collapsible-section';
2
+ export * from './content-type-label';
2
3
  export * from './empty-state-box';
3
4
  export * from './helper-text-box';
4
5
  export * from './hide-show-text-box';
5
6
  export * from './highlighted-text-box';
7
+ export * from './icon-bulleted-list';
6
8
  export * from './markdown-text';
7
9
  export * from './page-heading';
8
10
  export * from './pill';
@@ -7,6 +7,10 @@ interface Props {
7
7
  children: string;
8
8
  /** What is being changed or removed in the final mark-up. `default` handles large blocks of HTML for courses. `text-only` only expects text and will remove `iframe`s. */
9
9
  overrideType?: 'default' | 'text-only';
10
+ styling?: {
11
+ /** Whether to highlight the titles */
12
+ highlightTitles?: boolean;
13
+ };
10
14
  }
11
- declare const MarkdownText: ({ className, options, children, overrideType, }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ declare const MarkdownText: ({ className, options, children, overrideType, styling, }: Props) => import("react/jsx-runtime").JSX.Element;
12
16
  export default MarkdownText;
@@ -3,7 +3,7 @@ interface Props {
3
3
  /** The size of the pill */
4
4
  size?: 'small' | 'medium' | 'large';
5
5
  /** The style of the pill */
6
- variant?: 'default' | 'subtle' | 'highlighted' | 'information' | 'registered' | 'light';
6
+ variant?: 'default' | 'subtle' | 'highlighted' | 'highlighted-light' | 'information' | 'registered' | 'light';
7
7
  /** Additional classes to add to the pill */
8
8
  className?: string;
9
9
  /** The pill text */