@apolitical/component-library 5.0.0 → 5.0.1-jc.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.
Files changed (36) hide show
  1. package/cards/card-block/card-block.d.ts +2 -2
  2. package/cards/card-block/index.d.ts +1 -0
  3. package/discussion/components/likes/likes-modal-spec.d.ts +0 -0
  4. package/discussion/components/likes/likes-modal.d.ts +25 -0
  5. package/discussion/sections/activity-section/activity-section.d.ts +2 -2
  6. package/discussion/sections/activity-section/index.d.ts +1 -0
  7. package/form/components/form/index.d.ts +1 -1
  8. package/form/types/profile-form/profile-form.d.ts +3 -3
  9. package/general/link/link.d.ts +2 -2
  10. package/general/tooltip/index.d.ts +1 -0
  11. package/general/tooltip/tooltip-linkset.hook.d.ts +1 -0
  12. package/general/tooltip/tooltip.d.ts +7 -2
  13. package/helpers/intl.d.ts +7 -3
  14. package/index.js +37 -37
  15. package/index.mjs +5383 -5213
  16. package/layout/content-layout/columns/columns.d.ts +2 -2
  17. package/layout/content-layout/columns/index.d.ts +1 -0
  18. package/navigation/load-more/index.d.ts +1 -1
  19. package/navigation/load-more/load-more.d.ts +3 -3
  20. package/navigation/tabs/index.d.ts +1 -0
  21. package/navigation/tabs/tabs.d.ts +6 -6
  22. package/package.json +1 -1
  23. package/sections/edit-section/edit-section.d.ts +2 -2
  24. package/sections/edit-section/index.d.ts +1 -0
  25. package/style.css +1 -1
  26. package/styles/variables/colors/theme/_base.scss +1 -0
  27. package/styles/variables/colors/theme/_general.scss +1 -0
  28. package/text/empty-state-box/empty-state-box.d.ts +2 -2
  29. package/text/empty-state-box/index.d.ts +1 -0
  30. package/text/helper-text-box/helper-text-box.d.ts +2 -0
  31. package/text/hide-show-text-box/hide-show-text-box.d.ts +2 -2
  32. package/text/hide-show-text-box/index.d.ts +1 -0
  33. package/text/highlighted-text-box/highlighted-text-box.d.ts +2 -2
  34. package/text/highlighted-text-box/index.d.ts +1 -0
  35. package/user/profile-picture/index.d.ts +1 -0
  36. package/user/profile-picture/profile-picture.d.ts +2 -2
@@ -1,5 +1,5 @@
1
1
  import { CardType, CardContentType, BuildCardDataType } from '../../cards/cards.types';
2
- interface Props {
2
+ export interface ICardBlockProps {
3
3
  /** The card data, from Contentful */
4
4
  cards: CardType[];
5
5
  /** The types for each card, from Contentful */
@@ -12,5 +12,5 @@ interface Props {
12
12
  className?: string;
13
13
  focusCardIndex?: number;
14
14
  }
15
- declare const CardBlock: ({ cards, cardTypes, className, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ declare const CardBlock: ({ cards, cardTypes, className, ...props }: ICardBlockProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export default CardBlock;
@@ -1 +1,2 @@
1
+ export type { ICardBlockProps } from './card-block';
1
2
  export { default as CardBlock } from './card-block';
@@ -0,0 +1,25 @@
1
+ import { MemberProps } from '../../../user';
2
+ import { IBadgesOption } from '../../../user/badges';
3
+ export interface ILikesModalProps {
4
+ /** Whether the modal is open on page load */
5
+ showModal?: boolean;
6
+ /** The number of likes */
7
+ likes?: number;
8
+ /** Information about the people who have liked the content */
9
+ peopleWhoLiked?: false | MemberProps[];
10
+ /** The ID of the post to show likes for */
11
+ postId?: string;
12
+ /** Whether to show badges and the scope of the badge */
13
+ badges?: IBadgesOption;
14
+ /** The ID of the comment to show likes for */
15
+ commentId?: string;
16
+ /** Functions used inside the modal */
17
+ functions: {
18
+ /** Function to call when the modal is closed */
19
+ onClose?: () => void;
20
+ };
21
+ /** Additional classes */
22
+ className?: string;
23
+ }
24
+ declare const LikesModal: ({ showModal, functions: modalFunctions, peopleWhoLiked, badges, likes, className, }: ILikesModalProps) => import("react/jsx-runtime").JSX.Element;
25
+ export default LikesModal;
@@ -6,7 +6,7 @@ import { type IQueryFns } from './cache';
6
6
  interface IActivitySectionQueryFns extends IQueryFns {
7
7
  remove: () => Promise<void>;
8
8
  }
9
- interface Props {
9
+ export interface IActivitySectionProps {
10
10
  basePath: string;
11
11
  parentId: string;
12
12
  activityId: string;
@@ -21,5 +21,5 @@ interface Props {
21
21
  };
22
22
  profile: IProfileFormProps;
23
23
  }
24
- declare const ActivitySection: React.FC<Props>;
24
+ declare const ActivitySection: React.FC<IActivitySectionProps>;
25
25
  export default ActivitySection;
@@ -1 +1,2 @@
1
+ export type { IActivitySectionProps } from './activity-section';
1
2
  export { default as ActivitySection } from './activity-section';
@@ -1,2 +1,2 @@
1
1
  export { default as Form } from './form';
2
- export type { IField, FormValues, IFormMeta } from './form.types';
2
+ export type { IField, FormValues, IFormMeta, IFormProps } from './form.types';
@@ -1,5 +1,5 @@
1
1
  import type { IFormValues, IFormMeta } from './../../components/form/form.types';
2
- export interface IProfileFormProps {
2
+ export interface IProfileFormProps<OnSuccessArgs = IFormValues> {
3
3
  /** The hooks used in the form */
4
4
  hooks: {
5
5
  /** The hook to predict the user's location */
@@ -16,9 +16,9 @@ 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: () => Promise<void>;
19
+ uploadImage: () => Promise<unknown>;
20
20
  /** The function to call on success */
21
- onSuccess?: (data: IFormValues) => Promise<void>;
21
+ onSuccess?: (data: OnSuccessArgs) => Promise<void>;
22
22
  /** The function to call when the form is cancelled, e.g. the user presses a cancel button */
23
23
  onCancel?: () => void;
24
24
  /** The function to call on failure */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- interface Props {
2
+ export interface ILinkProps {
3
3
  /** URL for link */
4
4
  href?: string | undefined;
5
5
  /** Content to rendered */
@@ -33,5 +33,5 @@ interface Props {
33
33
  /** Data attributes for the link */
34
34
  'data-before'?: string;
35
35
  }
36
- declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
36
+ declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: ILinkProps) => import("react/jsx-runtime").JSX.Element;
37
37
  export default Link;
@@ -1 +1,2 @@
1
1
  export { default as Tooltip } from './tooltip';
2
+ export * from './tooltip-linkset.hook';
@@ -0,0 +1 @@
1
+ export declare function useTooltipLinkset(setTooltipLink: (index: number) => void): (e: React.KeyboardEvent<HTMLElement> | undefined) => void;
@@ -28,8 +28,13 @@ interface Props {
28
28
  /** The callback to fire when the tooltip is closed */
29
29
  onClose?: () => void;
30
30
  };
31
- /** Whether the tooltip is hidden from screen readers or not */
32
- 'aria-hidden'?: boolean;
31
+ /** Optional props for accessibility */
32
+ accessibility?: {
33
+ /** Whether this should use `hidden` on content, or if screenreaders should be able to access the full text, even when the tooltip is closed, e.g. for tooltips on buttons and pills */
34
+ readToScreenreadersWhenClosed?: boolean;
35
+ /** Whether the tooltip is hidden from screen readers or not */
36
+ 'aria-hidden'?: boolean;
37
+ };
33
38
  /** The id of the tooltip */
34
39
  id?: string;
35
40
  }
package/helpers/intl.d.ts CHANGED
@@ -38,9 +38,12 @@ export declare const checkIntlPathExists: (path: string, language?: {
38
38
  card_cta_event_done: string;
39
39
  card_cta_microcourse_done: string;
40
40
  carousel_pagination_previous: string;
41
+ carousel_pagination_previousSlide: string;
41
42
  carousel_pagination_next: string;
42
- carousel_pagination_page: string;
43
- carousel_pagination_aria_live: string;
43
+ carousel_pagination_nextSlide: string;
44
+ carousel_pagination_slide: string;
45
+ carousel_pagination_ariaLive: string;
46
+ carousel_pagination_ariaLive_slide: string;
44
47
  activitySection_notFoundError: string;
45
48
  activitiesFeed_sorting_label: string;
46
49
  activitiesFeed_rankingMethod_recent: string;
@@ -50,6 +53,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
50
53
  communityDetails_viewAll: string;
51
54
  communityDetails_invite: string;
52
55
  community_joinToPost: string;
56
+ community_sortSuccess: string;
53
57
  joinCommunityButton: string;
54
58
  joinCommunityButton_short: string;
55
59
  joinCommunityButton_joining: string;
@@ -150,7 +154,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
150
154
  discussion_form_explainer_question: string;
151
155
  discussion_likes: string;
152
156
  discussion_likes_short: string;
153
- discussion_likes_more: string;
157
+ discussion_likes_showAll: string;
154
158
  discussion_likes_like: string;
155
159
  discussion_likes_unlike: string;
156
160
  discussion_likes_show: string;