@apolitical/component-library 4.8.4-SW.0 → 4.8.4
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/card-block/card-block.d.ts +2 -2
- package/cards/card-block/index.d.ts +0 -1
- package/communities/members-list/members-list.d.ts +2 -1
- package/communities/members-list/members-list.mock.d.ts +21 -0
- package/context/badges/badges.context.d.ts +13 -0
- package/context/badges/badges.hook.d.ts +1 -0
- package/context/badges/badges.provider.d.ts +8 -0
- package/context/badges/index.d.ts +4 -0
- package/context/global/global.providers.d.ts +1 -1
- package/context/index.d.ts +1 -0
- package/discussion/components/add-post/add-post.d.ts +2 -0
- package/discussion/components/form/form.d.ts +1 -1
- package/discussion/components/form/form.type.d.ts +2 -0
- package/discussion/components/post/post.d.ts +4 -1
- package/discussion/discussion.helpers.d.ts +1 -0
- package/discussion/feeds/activities-feed/mocks/activities-feed.mock.d.ts +42 -0
- package/discussion/feeds/replies-feed/mocks/replies-feed.mock.d.ts +33 -0
- package/discussion/feeds/replies-feed/nested-replies-feed/mocks/nested-replies-feed.mock.d.ts +29 -2
- package/discussion/sections/activity-section/activity-section.d.ts +2 -2
- package/discussion/sections/activity-section/index.d.ts +0 -1
- package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +5 -0
- package/discussion/shared/interfaces/user.interface.d.ts +2 -0
- package/form/components/form/index.d.ts +1 -1
- package/form/types/profile-form/profile-form.d.ts +3 -3
- package/index.js +61 -61
- package/index.mjs +7028 -6866
- package/layout/content-layout/columns/columns.d.ts +2 -2
- package/layout/content-layout/columns/index.d.ts +0 -1
- package/navigation/load-more/index.d.ts +1 -1
- package/navigation/load-more/load-more.d.ts +3 -3
- package/navigation/tabs/index.d.ts +0 -1
- package/navigation/tabs/tabs.d.ts +6 -6
- package/package.json +1 -1
- package/sections/edit-section/edit-section.d.ts +2 -2
- package/sections/edit-section/index.d.ts +0 -1
- package/style.css +1 -1
- package/styles/variables/colors/theme/_user.scss +6 -0
- package/text/empty-state-box/empty-state-box.d.ts +2 -2
- package/text/empty-state-box/index.d.ts +0 -1
- package/text/hide-show-text-box/hide-show-text-box.d.ts +2 -2
- package/text/hide-show-text-box/index.d.ts +0 -1
- package/text/highlighted-text-box/highlighted-text-box.d.ts +2 -2
- package/text/highlighted-text-box/index.d.ts +0 -1
- package/user/badge/badge.d.ts +7 -0
- package/user/badge/icon-mapping.d.ts +11 -0
- package/user/badge/index.d.ts +2 -0
- package/user/badge/interface/badge.interfaces.d.ts +9 -0
- package/user/badges/badges.d.ts +12 -0
- package/user/badges/badges.interface.d.ts +10 -0
- package/user/badges/index.d.ts +2 -0
- package/user/member/member.d.ts +7 -1
- package/user/member/member.helpers.d.ts +2 -0
- package/user/member/member.mock.d.ts +8 -0
- package/user/profile-picture/index.d.ts +0 -1
- package/user/profile-picture/profile-picture.d.ts +2 -2
|
@@ -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'),
|
|
@@ -7,7 +7,7 @@ interface ButtonType extends ButtonPropsType {
|
|
|
7
7
|
};
|
|
8
8
|
component?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface Props {
|
|
11
11
|
/** Box styling */
|
|
12
12
|
variant?: 'empty' | 'error';
|
|
13
13
|
/** Optional text */
|
|
@@ -17,5 +17,5 @@ export interface IEmptyStateBoxProps {
|
|
|
17
17
|
/** Additional classes */
|
|
18
18
|
className?: string;
|
|
19
19
|
}
|
|
20
|
-
declare const EmptyStateBox: ({ variant, text, button, className, }:
|
|
20
|
+
declare const EmptyStateBox: ({ variant, text, button, className, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export default EmptyStateBox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MarkdownToJSX } from 'markdown-to-jsx';
|
|
3
|
-
|
|
3
|
+
interface Props {
|
|
4
4
|
/** The language for the box text */
|
|
5
5
|
locale?: string;
|
|
6
6
|
/** An optional id for the box */
|
|
@@ -18,5 +18,5 @@ export interface IHideShowTextBoxProps {
|
|
|
18
18
|
markdownOptions?: MarkdownToJSX.Options;
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
}
|
|
21
|
-
declare const HideShowTextBox: ({ id, className, show, hide, text, markdownOptions, fadeStyle, children, }:
|
|
21
|
+
declare const HideShowTextBox: ({ id, className, show, hide, text, markdownOptions, fadeStyle, children, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export default HideShowTextBox;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface Props {
|
|
3
3
|
/** The style of box being rendered */
|
|
4
4
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'subtle' | 'subtle-alt' | 'bold' | 'muted';
|
|
5
5
|
/** The name of an icon file to display at the top */
|
|
@@ -18,5 +18,5 @@ export interface IHighlightedTextBoxProps {
|
|
|
18
18
|
/** Additional props to pass to the box */
|
|
19
19
|
style?: React.CSSProperties;
|
|
20
20
|
}
|
|
21
|
-
declare const HighlightedTextBoxWrapper: ({ variant, icon, styling, className, children, ...props }:
|
|
21
|
+
declare const HighlightedTextBoxWrapper: ({ variant, icon, styling, className, children, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export default HighlightedTextBoxWrapper;
|
|
@@ -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,10 @@
|
|
|
1
|
+
import { BadgeScope } from '../badge/interface/badge.interfaces';
|
|
2
|
+
export interface IBadgesOption {
|
|
3
|
+
showBadges?: boolean;
|
|
4
|
+
scope?: BadgeScope.PLATFORM | BadgeScope.COMMUNITIES;
|
|
5
|
+
area?: string;
|
|
6
|
+
scopes?: {
|
|
7
|
+
scope: BadgeScope.PLATFORM | BadgeScope.COMMUNITIES;
|
|
8
|
+
area: string;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
package/user/member/member.d.ts
CHANGED
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface Props {
|
|
2
2
|
/** The user's name, to create initials */
|
|
3
3
|
name: string;
|
|
4
4
|
/** The user's image */
|
|
@@ -16,5 +16,5 @@ export interface IProfilePictureProps {
|
|
|
16
16
|
/** Optional test ID */
|
|
17
17
|
'data-testid'?: string;
|
|
18
18
|
}
|
|
19
|
-
declare const ProfilePicture: ({ className, src, name, alt, width, height, showInitials, ...props }:
|
|
19
|
+
declare const ProfilePicture: ({ className, src, name, alt, width, height, showInitials, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export default ProfilePicture;
|