@apolitical/component-library 4.7.17-4765.3 → 4.7.17-ac.10

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 (37) hide show
  1. package/communities/members-list/members-list.d.ts +2 -1
  2. package/communities/members-list/members-list.mock.d.ts +21 -0
  3. package/context/badges/badges.context.d.ts +13 -0
  4. package/context/badges/badges.hook.d.ts +1 -0
  5. package/context/badges/badges.provider.d.ts +8 -0
  6. package/context/badges/index.d.ts +4 -0
  7. package/context/global/global.providers.d.ts +1 -1
  8. package/context/index.d.ts +1 -0
  9. package/discussion/components/add-post/add-post.d.ts +2 -0
  10. package/discussion/components/form/form.d.ts +1 -1
  11. package/discussion/components/form/form.type.d.ts +2 -0
  12. package/discussion/components/post/post.d.ts +4 -1
  13. package/discussion/discussion.helpers.d.ts +1 -0
  14. package/discussion/feeds/activities-feed/mocks/activities-feed.mock.d.ts +42 -0
  15. package/discussion/feeds/replies-feed/mocks/replies-feed.mock.d.ts +33 -0
  16. package/discussion/feeds/replies-feed/nested-replies-feed/mocks/nested-replies-feed.mock.d.ts +29 -2
  17. package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +5 -0
  18. package/discussion/shared/interfaces/user.interface.d.ts +2 -0
  19. package/index.js +63 -63
  20. package/index.mjs +7475 -7376
  21. package/package.json +1 -1
  22. package/style.css +1 -1
  23. package/styles/variables/colors/theme/_index.scss +5 -5
  24. package/styles/variables/colors/theme/_text.scss +2 -2
  25. package/styles/variables/colors/theme/_user.scss +6 -0
  26. package/text/hide-show-text-box/hide-show-text-box.d.ts +1 -3
  27. package/user/badge/badge.d.ts +7 -0
  28. package/user/badge/icon-mapping.d.ts +11 -0
  29. package/user/badge/index.d.ts +2 -0
  30. package/user/badge/interface/badge.interfaces.d.ts +9 -0
  31. package/user/badges/badges.d.ts +12 -0
  32. package/user/badges/badges.interface.d.ts +6 -0
  33. package/user/badges/index.d.ts +2 -0
  34. package/user/member/member.d.ts +7 -1
  35. package/user/member/member.helpers.d.ts +2 -0
  36. package/user/member/member.mock.d.ts +8 -0
  37. package/styles/variables/colors/theme/_assistant.scss +0 -11
@@ -1,9 +1,9 @@
1
1
  @import './../../../functions';
2
- @import 'assistant', 'banners', 'base', 'cards', 'communities', 'courses', 'discussion',
3
- 'form', 'general', 'layout', 'loaders', 'modals', 'navigation', 'pages', 'sections',
4
- 'text', 'user';
2
+ @import 'banners', 'base', 'cards', 'communities', 'courses', 'discussion', 'form',
3
+ 'general', 'layout', 'loaders', 'modals', 'navigation', 'pages', 'sections', 'text',
4
+ 'user';
5
5
 
6
6
  $theme: merge-maps(
7
- $assistant $banners $base $cards $communities $courses $discussion $form $general
8
- $layout $loaders $modals $navigation $pages $sections $text $user
7
+ $banners $base $cards $communities $courses $discussion $form $general $layout $loaders
8
+ $modals $navigation $pages $sections $text $user
9
9
  );
@@ -18,8 +18,6 @@ $text: (
18
18
  helper-text-box_warning_bg: get-map($c, 'warning50'),
19
19
  helper-text-box_error_bg: get-map($c, 'error50'),
20
20
  helper-text-box_success_bg: get-map($c, 'success50'),
21
- hide-show-text-box_gradient:
22
- linear-gradient(rgba(255 255 255 / 0%), rgba(255 255 255 / 100%)),
23
21
  highlighted-text-box_bg: get-map($c, 'n50'),
24
22
  highlighted-text-box_secondary_bg: get-map($c, 'y50'),
25
23
  highlighted-text-box_tertiary_bg: get-map($c, 'error50'),
@@ -28,6 +26,8 @@ $text: (
28
26
  highlighted-text-box_subtle-alt_dark_bg: get-map($c, 'n50'),
29
27
  highlighted-text-box_bold_bg:
30
28
  linear-gradient(135deg, get-map($c, 'b100'), get-map($c, 'g50')),
29
+ highlighted-text-box_subtle_gradient:
30
+ linear-gradient(rgba(255 255 255 / 0%), rgba(255 255 255 / 100%)),
31
31
  highlighted-text-box_bold_icon: get-map($c, 'b500'),
32
32
  highlighted-text-box_subtle_border: get-map($c, 'n100'),
33
33
  highlighted-text-box_subtle-alt_border: get-map($c, 'n200'),
@@ -3,6 +3,12 @@
3
3
 
4
4
  $c: $default-colors;
5
5
  $user: (
6
+ badge_bg: get-map($c, 'n200'),
7
+ badge_bg_blue: #a2daf9,
8
+ badge_bg_green: #a4f9a2,
9
+ badge_bg_pink: #fae1f5,
10
+ badge_bg_purple: #e2e1fa,
11
+ badge_bg_orange: #f9dba2,
6
12
  contributor: get-map($c, 'n700'),
7
13
  contributor_bg: get-map($c, 'white'),
8
14
  contributor_medium_bg: get-map($c, 'n200'),
@@ -13,10 +13,8 @@ interface Props {
13
13
  hide?: string | false;
14
14
  /** The content to show when the section is expanded */
15
15
  text: string;
16
- /** Fade style to hide the text */
17
- fadeStyle?: 'default' | 'none';
18
16
  markdownOptions?: MarkdownToJSX.Options;
19
17
  children?: React.ReactNode;
20
18
  }
21
- declare const HideShowTextBox: ({ id, className, show, hide, text, markdownOptions, fadeStyle, children, }: Props) => import("react/jsx-runtime").JSX.Element;
19
+ declare const HideShowTextBox: ({ id, className, show, hide, text, markdownOptions, children, }: Props) => import("react/jsx-runtime").JSX.Element | null;
22
20
  export default HideShowTextBox;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ /** The slug of the badge */
4
+ slug: string;
5
+ }
6
+ declare const Badge: React.FC<Props>;
7
+ export default Badge;
@@ -0,0 +1,11 @@
1
+ export interface IconMapping {
2
+ [key: string]: string;
3
+ }
4
+ declare const iconMapping: {
5
+ globe: string;
6
+ heart: string;
7
+ pencil: string;
8
+ star: string;
9
+ 'speech-bubble': string;
10
+ };
11
+ export default iconMapping;
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from './badge';
2
+ export { BadgeScope, type IBadgesObject } from './interface/badge.interfaces';
@@ -0,0 +1,9 @@
1
+ export declare enum BadgeScope {
2
+ COMMUNITIES = "communities",
3
+ ALL = "all"
4
+ }
5
+ export type IBadgesObject = {
6
+ [key in BadgeScope.ALL | BadgeScope.COMMUNITIES]: {
7
+ [key: string]: string[];
8
+ };
9
+ };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { IBadgesOption } from './badges.interface';
3
+ import { IBadgesObject } from '../badge/interface/badge.interfaces';
4
+ interface Props {
5
+ element?: 'span' | 'div';
6
+ /** The user badges */
7
+ userBadges: IBadgesObject;
8
+ /** The badge options */
9
+ badgeOptions: IBadgesOption;
10
+ }
11
+ declare const Badges: React.FC<Props>;
12
+ export default Badges;
@@ -0,0 +1,6 @@
1
+ import { BadgeScope } from '../badge/interface/badge.interfaces';
2
+ export interface IBadgesOption {
3
+ showBadges?: boolean;
4
+ scope?: BadgeScope.ALL | BadgeScope.COMMUNITIES;
5
+ area?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Badges } from './badges';
2
+ export type { IBadgesOption } from './badges.interface';
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import { type IProfileFormProps } from '../../form';
3
+ import { IBadgesObject } from '../badge';
4
+ import { IBadgesOption } from '../badges';
3
5
  export type MemberDetailsProps = {
4
6
  /** The user's unique ID */
5
7
  id?: string;
@@ -22,6 +24,8 @@ export type MemberDetailsProps = {
22
24
  };
23
25
  /** An error, shown if the user doesn't exist */
24
26
  error?: string;
27
+ /** The user's badges */
28
+ badges?: IBadgesObject;
25
29
  };
26
30
  export type MemberProps = 'apolitical' | 'community' | 'deleted' | MemberDetailsProps;
27
31
  interface Props {
@@ -36,6 +40,8 @@ interface Props {
36
40
  createdAt?: Date | string;
37
41
  didEdit?: boolean;
38
42
  };
43
+ /** Whether to show badges and the scope of the badge */
44
+ badges?: IBadgesOption;
39
45
  /** Optional styling */
40
46
  styling?: {
41
47
  /** The size of the component */
@@ -61,7 +67,7 @@ interface Props {
61
67
  /** Additional classes */
62
68
  className?: string;
63
69
  }
64
- declare const Member: ({ element, member: memberDetails, alt, additionalContent, styling, functions, gtmContext, gtmType, className, ...props }: Props) => React.DetailedReactHTMLElement<{
70
+ declare const Member: ({ element, member: memberDetails, alt, additionalContent, styling, functions, gtmContext, gtmType, className, badges, ...props }: Props) => React.DetailedReactHTMLElement<{
65
71
  children: import("react/jsx-runtime").JSX.Element;
66
72
  /** Optional onclick function */
67
73
  onClick?: ((e: React.MouseEvent) => void) | undefined;
@@ -6,6 +6,7 @@ export declare const getMember: (member: MemberProps) => {
6
6
  organisation?: undefined;
7
7
  country?: undefined;
8
8
  url?: undefined;
9
+ badges?: undefined;
9
10
  } | {
10
11
  name: string | undefined;
11
12
  role: string;
@@ -13,6 +14,7 @@ export declare const getMember: (member: MemberProps) => {
13
14
  country: string;
14
15
  url: string;
15
16
  image: string | undefined;
17
+ badges: import("../badge").IBadgesObject | undefined;
16
18
  };
17
19
  export declare const getUserDetails: ({ role, organisation, country, maximumCharacters, }: {
18
20
  role?: string | undefined;
@@ -9,5 +9,13 @@ declare const _default: {
9
9
  image: {
10
10
  thumbnail: string;
11
11
  };
12
+ badges: {
13
+ all: {
14
+ all: string[];
15
+ };
16
+ communities: {
17
+ 'community-slug': string[];
18
+ };
19
+ };
12
20
  };
13
21
  export default _default;
@@ -1,11 +0,0 @@
1
- @use 'sass:color';
2
- @import './../colors';
3
- @import './../../../functions';
4
-
5
- $c: $default-colors;
6
- $assistant: (
7
- ai_assistant_heading_text: get-map($c, 'n900'),
8
- ai_assistant_button_text: get-map($c, 'n600'),
9
- ai_assistant_button_box_shadow: color.adjust(get-map($c, 'n800'), $alpha: -0.9),
10
- ai_assistant_border: get-map($c, 'n100'),
11
- );