@apolitical/component-library 4.1.6 → 4.1.7

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;
@@ -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;