@apolitical/component-library 1.1.4 → 1.2.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 (32) hide show
  1. package/discussion/conversation/conversation.d.ts +13 -0
  2. package/discussion/conversation/index.d.ts +1 -0
  3. package/discussion/discussion.helpers.d.ts +5 -0
  4. package/discussion/form/form.d.ts +3 -3
  5. package/discussion/index.d.ts +2 -0
  6. package/discussion/likes/likes.d.ts +4 -0
  7. package/discussion/post/index.d.ts +1 -0
  8. package/discussion/post/post.d.ts +37 -0
  9. package/general/link/link.d.ts +2 -2
  10. package/index.js +72 -72
  11. package/index.mjs +9923 -9227
  12. package/package.json +1 -1
  13. package/style.css +1 -1
  14. package/styles/base/_index.scss +1 -0
  15. package/styles/base/_table.scss +71 -0
  16. package/styles/variables/colors/_theme.scss +5 -0
  17. package/text/index.d.ts +1 -0
  18. package/text/markdown-text/components/case-study/case-study.d.ts +5 -0
  19. package/text/markdown-text/components/case-study/index.d.ts +1 -0
  20. package/text/markdown-text/components/details/details.d.ts +9 -0
  21. package/text/markdown-text/components/details/index.d.ts +1 -0
  22. package/text/markdown-text/components/div/div.d.ts +6 -0
  23. package/text/markdown-text/components/div/index.d.ts +1 -0
  24. package/text/markdown-text/components/empty-component/empty-component.d.ts +5 -0
  25. package/text/markdown-text/components/empty-component/index.d.ts +1 -0
  26. package/text/markdown-text/components/iframe/iframe.d.ts +8 -0
  27. package/text/markdown-text/components/iframe/index.d.ts +1 -0
  28. package/text/markdown-text/components/index.d.ts +6 -0
  29. package/text/markdown-text/components/link/index.d.ts +1 -0
  30. package/text/markdown-text/components/link/link.d.ts +8 -0
  31. package/text/markdown-text/index.d.ts +1 -0
  32. package/text/markdown-text/markdown-text.d.ts +10 -0
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export declare const ConversationContext: React.Context<{
3
+ showThread: boolean;
4
+ showForm: boolean;
5
+ updateConversation?: React.Dispatch<React.SetStateAction<{
6
+ showThread: boolean;
7
+ showForm: boolean;
8
+ }>> | undefined;
9
+ }>;
10
+ declare const Conversation: ({ children }: {
11
+ children: React.ReactNode;
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ export default Conversation;
@@ -0,0 +1 @@
1
+ export { default as DiscussionConversation, ConversationContext } from './conversation';
@@ -0,0 +1,5 @@
1
+ export declare const transformSlugs: (slugs: {
2
+ [key: string]: string;
3
+ }) => {
4
+ [key: string]: string;
5
+ };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IDiscussionContent } from './../discussion';
2
+ import { DiscussionCreateContentFunction, IDiscussionContent } from './../discussion';
3
3
  interface Props {
4
4
  /** Information about the content being created/edited */
5
5
  content: IDiscussionContent;
@@ -29,8 +29,8 @@ interface Props {
29
29
  };
30
30
  /** The functions that are passed in to handle the functionality */
31
31
  functions: {
32
- create: (args1: void | object, args2?: object) => void;
33
- handleSaveEdit?: () => void;
32
+ create: DiscussionCreateContentFunction;
33
+ handleSaveEdit?: ((arg?: string) => Promise<void>) | (() => void);
34
34
  handleCancel?: () => void;
35
35
  callback?: (args: void) => void;
36
36
  props?: {
@@ -1,2 +1,4 @@
1
+ export * from './conversation';
1
2
  export * from './form';
2
3
  export * from './likes';
4
+ export * from './post';
@@ -1,7 +1,11 @@
1
1
  import { IDiscussionContent } from './../discussion';
2
2
  interface Props {
3
+ /** The element to render around the content */
4
+ element?: 'span' | 'p' | 'li' | 'div';
3
5
  /** The number of likes the content has had */
4
6
  likes?: number;
7
+ /** If we should display the short version */
8
+ isShort?: boolean;
5
9
  /** Whether the user has liked the content */
6
10
  userLiked?: boolean;
7
11
  /** Information about the content being liked */
@@ -0,0 +1 @@
1
+ export { default as DiscussionPost } from './post';
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, IFullDiscussionContent } from './../discussion';
3
+ interface Props {
4
+ /** Information about the content being posted */
5
+ content: IFullDiscussionContent;
6
+ /** If the post is still loading */
7
+ isLoading?: boolean;
8
+ /** The ID of the original post author, for threads */
9
+ originalAuthorId?: string;
10
+ /** The functions that are passed in to handle the functionality */
11
+ functions: {
12
+ content: {
13
+ /** Create a new post */
14
+ createContent: DiscussionCreateContentFunction;
15
+ /** Delete the post */
16
+ deleteContent: (args?: object) => void;
17
+ /** Update the post */
18
+ updateContent: (args1?: object, args2?: object) => void;
19
+ };
20
+ likes: {
21
+ /** Create a new like on the post */
22
+ createLike: DiscussionCreateLikeFunction;
23
+ /** Delete a like on the post */
24
+ deleteLike: DiscussionDeleteLikeFunction;
25
+ };
26
+ };
27
+ /** Additional classes */
28
+ className?: string;
29
+ /** The GTM context */
30
+ gtmContext?: string;
31
+ /** Additional content */
32
+ children?: React.ReactNode;
33
+ /** The language for the text */
34
+ locale?: string;
35
+ }
36
+ declare const PostWrapper: ({ locale, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
37
+ export default PostWrapper;
@@ -3,7 +3,7 @@ interface Props {
3
3
  /** URL for link */
4
4
  href?: string | undefined;
5
5
  /** Content to rendered */
6
- children: React.ReactNode | string;
6
+ children: JSX.Element | JSX.Element[] | string;
7
7
  /** Additonal classes */
8
8
  className?: string;
9
9
  /** Function to be called when clicked */
@@ -17,5 +17,5 @@ interface Props {
17
17
  /** Test id for link */
18
18
  'data-testid'?: string;
19
19
  }
20
- declare const Link: ({ href, children, className, onClick, gtmContext, gtmType, ...props }: Props) => string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
20
+ declare const Link: ({ href, children, className, onClick, gtmContext, gtmType, ...props }: Props) => string | import("react/jsx-runtime").JSX.Element | JSX.Element[];
21
21
  export default Link;