@apolitical/component-library 1.14.7-rc.5 → 1.14.9-beta.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/banners/banner-section/banner-section.d.ts +7 -1
- package/cards/cards.types.d.ts +2 -2
- package/cards/index.d.ts +1 -0
- package/discussion/feeds/activities-feed/activities-feed.d.ts +3 -0
- package/discussion/feeds/activities-feed/activities-feed.handlers.d.ts +32 -0
- package/discussion/feeds/replies-feed/replies-feed.d.ts +5 -2
- package/discussion/feeds/replies-feed/replies-feed.handlers.d.ts +24 -0
- package/discussion/feeds/replies-to-replies-feed/replies-to-replies-feed.d.ts +3 -0
- package/discussion/feeds/replies-to-replies-feed/replies-to-replies-feed.handlers.d.ts +27 -0
- package/discussion/sections/activity-section/activity-section.d.ts +6 -0
- package/discussion/sections/activity-section/activity-section.handlers.d.ts +14 -0
- package/general/buttons/button/button.d.ts +2 -0
- package/helpers/dates.d.ts +20 -7
- package/index.d.ts +1 -0
- package/index.js +16 -14
- package/index.mjs +2981 -2327
- package/navigation/index.d.ts +2 -1
- package/navigation/share-links/index.d.ts +1 -0
- package/navigation/share-links/share-links.d.ts +18 -0
- package/navigation/share-links/share-links.helpers.d.ts +19 -0
- package/package.json +1 -1
- package/pages/index.d.ts +1 -0
- package/pages/not-found-error/index.d.ts +1 -0
- package/pages/not-found-error/not-found-error.d.ts +2 -0
- package/pages/not-found-error/not-found-error.data.d.ts +2 -0
- package/style.css +1 -1
- package/styles/base/buttons/_icons.scss +5 -0
- package/styles/variables/colors/_theme.scss +6 -0
- package/testing/helpers.d.ts +1 -0
|
@@ -27,6 +27,12 @@ export interface BannerSectionType {
|
|
|
27
27
|
variant?: 'default' | 'light';
|
|
28
28
|
/** How to handle spacing on the banner */
|
|
29
29
|
spacing?: 'normal' | 'slim';
|
|
30
|
+
/** Whether or not to show the ContentType.text, eyebrow or title */
|
|
31
|
+
hideElements?: {
|
|
32
|
+
eyebrow?: boolean;
|
|
33
|
+
title?: boolean;
|
|
34
|
+
text?: boolean;
|
|
35
|
+
};
|
|
30
36
|
/** The CTA to display */
|
|
31
37
|
cta?: {
|
|
32
38
|
text: string;
|
|
@@ -38,5 +44,5 @@ export interface BannerSectionType {
|
|
|
38
44
|
/** Any additional children */
|
|
39
45
|
children?: React.ReactNode;
|
|
40
46
|
}
|
|
41
|
-
declare const _default: React.MemoExoticComponent<({ className, content: contentProp, image, variant, spacing, cta, children, }: BannerSectionType) => import("react/jsx-runtime").JSX.Element>;
|
|
47
|
+
declare const _default: React.MemoExoticComponent<({ className, content: contentProp, image, variant, spacing, hideElements, cta, children, }: BannerSectionType) => import("react/jsx-runtime").JSX.Element>;
|
|
42
48
|
export default _default;
|
package/cards/cards.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ResponsiveImageType } from '../general';
|
|
2
|
-
import {
|
|
2
|
+
import { MemberProps } from '../user';
|
|
3
3
|
export type CardContentType = 'custom' | 'event' | 'learningHub' | 'listPage' | 'microcourse' | 'people' | 'qaQuestion' | 'solutionArticle';
|
|
4
4
|
export type CustomIconType = 'calendar' | 'cube' | 'document' | 'download' | 'globe' | 'graduationCap' | 'link' | 'person' | 'star' | 'speech';
|
|
5
5
|
export interface CardCTAType {
|
|
@@ -23,7 +23,7 @@ export interface CardType {
|
|
|
23
23
|
/** The image to use */
|
|
24
24
|
banner?: ResponsiveImageType;
|
|
25
25
|
/** Details of contributors, such as speakers or authors */
|
|
26
|
-
contributors?:
|
|
26
|
+
contributors?: MemberProps[];
|
|
27
27
|
/** Details of partners - this is similar to `contributors`, but won't show profile pictures */
|
|
28
28
|
partner?: {
|
|
29
29
|
title: string;
|
package/cards/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QueryClient, QueryKey } from '@tanstack/query-core';
|
|
2
2
|
import { IUserContext } from '../../..';
|
|
3
|
+
import { IActivity } from '../../getstream';
|
|
3
4
|
export interface buildAddActivityHandlersProps {
|
|
4
5
|
queryClient: QueryClient;
|
|
5
6
|
queryKey: QueryKey;
|
|
@@ -19,6 +20,37 @@ export interface buildEditActivityHandlersProps {
|
|
|
19
20
|
}) => Promise<void>;
|
|
20
21
|
}
|
|
21
22
|
export declare const buildEditActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildEditActivityHandlersProps) => object;
|
|
23
|
+
interface buildRemoveActivityHandlersProps {
|
|
24
|
+
queryClient: QueryClient;
|
|
25
|
+
queryKey: QueryKey;
|
|
26
|
+
mutationFn: ({ activityId }: {
|
|
27
|
+
activityId: string;
|
|
28
|
+
}) => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export declare const buildRemoveActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildRemoveActivityHandlersProps) => {
|
|
31
|
+
mutationFn: ({ activityId }: {
|
|
32
|
+
activityId: string;
|
|
33
|
+
}) => Promise<void>;
|
|
34
|
+
onMutate: ({ activityId }: {
|
|
35
|
+
activityId: string;
|
|
36
|
+
}) => Promise<{
|
|
37
|
+
previousActivities: IActivity[] | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
onError: (_err: {
|
|
40
|
+
[key: string]: string;
|
|
41
|
+
}, _newActivity: {
|
|
42
|
+
activityId: string;
|
|
43
|
+
}, context: {
|
|
44
|
+
previousActivities: IActivity[];
|
|
45
|
+
}) => void;
|
|
46
|
+
onSettled: (_newActivity: {
|
|
47
|
+
activityId: string;
|
|
48
|
+
}, _error: {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
}, variables: {
|
|
51
|
+
activityId: string;
|
|
52
|
+
}) => void;
|
|
53
|
+
};
|
|
22
54
|
interface buildLikeActivityHandlersProps {
|
|
23
55
|
queryClient: QueryClient;
|
|
24
56
|
queryKey: QueryKey;
|
|
@@ -7,18 +7,21 @@ interface Props {
|
|
|
7
7
|
repliesList: IReply[] | undefined;
|
|
8
8
|
isMember: boolean;
|
|
9
9
|
functions: {
|
|
10
|
-
|
|
10
|
+
create: ({ activityId, replyId, content, }: {
|
|
11
11
|
activityId?: string;
|
|
12
12
|
replyId?: string;
|
|
13
13
|
content: string;
|
|
14
14
|
}) => Promise<void>;
|
|
15
|
-
|
|
15
|
+
edit: ({ parentId, replyId, content, }: {
|
|
16
16
|
parentId: string;
|
|
17
17
|
replyId: string;
|
|
18
18
|
content: {
|
|
19
19
|
body: string;
|
|
20
20
|
};
|
|
21
21
|
}) => Promise<void>;
|
|
22
|
+
remove: ({ replyId }: {
|
|
23
|
+
replyId: string;
|
|
24
|
+
}) => Promise<void>;
|
|
22
25
|
like: ({ replyId, replyParentId, }: {
|
|
23
26
|
replyId: string;
|
|
24
27
|
replyParentId?: string;
|
|
@@ -63,6 +63,30 @@ export declare const buildEditReplyHanders: ({ queryClient, queryKey, mutationFn
|
|
|
63
63
|
previousActivity: IActivity;
|
|
64
64
|
}) => void;
|
|
65
65
|
};
|
|
66
|
+
interface buildRemoveReplyHandlersProps {
|
|
67
|
+
queryClient: QueryClient;
|
|
68
|
+
queryKey: QueryKey;
|
|
69
|
+
mutationFn: ({ replyId }: {
|
|
70
|
+
replyId: string;
|
|
71
|
+
}) => Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
export declare const buildRemoveReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildRemoveReplyHandlersProps) => {
|
|
74
|
+
mutationFn: ({ replyId }: {
|
|
75
|
+
replyId: string;
|
|
76
|
+
}) => Promise<void>;
|
|
77
|
+
onMutate: ({ replyId }: {
|
|
78
|
+
replyId: string;
|
|
79
|
+
}) => Promise<{
|
|
80
|
+
previousActivity: IActivity;
|
|
81
|
+
} | undefined>;
|
|
82
|
+
onError: (_err: {
|
|
83
|
+
[key: string]: string;
|
|
84
|
+
}, _newActivity: {
|
|
85
|
+
activityId: string;
|
|
86
|
+
}, context: {
|
|
87
|
+
previousActivity: IActivity;
|
|
88
|
+
}) => void;
|
|
89
|
+
};
|
|
66
90
|
interface buildLikeReplyHandlersProps {
|
|
67
91
|
queryClient: QueryClient;
|
|
68
92
|
queryKey: QueryKey;
|
|
@@ -64,6 +64,33 @@ export declare const buildEditReplyToReplyHanders: ({ queryClient, queryKey, mut
|
|
|
64
64
|
previousActivity: IActivity;
|
|
65
65
|
} | undefined>;
|
|
66
66
|
};
|
|
67
|
+
interface buildRemoveReplyToReplyHandlersProps {
|
|
68
|
+
queryClient: QueryClient;
|
|
69
|
+
queryKey: QueryKey;
|
|
70
|
+
mutationFn: ({ replyId, replyParentId, }: {
|
|
71
|
+
replyId: string;
|
|
72
|
+
replyParentId?: string;
|
|
73
|
+
}) => Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
export declare const buildRemoveReplyToReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildRemoveReplyToReplyHandlersProps) => {
|
|
76
|
+
mutationFn: ({ replyId, replyParentId, }: {
|
|
77
|
+
replyId: string;
|
|
78
|
+
replyParentId?: string | undefined;
|
|
79
|
+
}) => Promise<void>;
|
|
80
|
+
onError: (_err: {
|
|
81
|
+
[key: string]: string;
|
|
82
|
+
}, _changedActivity: {
|
|
83
|
+
activityId: string;
|
|
84
|
+
}, context: {
|
|
85
|
+
previousActivity: IActivity;
|
|
86
|
+
}) => void;
|
|
87
|
+
onMutate: ({ replyId, replyParentId, }: {
|
|
88
|
+
replyId: string;
|
|
89
|
+
replyParentId: string;
|
|
90
|
+
}) => Promise<{
|
|
91
|
+
previousActivity: IActivity;
|
|
92
|
+
} | undefined>;
|
|
93
|
+
};
|
|
67
94
|
interface buildLikeReplyHandlersProps {
|
|
68
95
|
queryClient: QueryClient;
|
|
69
96
|
queryKey: QueryKey;
|
|
@@ -15,6 +15,9 @@ interface Props {
|
|
|
15
15
|
body: string;
|
|
16
16
|
};
|
|
17
17
|
}) => Promise<void>;
|
|
18
|
+
removeActivity: ({ activityId }: {
|
|
19
|
+
activityId: string;
|
|
20
|
+
}) => Promise<void>;
|
|
18
21
|
likeActivity: ({ activityId }: {
|
|
19
22
|
activityId: string;
|
|
20
23
|
}) => Promise<void>;
|
|
@@ -38,6 +41,9 @@ interface Props {
|
|
|
38
41
|
body: string;
|
|
39
42
|
};
|
|
40
43
|
}) => Promise<void>;
|
|
44
|
+
removeReply: ({ replyId }: {
|
|
45
|
+
replyId: string;
|
|
46
|
+
}) => Promise<void>;
|
|
41
47
|
};
|
|
42
48
|
}
|
|
43
49
|
declare const ActivitySection: React.FC<Props>;
|
|
@@ -13,6 +13,20 @@ interface buildEditActivityHandlersProps {
|
|
|
13
13
|
}) => Promise<void>;
|
|
14
14
|
}
|
|
15
15
|
export declare const buildEditActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildEditActivityHandlersProps) => object;
|
|
16
|
+
interface buildRemoveActivityHandlersProps {
|
|
17
|
+
queryClient: QueryClient;
|
|
18
|
+
queryKey: QueryKey;
|
|
19
|
+
redirectUrl: string;
|
|
20
|
+
mutationFn: ({ activityId }: {
|
|
21
|
+
activityId: string;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export declare const buildRemoveActivityHandlers: ({ queryClient, queryKey, redirectUrl, mutationFn, }: buildRemoveActivityHandlersProps) => {
|
|
25
|
+
mutationFn: ({ activityId }: {
|
|
26
|
+
activityId: string;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
onSuccess: () => void;
|
|
29
|
+
};
|
|
16
30
|
interface buildLikeActivityHandlersProps {
|
|
17
31
|
queryClient: QueryClient;
|
|
18
32
|
queryKey: QueryKey;
|
|
@@ -45,6 +45,8 @@ export interface ButtonPropsType {
|
|
|
45
45
|
children?: false | string | React.ReactNode;
|
|
46
46
|
/** The target, for links */
|
|
47
47
|
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
48
|
+
/** The rel, for links */
|
|
49
|
+
rel?: string;
|
|
48
50
|
/** The GTM event type */
|
|
49
51
|
'data-gtm-event-type'?: string;
|
|
50
52
|
/** The GTM event context */
|
package/helpers/dates.d.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
export type DateType = Date | string;
|
|
2
|
+
interface IGetDateWithDelta {
|
|
3
|
+
(delta: {
|
|
4
|
+
minute?: number;
|
|
5
|
+
hour?: number;
|
|
6
|
+
day?: number;
|
|
7
|
+
week?: number;
|
|
8
|
+
month?: number;
|
|
9
|
+
year?: number;
|
|
10
|
+
}, baseDate?: Date): Date;
|
|
11
|
+
}
|
|
12
|
+
interface IGetShortDateHowLongAgo {
|
|
13
|
+
(dateInPast: Date | string): {
|
|
14
|
+
path: string;
|
|
15
|
+
number?: number | undefined;
|
|
16
|
+
} | '';
|
|
17
|
+
}
|
|
2
18
|
export declare const getMonth: (date: DateType, locale?: string) => string;
|
|
3
19
|
export declare const getNumericDay: (date: DateType, locale?: string) => string;
|
|
4
20
|
export declare const getShortDate: (date: DateType, locale?: string) => string;
|
|
5
21
|
export declare const getDateWithYear: (date: DateType, locale?: string) => string;
|
|
6
22
|
export declare const getLongDate: (date: DateType, locale?: string) => string;
|
|
7
|
-
export declare const getShortDateHowLongAgo:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
path: string;
|
|
12
|
-
number: number;
|
|
13
|
-
};
|
|
23
|
+
export declare const getShortDateHowLongAgo: IGetShortDateHowLongAgo;
|
|
24
|
+
export declare const getDateWithDelta: IGetDateWithDelta;
|
|
25
|
+
export declare const dateToUTC: (date?: Date) => Date;
|
|
26
|
+
export {};
|