@apolitical/component-library 4.1.6 → 4.1.8-beta.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/cards.types.d.ts +2 -0
- package/communities/community-details/community-details.d.ts +3 -1
- package/communities/join-button/join-button.d.ts +5 -1
- package/discussion/components/post/post.helpers.d.ts +2 -0
- package/discussion/discussion.mock.d.ts +24 -0
- package/discussion/shared/interfaces/reaction.interface.d.ts +3 -0
- package/general/buttons/button/button.d.ts +3 -4
- package/helpers/dates.d.ts +1 -0
- package/helpers/intl.d.ts +2 -0
- package/index.js +37 -37
- package/index.mjs +5086 -5031
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/variables/colors/theme/_text.scss +1 -0
- package/text/content-type-label/content-type-label.types.d.ts +1 -1
- package/text/pill/pill.d.ts +5 -3
package/cards/cards.types.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { IJoinButtonProps } from './../join-button';
|
|
|
3
3
|
interface Props extends IJoinButtonProps {
|
|
4
4
|
/** If the user is a member of the community */
|
|
5
5
|
isMember?: boolean;
|
|
6
|
+
/** If the community is open */
|
|
7
|
+
isOpen?: boolean;
|
|
6
8
|
/** The slug for the community */
|
|
7
9
|
slug: string;
|
|
8
10
|
/** Details about members in the community */
|
|
@@ -19,5 +21,5 @@ interface Props extends IJoinButtonProps {
|
|
|
19
21
|
/** Additional classes */
|
|
20
22
|
className?: string;
|
|
21
23
|
}
|
|
22
|
-
declare const CommunityDetails: ({ className, isMember, slug, members: { number: membersCount, data: membersData }, functions: { invite, ...membershipFunctions }, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const CommunityDetails: ({ className, isMember, isOpen, slug, members: { number: membersCount, data: membersData }, functions: { invite, ...membershipFunctions }, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
export default CommunityDetails;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export interface IJoinButtonProps {
|
|
2
2
|
/** If the user is a member of the community */
|
|
3
3
|
isMember?: boolean;
|
|
4
|
+
/** If the community is open */
|
|
5
|
+
isOpen?: boolean;
|
|
4
6
|
/** If the button should use the short version of the text */
|
|
5
7
|
isShort?: boolean;
|
|
8
|
+
/** If the button is disabled */
|
|
9
|
+
disabled?: boolean;
|
|
6
10
|
/** The function to call when the user clicks the button */
|
|
7
11
|
functions?: {
|
|
8
12
|
/** The function to request to join */
|
|
@@ -13,5 +17,5 @@ export interface IJoinButtonProps {
|
|
|
13
17
|
/** The language to use */
|
|
14
18
|
locale?: string;
|
|
15
19
|
}
|
|
16
|
-
declare const JoinButton: ({ isMember: userIsMember, isShort, functions: { join, leave }, }: IJoinButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const JoinButton: ({ isMember: userIsMember, isOpen, isShort, disabled, functions: { join, leave }, }: IJoinButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
export default JoinButton;
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
export const mentions: {
|
|
2
|
+
"123456ab-12ab-12ab-12ab-123456789abc": {
|
|
3
|
+
created_at: string;
|
|
4
|
+
updated_at: string;
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
jobTitle: string;
|
|
8
|
+
name: string;
|
|
9
|
+
organization: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
"12abcdef-12cd-12cd-12cd-123456abcdef": {
|
|
13
|
+
created_at: string;
|
|
14
|
+
updated_at: string;
|
|
15
|
+
id: string;
|
|
16
|
+
data: {
|
|
17
|
+
jobTitle: string;
|
|
18
|
+
name: string;
|
|
19
|
+
organization: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
1
23
|
export namespace authors {
|
|
2
24
|
namespace me {
|
|
3
25
|
let id: string;
|
|
@@ -31,6 +53,7 @@ export namespace reply {
|
|
|
31
53
|
import author = authors.me;
|
|
32
54
|
export { author };
|
|
33
55
|
export let userLiked: boolean;
|
|
56
|
+
export { mentions };
|
|
34
57
|
}
|
|
35
58
|
export { me_1 as me };
|
|
36
59
|
export namespace otherUser_1 {
|
|
@@ -92,6 +115,7 @@ export namespace answer {
|
|
|
92
115
|
export { createdAt_2 as createdAt };
|
|
93
116
|
let updatedAt_2: string;
|
|
94
117
|
export { updatedAt_2 as updatedAt };
|
|
118
|
+
export { mentions };
|
|
95
119
|
}
|
|
96
120
|
export { me_2 as me };
|
|
97
121
|
export namespace otherUser_2 {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import addClasses from 'classnames';
|
|
3
2
|
export type ButtonIconType = false | string | {
|
|
4
3
|
icon: string;
|
|
5
4
|
position?: 'left' | 'right';
|
|
@@ -42,6 +41,8 @@ export interface ButtonPropsType {
|
|
|
42
41
|
disabled?: boolean | {
|
|
43
42
|
isClickable: boolean;
|
|
44
43
|
};
|
|
44
|
+
/** An optional tooltip for the button. This will only apply when disabled is true */
|
|
45
|
+
tooltip?: string;
|
|
45
46
|
/** This is an optional way to pass in text which is only for screen readers
|
|
46
47
|
* It's rendered on the page (so the page is still functional without CSS, unlike ARIA labels) but hidden
|
|
47
48
|
* with CSS, for cases where the whole button should be an icon
|
|
@@ -66,7 +67,5 @@ export interface ButtonPropsType {
|
|
|
66
67
|
/** The test ID for Jest tests */
|
|
67
68
|
'data-testid'?: string;
|
|
68
69
|
}
|
|
69
|
-
declare const Button: ({ variant, size, styling, icon, href, element, onClick, className, disabled, screenreaderText, children, ...rest }: ButtonPropsType) =>
|
|
70
|
-
[key: string]: string | boolean | addClasses.ArgumentArray | (() => void) | ((e: React.KeyboardEvent<HTMLElement>) => void) | ((e: React.MouseEvent<HTMLElement>) => void) | React.RefObject<HTMLButtonElement>;
|
|
71
|
-
}, Element>;
|
|
70
|
+
declare const Button: ({ variant, size, styling, icon, href, element, onClick, className, disabled, tooltip, screenreaderText, children, ...rest }: ButtonPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
72
71
|
export default Button;
|
package/helpers/dates.d.ts
CHANGED
|
@@ -25,4 +25,5 @@ export declare const getShortDateHowLongAgo: IGetShortDateHowLongAgo;
|
|
|
25
25
|
export declare const getDateWithDelta: IGetDateWithDelta;
|
|
26
26
|
export declare const dateToUTC: (date?: Date) => Date;
|
|
27
27
|
export declare const dateWithin: (dateInPast: DateType, number: number, unit: 'seconds' | 'minutes' | 'hours') => boolean;
|
|
28
|
+
export declare const isDateWithinXDays: (dateInPast: DateType, days: number) => boolean;
|
|
28
29
|
export {};
|
package/helpers/intl.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
15
15
|
card_label_solutionArticle: string;
|
|
16
16
|
card_bootcamp: string;
|
|
17
17
|
card_ended: string;
|
|
18
|
+
card_new: string;
|
|
18
19
|
card_registered: string;
|
|
19
20
|
card_partner: string;
|
|
20
21
|
card_contributors_event: string;
|
|
@@ -51,6 +52,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
51
52
|
joinCommunityButton_member_aria: string;
|
|
52
53
|
joinCommunityButton_leave: string;
|
|
53
54
|
joinCommunityButton_leaving: string;
|
|
55
|
+
joinCommunityButton_closed_tooltip: string;
|
|
54
56
|
member_apolitical: string;
|
|
55
57
|
member_community: string;
|
|
56
58
|
membersList: string;
|