@apolitical/component-library 1.4.1-beta.1 → 1.5.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/accessibility/visually-hidden/visually-hidden.d.ts +2 -1
  2. package/discussion/discussion.mock.d.ts +6 -33
  3. package/discussion/index.d.ts +2 -0
  4. package/discussion/post/post.d.ts +9 -1
  5. package/discussion/post/post.mock.d.ts +18 -0
  6. package/discussion/responses-heading/index.d.ts +1 -0
  7. package/discussion/responses-heading/responses-heading.d.ts +10 -0
  8. package/discussion/thread/index.d.ts +1 -0
  9. package/discussion/thread/thread.d.ts +11 -0
  10. package/general/buttons/button-wrapper/button-wrapper.d.ts +1 -0
  11. package/general/divider/divider.d.ts +6 -0
  12. package/general/divider/index.d.ts +1 -0
  13. package/general/index.d.ts +1 -0
  14. package/general/link/link.d.ts +1 -1
  15. package/index.js +45 -49
  16. package/index.mjs +6277 -5989
  17. package/layout/page-layout/page-layout.d.ts +1 -1
  18. package/modals/index.d.ts +1 -0
  19. package/modals/modal/modal.d.ts +19 -2
  20. package/modals/overlay/index.d.ts +2 -0
  21. package/modals/overlay/overlay.d.ts +36 -0
  22. package/modals/overlay/overlay.helpers.d.ts +5 -0
  23. package/navigation/index.d.ts +1 -0
  24. package/navigation/more-menu/index.d.ts +2 -0
  25. package/navigation/more-menu/more-menu.d.ts +37 -0
  26. package/package.json +1 -1
  27. package/style.css +1 -1
  28. package/styles/base/_overlays.scss +41 -7
  29. package/styles/base/buttons/_buttons.scss +6 -4
  30. package/styles/base/buttons/_icons.scss +7 -1
  31. package/styles/variables/colors/_theme.scss +27 -8
  32. package/text/helper-text-box/helper-text-box.d.ts +1 -1
  33. package/text/index.d.ts +1 -1
  34. package/text/status-banner/index.d.ts +1 -0
  35. package/text/{alert/alert.d.ts → status-banner/status-banner.d.ts} +2 -2
  36. package/text/alert/index.d.ts +0 -1
@@ -5,7 +5,7 @@ interface Props {
5
5
  /** Whether the content should be shown on focus. */
6
6
  showOnFocus?: boolean;
7
7
  /** The content to be hidden from screen readers. */
8
- children: React.ReactNode;
8
+ children: React.ReactNode | JSX.Element | string;
9
9
  /** An `href`, for links */
10
10
  href?: string;
11
11
  /** `for`, for labels */
@@ -13,6 +13,7 @@ interface Props {
13
13
  }
14
14
  declare const _default: React.MemoExoticComponent<({ element, showOnFocus, children, ...props }: Props) => React.DetailedReactHTMLElement<{
15
15
  className: string;
16
+ children: React.ReactNode | JSX.Element;
16
17
  /** An `href`, for links */
17
18
  href?: string | undefined;
18
19
  /** `for`, for labels */
@@ -55,7 +55,7 @@ export namespace reply {
55
55
  }
56
56
  export namespace answer {
57
57
  export namespace me_2 {
58
- let id_2: number;
58
+ let id_2: string;
59
59
  export { id_2 as id };
60
60
  let slug_2: string;
61
61
  export { slug_2 as slug };
@@ -91,7 +91,7 @@ export namespace answer {
91
91
  }
92
92
  export { me_2 as me };
93
93
  export namespace otherUser_2 {
94
- let id_3: number;
94
+ let id_3: string;
95
95
  export { id_3 as id };
96
96
  let slug_3: string;
97
97
  export { slug_3 as slug };
@@ -128,7 +128,7 @@ export namespace answer {
128
128
  }
129
129
  export { otherUser_2 as otherUser };
130
130
  export namespace otherUserLiked {
131
- let id_4: number;
131
+ let id_4: string;
132
132
  export { id_4 as id };
133
133
  let slug_4: string;
134
134
  export { slug_4 as slug };
@@ -165,38 +165,11 @@ export namespace answer {
165
165
  }
166
166
  }
167
167
  export namespace question {
168
- export let title: string;
168
+ let body_5: string;
169
+ export { body_5 as body };
169
170
  let slug_5: string;
170
171
  export { slug_5 as slug };
171
- export let answers: {
172
- id: number;
173
- slug: string;
174
- body: string;
175
- author: {
176
- id: string;
177
- name: string;
178
- };
179
- authorId: string;
180
- userLiked: boolean;
181
- likes: number;
182
- replies: {
183
- slug: string;
184
- authorId: string;
185
- body: string;
186
- likes: number;
187
- isEdited: boolean;
188
- contentType: string;
189
- createdAt: string;
190
- updatedAt: string;
191
- author: {
192
- id: string;
193
- name: string;
194
- };
195
- userLiked: boolean;
196
- }[];
197
- createdAt: string;
198
- updatedAt: string;
199
- }[];
172
+ export let comments: number;
200
173
  import authorId_5 = id;
201
174
  export { authorId_5 as authorId };
202
175
  import author_5 = authors.me;
@@ -2,3 +2,5 @@ export * from './conversation';
2
2
  export * from './form';
3
3
  export * from './likes';
4
4
  export * from './post';
5
+ export * from './responses-heading';
6
+ export * from './thread';
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { DiscussionCreateContentFunction, DiscussionCreateLikeFunction, DiscussionDeleteLikeFunction, IFullDiscussionContent } from './../discussion';
3
3
  interface Props {
4
+ /** The element that will render around the content */
5
+ element?: 'li' | 'div' | 'section' | 'article';
4
6
  /** Information about the content being posted */
5
7
  content: IFullDiscussionContent;
6
8
  /** If the post is still loading */
@@ -23,7 +25,13 @@ interface Props {
23
25
  /** Delete a like on the post */
24
26
  deleteLike: DiscussionDeleteLikeFunction;
25
27
  };
28
+ comments: {
29
+ /** Open comments on a post */
30
+ openComments: () => void;
31
+ };
26
32
  };
33
+ /** Optional `href` for the card to link to */
34
+ link?: string;
27
35
  /** Additional classes */
28
36
  className?: string;
29
37
  /** The GTM context */
@@ -33,5 +41,5 @@ interface Props {
33
41
  /** The language for the text */
34
42
  locale?: string;
35
43
  }
36
- declare const Post: ({ content, isLoading, originalAuthorId, functions: { content: { createContent, deleteContent, updateContent }, likes: { createLike, deleteLike }, }, className, gtmContext, locale, children, }: Props) => import("react/jsx-runtime").JSX.Element;
44
+ declare const Post: ({ element, content, isLoading, originalAuthorId, functions: { content: { createContent, deleteContent, updateContent }, likes: { createLike, deleteLike }, comments: { openComments }, }, link, className, gtmContext, locale, children, }: Props) => import("react/jsx-runtime").JSX.Element;
37
45
  export default Post;
@@ -0,0 +1,18 @@
1
+ declare namespace _default {
2
+ let isLoading: boolean;
3
+ namespace functions {
4
+ namespace content {
5
+ function createContent(): void;
6
+ function deleteContent(): void;
7
+ function updateContent(): void;
8
+ }
9
+ namespace likes {
10
+ function createLike(): void;
11
+ function deleteLike(): void;
12
+ }
13
+ namespace comments {
14
+ function openComments(): void;
15
+ }
16
+ }
17
+ }
18
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as ResponsesHeading } from './responses-heading';
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ /** The type of response */
3
+ type?: 'answer' | 'comment';
4
+ /** The number of responses to show */
5
+ responses: number;
6
+ /** The language to use for the text */
7
+ locale?: string;
8
+ }
9
+ declare const ResponsesHeading: ({ type, responses }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default ResponsesHeading;
@@ -0,0 +1 @@
1
+ export { default as DiscussionThread } from './thread';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ /** If the thread is open or not */
4
+ isOpen?: boolean;
5
+ /** The number of posts in the thread */
6
+ count?: number;
7
+ /** The posts to render */
8
+ children: React.ReactNode | JSX.Element | JSX.Element[];
9
+ }
10
+ declare const Thread: ({ isOpen: threadIsOpen, count, children }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export default Thread;
@@ -7,6 +7,7 @@ interface Props {
7
7
  className?: string;
8
8
  }
9
9
  declare const ButtonWrapper: ({ buttons, className, ...props }: Props) => React.DetailedReactHTMLElement<{
10
+ children: JSX.Element[];
10
11
  className: string;
11
12
  }, HTMLElement>;
12
13
  export default ButtonWrapper;
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ /** The maximum width of the divider */
3
+ maxWidth?: number | false;
4
+ }
5
+ declare const _default: ({ maxWidth }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as Divider } from './divider';
@@ -1,3 +1,4 @@
1
1
  export * from './buttons';
2
+ export * from './divider';
2
3
  export * from './link';
3
4
  export * from './responsive-image';
@@ -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 | import("react/jsx-runtime").JSX.Element | JSX.Element[];
20
+ declare const Link: ({ href, children, className, onClick, gtmContext, gtmType, ...props }: Props) => string | JSX.Element | JSX.Element[];
21
21
  export default Link;