@apolitical/component-library 5.5.0 → 5.5.1-bht.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.
package/package.json
CHANGED
package/user/member/index.d.ts
CHANGED
package/user/member/member.d.ts
CHANGED
|
@@ -1,81 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { IBadgesOption } from '../badges';
|
|
5
|
-
export type MemberDetailsProps = {
|
|
6
|
-
/** The user's unique ID */
|
|
7
|
-
id?: string;
|
|
8
|
-
/** The user's name */
|
|
9
|
-
name?: string;
|
|
10
|
-
/** The user's profile URL; we usually get this from the ID, but we won't if `false` is passed in */
|
|
11
|
-
link?: false | string;
|
|
12
|
-
/** The user's job title */
|
|
13
|
-
jobTitle?: string;
|
|
14
|
-
/** The organisation the user works for */
|
|
15
|
-
organization?: string;
|
|
16
|
-
/** The user's location */
|
|
17
|
-
location?: {
|
|
18
|
-
country?: string;
|
|
19
|
-
en?: string;
|
|
20
|
-
};
|
|
21
|
-
/** The user's profile picture */
|
|
22
|
-
image?: {
|
|
23
|
-
thumbnail?: string;
|
|
24
|
-
};
|
|
25
|
-
/** An error, shown if the user doesn't exist */
|
|
26
|
-
error?: string;
|
|
27
|
-
/** The user's badges */
|
|
28
|
-
badges?: IBadgesObject;
|
|
29
|
-
};
|
|
30
|
-
export type MemberProps = 'apolitical' | 'community' | 'deleted' | MemberDetailsProps;
|
|
31
|
-
interface Props {
|
|
32
|
-
/** The element to render around the content */
|
|
33
|
-
element?: 'li' | 'div';
|
|
34
|
-
/** Details about the Apolitical member */
|
|
35
|
-
member?: MemberProps;
|
|
36
|
-
/** The alt text for the image */
|
|
37
|
-
alt?: string;
|
|
38
|
-
/** Additional content to show with the member details */
|
|
39
|
-
additionalContent?: false | {
|
|
40
|
-
createdAt?: Date | string;
|
|
41
|
-
didEdit?: boolean;
|
|
42
|
-
customMessage?: string;
|
|
43
|
-
};
|
|
44
|
-
/** Whether to show badges and the scope of the badge */
|
|
45
|
-
badges?: IBadgesOption;
|
|
46
|
-
/** Optional styling */
|
|
47
|
-
styling?: {
|
|
48
|
-
/** The size of the component */
|
|
49
|
-
size?: 'medium' | 'large';
|
|
50
|
-
/** The type of component to render, e.g. with card styling */
|
|
51
|
-
variant?: 'inline' | 'card';
|
|
52
|
-
/** Whether the user details should be condensed into one line */
|
|
53
|
-
isCondensed?: boolean;
|
|
54
|
-
/** Whether to shift the additional content onto a new line after the badges. Hide the Job title + Organisation */
|
|
55
|
-
additionalContentNewLine?: boolean;
|
|
56
|
-
};
|
|
57
|
-
/** Optional functions for the wrapper */
|
|
58
|
-
functions?: {
|
|
59
|
-
/** Optional onclick function */
|
|
60
|
-
onClick?: (e: React.MouseEvent) => void;
|
|
61
|
-
/** Props for the profile modal */
|
|
62
|
-
profile?: IProfileFormProps;
|
|
63
|
-
};
|
|
64
|
-
/** The optional test ID for Jest */
|
|
65
|
-
'data-testid'?: string;
|
|
66
|
-
/** The GTM context to use */
|
|
67
|
-
gtmContext?: string;
|
|
68
|
-
/** The GTM event to use */
|
|
69
|
-
gtmType?: string;
|
|
70
|
-
/** Additional classes */
|
|
71
|
-
className?: string;
|
|
72
|
-
}
|
|
73
|
-
declare const Member: ({ element, member: memberDetails, alt, additionalContent, styling, functions, gtmContext, gtmType, className, badges, ...props }: Props) => React.DetailedReactHTMLElement<{
|
|
2
|
+
import { IMemberComponentProps } from './member.types';
|
|
3
|
+
declare const Member: ({ element, member: memberDetails, alt, additionalContent, styling, functions, gtmContext, gtmType, className, badges, ...props }: IMemberComponentProps) => React.DetailedReactHTMLElement<{
|
|
74
4
|
children: import("react/jsx-runtime").JSX.Element;
|
|
75
|
-
|
|
76
|
-
onClick?: ((e: React.MouseEvent) => void) | undefined;
|
|
5
|
+
onClick?: ((e: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
77
6
|
className: string;
|
|
78
|
-
/** The optional test ID for Jest */
|
|
79
7
|
'data-testid'?: string | undefined;
|
|
80
8
|
}, HTMLElement>;
|
|
81
9
|
export default Member;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type IProfileFormProps } from '../../form';
|
|
3
|
+
import { IBadgesObject } from '../badge';
|
|
4
|
+
import { IBadgesOption } from '../badges';
|
|
5
|
+
export type MemberDetailsProps = {
|
|
6
|
+
/** The user's unique ID */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** The user's name */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** The user's profile URL; we usually get this from the ID, but we won't if `false` is passed in */
|
|
11
|
+
link?: false | string;
|
|
12
|
+
/** The user's job title */
|
|
13
|
+
jobTitle?: string;
|
|
14
|
+
/** The organisation the user works for */
|
|
15
|
+
organization?: string;
|
|
16
|
+
/** The user's location */
|
|
17
|
+
location?: {
|
|
18
|
+
country?: string;
|
|
19
|
+
en?: string;
|
|
20
|
+
};
|
|
21
|
+
/** The user's profile picture */
|
|
22
|
+
image?: {
|
|
23
|
+
thumbnail?: string;
|
|
24
|
+
};
|
|
25
|
+
/** An error, shown if the user doesn't exist */
|
|
26
|
+
error?: string;
|
|
27
|
+
/** The user's badges */
|
|
28
|
+
badges?: IBadgesObject;
|
|
29
|
+
};
|
|
30
|
+
export type MemberProps = 'apolitical' | 'community' | 'deleted' | MemberDetailsProps;
|
|
31
|
+
export interface IMemberComponentProps {
|
|
32
|
+
/** The element to render around the content */
|
|
33
|
+
element?: 'li' | 'div';
|
|
34
|
+
/** Details about the Apolitical member */
|
|
35
|
+
member?: MemberProps;
|
|
36
|
+
/** The alt text for the image */
|
|
37
|
+
alt?: string;
|
|
38
|
+
/** Additional content to show with the member details */
|
|
39
|
+
additionalContent?: false | {
|
|
40
|
+
createdAt?: Date | string;
|
|
41
|
+
didEdit?: boolean;
|
|
42
|
+
customMessage?: string;
|
|
43
|
+
};
|
|
44
|
+
/** Whether to show badges and the scope of the badge */
|
|
45
|
+
badges?: IBadgesOption;
|
|
46
|
+
/** Optional styling */
|
|
47
|
+
styling?: {
|
|
48
|
+
/** The size of the component */
|
|
49
|
+
size?: 'medium' | 'large';
|
|
50
|
+
/** The type of component to render, e.g. with card styling */
|
|
51
|
+
variant?: 'inline' | 'card';
|
|
52
|
+
/** Whether the user details should be condensed into one line */
|
|
53
|
+
isCondensed?: boolean;
|
|
54
|
+
/** Whether to shift the additional content onto a new line after the badges. Hide the Job title + Organisation */
|
|
55
|
+
additionalContentNewLine?: boolean;
|
|
56
|
+
};
|
|
57
|
+
/** Optional functions for the wrapper */
|
|
58
|
+
functions?: {
|
|
59
|
+
/** Optional onclick function */
|
|
60
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
61
|
+
/** Props for the profile modal */
|
|
62
|
+
profile?: IProfileFormProps;
|
|
63
|
+
};
|
|
64
|
+
/** The optional test ID for Jest */
|
|
65
|
+
'data-testid'?: string;
|
|
66
|
+
/** The GTM context to use */
|
|
67
|
+
gtmContext?: string;
|
|
68
|
+
/** The GTM event to use */
|
|
69
|
+
gtmType?: string;
|
|
70
|
+
/** Additional classes */
|
|
71
|
+
className?: string;
|
|
72
|
+
}
|