@apolitical/component-library 6.0.1 → 6.0.2

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 (26) hide show
  1. package/discussion/components/index.d.ts +0 -1
  2. package/discussion/components/post/post.d.ts +1 -1
  3. package/index.js +59 -59
  4. package/index.mjs +22499 -22377
  5. package/navigation/action-bar/action-bar.d.ts +80 -0
  6. package/navigation/action-bar/components/button/button.d.ts +6 -0
  7. package/navigation/action-bar/components/button/index.d.ts +1 -0
  8. package/navigation/action-bar/components/index.d.ts +3 -0
  9. package/{discussion → navigation/action-bar}/components/likes/components/likes-modal/likes-modal.d.ts +1 -1
  10. package/{discussion → navigation/action-bar}/components/likes/index.d.ts +2 -1
  11. package/{discussion → navigation/action-bar}/components/likes/likes.d.ts +3 -3
  12. package/{discussion → navigation/action-bar}/components/likes/likes.helpers.d.ts +1 -1
  13. package/{discussion → navigation/action-bar}/components/likes/likes.mock.d.ts +1 -1
  14. package/navigation/action-bar/index.d.ts +2 -0
  15. package/navigation/index.d.ts +1 -0
  16. package/package.json +1 -1
  17. package/style.css +1 -1
  18. package/discussion/components/button/button.d.ts +0 -6
  19. package/discussion/components/button/index.d.ts +0 -1
  20. /package/{discussion → navigation/action-bar}/components/likes/components/index.d.ts +0 -0
  21. /package/{discussion → navigation/action-bar}/components/likes/components/likes-modal/index.d.ts +0 -0
  22. /package/{discussion → navigation/action-bar}/components/likes/mocks/index.d.ts +0 -0
  23. /package/{discussion → navigation/action-bar}/components/likes/mocks/likes-response.mock.d.ts +0 -0
  24. /package/{discussion → navigation/action-bar}/components/likes/tooltip.hook.d.ts +0 -0
  25. /package/{discussion/components/post → navigation/action-bar}/components/share-link/index.d.ts +0 -0
  26. /package/{discussion/components/post → navigation/action-bar}/components/share-link/share-link.d.ts +0 -0
@@ -0,0 +1,80 @@
1
+ /// <reference types="react" />
2
+ import { type IMoreMenuOptions } from '../../navigation';
3
+ import { DiscussionListLikesFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, type IDiscussionContentType } from '../../discussion/discussion';
4
+ import { MemberProps } from '../../user';
5
+ interface Props {
6
+ /** Additional classes */
7
+ className?: string;
8
+ /** The GTM context */
9
+ gtmContext?: string;
10
+ /** The content type */
11
+ contentType?: IDiscussionContentType;
12
+ /** Props for the likes button */
13
+ likes: false | {
14
+ /** The number of likes on the post */
15
+ count: number;
16
+ /** Whether the user has liked the post */
17
+ userLiked: boolean;
18
+ /** Whether the user can like the post */
19
+ canLike: boolean;
20
+ /** The people who have liked the post */
21
+ peopleWhoLiked?: false | MemberProps[] | undefined;
22
+ /** The ID of the activity */
23
+ activityId: string;
24
+ content: {
25
+ /** The slugs for the content */
26
+ slugs: {
27
+ question?: string;
28
+ answer?: string;
29
+ reply?: string;
30
+ };
31
+ /** The content slug */
32
+ slug: string;
33
+ };
34
+ functions: {
35
+ /** Create a new like on the post */
36
+ createLike: DiscussionCreateLikeFunction;
37
+ /** Delete a like on the post */
38
+ deleteLike: DiscussionDeleteLikeFunction;
39
+ /** List the likes on the post */
40
+ listLikes?: DiscussionListLikesFunction;
41
+ };
42
+ /** The base path for the content - used for the queryKey for tanstackQuery */
43
+ basePath?: string;
44
+ /** The parent ID for the content */
45
+ parentId?: string;
46
+ };
47
+ /** Props for the comments button */
48
+ comments: false | {
49
+ /** The number of comments on the post */
50
+ count: number;
51
+ functions: {
52
+ /** The function to handle the comment click */
53
+ onClick: () => void;
54
+ };
55
+ };
56
+ /** Props for the replies button */
57
+ replies: false | {
58
+ functions: {
59
+ /** The function to handle the reply click */
60
+ onClick: () => void;
61
+ };
62
+ };
63
+ /** Props for the share link button */
64
+ shareLink: false | {
65
+ /** The URL for the share link */
66
+ url: string;
67
+ };
68
+ /** Props for the more menu button */
69
+ moreMenu: false | {
70
+ /** The data for the default report button */
71
+ contentSlug: string;
72
+ reportData: false | {
73
+ contentUrl: string;
74
+ };
75
+ /** The more menu options */
76
+ options?: IMoreMenuOptions[];
77
+ };
78
+ }
79
+ declare const ActionBar: React.FC<Props>;
80
+ export default ActionBar;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ButtonPropsType } from '../../../../general';
3
+ export interface ActionBarButtonProps extends ButtonPropsType {
4
+ }
5
+ declare const ActionBarButton: React.FC<ActionBarButtonProps>;
6
+ export default ActionBarButton;
@@ -0,0 +1 @@
1
+ export { default as ActionButton } from './button';
@@ -0,0 +1,3 @@
1
+ export * from './button';
2
+ export * from './likes';
3
+ export * from './share-link';
@@ -1,4 +1,4 @@
1
- import { ILikesFeedProps, ILikesFeedQueryFns } from '../../../../../discussion/feeds';
1
+ import { ILikesFeedProps, ILikesFeedQueryFns } from '../../../../../../discussion/feeds';
2
2
  export interface ILikesModalProps extends ILikesFeedProps {
3
3
  /** Whether the modal is open on page load */
4
4
  showModal?: boolean;
@@ -1,2 +1,3 @@
1
- export { default as DiscussionLikes } from './likes';
1
+ export { default as LikesButton } from './likes';
2
2
  export { default as LikesModal } from './components/likes-modal/likes-modal';
3
+ export * from './mocks';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { MemberProps } from '../../../user';
3
- import { IDiscussionContent } from './../../discussion';
4
- import { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
2
+ import { MemberProps } from '../../../../user';
3
+ import { IDiscussionContent } from '../../../../discussion/discussion';
4
+ import { ILikesFeedQueryFns } from '../../../../discussion/feeds/likes-feed';
5
5
  interface Props {
6
6
  /** The element to render around the content */
7
7
  element?: 'li' | 'div';
@@ -1,4 +1,4 @@
1
- import { MemberProps } from '../../../user';
1
+ import { MemberProps } from '../../../../user';
2
2
  export declare const createSlugsPayload: ({ question, answer, reply, }: {
3
3
  question?: string | undefined;
4
4
  answer?: string | undefined;
@@ -1,2 +1,2 @@
1
- import { MemberProps } from '../../../user';
1
+ import { MemberProps } from '../../../../user';
2
2
  export declare const peopleWhoLiked: MemberProps[];
@@ -0,0 +1,2 @@
1
+ export { default as ActionBar } from './action-bar';
2
+ export * from './components';
@@ -1,3 +1,4 @@
1
+ export * from './action-bar';
1
2
  export * from './breadcrumbs';
2
3
  export * from './enriched-url';
3
4
  export * from './filters';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "6.0.1",
3
+ "version": "6.0.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {