@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.
@@ -68,6 +68,8 @@ export interface CardType {
68
68
  isMember: boolean;
69
69
  count: number;
70
70
  };
71
+ /** Is the content private */
72
+ isPrivate?: boolean;
71
73
  }
72
74
  export interface MockCardType extends CardType {
73
75
  cardType?: string;
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { IMentions } from './../../discussion';
2
+ export declare const getPostBody: (body: string, isTruncated: boolean, mentions?: IMentions) => string;
@@ -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,3 +1,6 @@
1
1
  import type { EnrichedReaction } from 'getstream';
2
+ import type { IMentions } from './../../discussion.d';
2
3
  export interface IReaction extends EnrichedReaction {
4
+ /** Details of users mentioned in the content */
5
+ mentioned_users?: IMentions;
3
6
  }
@@ -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) => React.DOMElement<{
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;
@@ -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;