@apolitical/component-library 4.6.3-beta.1 → 4.7.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/cards/card/card.d.ts +2 -2
- package/cards/card/card.data.d.ts +6 -0
- package/cards/card/components/index.d.ts +1 -0
- package/cards/card/components/members/index.d.ts +1 -0
- package/cards/card/components/members/members.d.ts +3 -0
- package/cards/card/components/members/members.interface.d.ts +14 -0
- package/cards/cards.types.d.ts +3 -0
- package/form/types/profile-form/profile-form.d.ts +1 -1
- package/index.js +39 -39
- package/index.mjs +1327 -1320
- package/package.json +1 -1
- package/style.css +1 -1
- package/testing/index.d.ts +1 -0
package/cards/card/card.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CardProps } from './../cards.types';
|
|
2
|
-
declare const Card: ({ id,
|
|
1
|
+
import type { CardProps } from './../cards.types';
|
|
2
|
+
declare const Card: ({ id, className, buildCardData, buildMemberData, card, cta, gtmContext, handleCardClick, setFocus, }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Card;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Members } from './members';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BuildMemberDataType } from '../../../cards.types';
|
|
2
|
+
export interface Props {
|
|
3
|
+
buildMemberData: BuildMemberDataType;
|
|
4
|
+
communitySlug: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IMemberData {
|
|
7
|
+
role?: string;
|
|
8
|
+
membersCount: number;
|
|
9
|
+
}
|
|
10
|
+
export type MemberType = {
|
|
11
|
+
count: string;
|
|
12
|
+
isMember: boolean;
|
|
13
|
+
memberType: string;
|
|
14
|
+
};
|
package/cards/cards.types.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export interface MockCardType extends CardType {
|
|
|
75
75
|
cardType?: string;
|
|
76
76
|
}
|
|
77
77
|
export type BuildCardDataType = (card: CardType | MockCardType, isLoggedIn?: boolean) => Promise<any>;
|
|
78
|
+
export type BuildMemberDataType = (communitySlug: string, userId?: string) => Promise<unknown>;
|
|
78
79
|
export interface CardProps {
|
|
79
80
|
/** A unique key for the card, used as a dependency in `useEffect` */
|
|
80
81
|
id?: string;
|
|
@@ -82,6 +83,8 @@ export interface CardProps {
|
|
|
82
83
|
card: CardType;
|
|
83
84
|
/** A function to parse and build the card data - this is especially needed in carousels to hydrate the cards */
|
|
84
85
|
buildCardData: BuildCardDataType;
|
|
86
|
+
/** A function to parse and build the member data */
|
|
87
|
+
buildMemberData?: BuildMemberDataType;
|
|
85
88
|
/** An optional call to action to show on the card - this can behave differently to clicking elsewhere on the card */
|
|
86
89
|
cta?: CardCTAType;
|
|
87
90
|
/** Context for the Google Tag Manager event */
|
|
@@ -16,7 +16,7 @@ export interface IProfileFormProps {
|
|
|
16
16
|
/** The functions to call */
|
|
17
17
|
functions: {
|
|
18
18
|
/** The function to upload the user's profile image */
|
|
19
|
-
uploadImage: () =>
|
|
19
|
+
uploadImage: () => void;
|
|
20
20
|
/** The function to call on success */
|
|
21
21
|
onSuccess?: (data: IFormValues) => Promise<void>;
|
|
22
22
|
/** The function to call when the form is cancelled, e.g. the user presses a cancel button */
|