@apolitical/component-library 9.0.0-pla.2 → 9.0.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 (60) hide show
  1. package/accessibility/visually-hidden/visually-hidden.d.ts +1 -1
  2. package/discussion/components/add-post/add-post.d.ts +2 -0
  3. package/discussion/components/post/post.d.ts +2 -1
  4. package/discussion/components/thread/thread.d.ts +1 -1
  5. package/discussion/discussion.helpers.d.ts +1 -1
  6. package/discussion/feeds/replies-feed/components/add-reply-form/add-reply-form.d.ts +1 -1
  7. package/discussion/feeds/replies-feed/components/load-more-replies-button/load-more-replies-button.d.ts +1 -1
  8. package/discussion/feeds/replies-feed/components/reply-item/reply-item.d.ts +1 -1
  9. package/form/components/form/components/fields/input/input.d.ts +1 -1
  10. package/form/components/form/form.types.d.ts +2 -2
  11. package/form/components/rich-text-editor/helpers/transform/transform.d.ts +1 -1
  12. package/form/components/rich-text-editor/hooks/use-positioned-element/use-positioned-element.d.ts +1 -1
  13. package/form/types/signup-form/signup-form.helpers.get-fields.d.ts +7 -2
  14. package/general/buttons/button-wrapper/button-wrapper.d.ts +1 -1
  15. package/general/link/link.d.ts +1 -1
  16. package/general/tooltip/tooltip.d.ts +2 -2
  17. package/helpers/intl.d.ts +2 -3
  18. package/helpers/pass-props-to-children.d.ts +1 -1
  19. package/hooks/use-auto-resize/use-auto-resize.d.ts +2 -2
  20. package/index.js +174 -152
  21. package/index.mjs +16023 -15574
  22. package/layout/page-layout/page-layout.d.ts +1 -1
  23. package/modals/components/modal/modal.d.ts +2 -2
  24. package/modals/components/overlay/overlay.d.ts +1 -1
  25. package/navigation/more-menu/more-menu.d.ts +2 -2
  26. package/navigation/tabs/tabs.d.ts +1 -1
  27. package/package.json +6 -6
  28. package/sections/edit-section/edit-section.d.ts +1 -1
  29. package/sections/full-width-section/full-width-section.d.ts +1 -1
  30. package/style.css +1 -1
  31. package/styles/base/_accessibility.scss +34 -32
  32. package/styles/base/_blockquotes.scss +50 -48
  33. package/styles/base/_fonts.scss +9 -7
  34. package/styles/base/_hr.scss +9 -7
  35. package/styles/base/_layout.scss +24 -22
  36. package/styles/base/_links.scss +18 -14
  37. package/styles/base/_lists.scss +40 -38
  38. package/styles/base/_mentions.scss +11 -9
  39. package/styles/base/_overlays.scss +51 -49
  40. package/styles/base/_svg.scss +4 -2
  41. package/styles/base/_table.scss +58 -56
  42. package/styles/base/_text.scss +110 -108
  43. package/styles/base/_titles.scss +56 -42
  44. package/styles/base/buttons/_button-wrapper.scss +27 -25
  45. package/styles/base/buttons/_buttons.scss +316 -314
  46. package/styles/base/form/_checkbox.scss +33 -31
  47. package/styles/base/form/_fields.scss +57 -55
  48. package/styles/base/form/_form.scss +18 -16
  49. package/styles/base/form/_labels.scss +8 -6
  50. package/styles/base/form/_radio.scss +20 -18
  51. package/styles/base/form/_search-button.scss +21 -19
  52. package/styles/index.scss +1 -1
  53. package/styles/reset/_reset.scss +117 -121
  54. package/styles/uclasses/uclasses.scss +1452 -1450
  55. package/text/helper-text-box/helper-text-box.d.ts +1 -1
  56. package/text/highlighted-text-box/highlighted-text-box.d.ts +1 -1
  57. package/text/icon-bulleted-list/icon-bulleted-list.d.ts +1 -1
  58. package/text/markdown-text/components/div/div.d.ts +1 -1
  59. package/text/markdown-text/components/empty-component/empty-component.d.ts +3 -1
  60. package/text/markdown-text/components/link/link.d.ts +1 -1
@@ -1,4 +1,4 @@
1
- import React, { type JSX } from 'react';
1
+ import React from 'react';
2
2
  import { type IAriaLive } from '../../types';
3
3
  interface Props {
4
4
  /** The ID of the element */
@@ -10,6 +10,8 @@ interface Props {
10
10
  form: IDiscussionForm;
11
11
  /** The categories to show in the form */
12
12
  categories?: ICategory[];
13
+ /** Determines whether or not to display the form*/
14
+ isHidden?: boolean;
13
15
  /** Details about what a user needs to have to be able to access the form */
14
16
  membershipRequiredToPost: {
15
17
  /** Whether the user needs to be a member of the community to post */
@@ -122,6 +122,7 @@ export interface IDiscussionPostProps {
122
122
  body?: string | undefined;
123
123
  }>;
124
124
  };
125
+ hideReply?: boolean;
125
126
  }
126
- declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges, basePath, parentId, disableMentions, onClick: onClickPost, translation, }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
127
+ declare const Post: ({ element, content, userHasPermissions, userHasOwnerPermissions, isLoading, originalAuthorId, forceHide, functions, links, className, gtmContext, children, isTruncated, setFocus, isCommunity, badges, basePath, parentId, disableMentions, onClick: onClickPost, translation, hideReply }: IDiscussionPostProps) => import("react/jsx-runtime").JSX.Element;
127
128
  export default Post;
@@ -1,4 +1,4 @@
1
- import React, { type JSX } from 'react';
1
+ import React from 'react';
2
2
  import { IDiscussionForm } from './../form';
3
3
  interface Props {
4
4
  /** Props for the load more button */
@@ -4,7 +4,7 @@ export declare const transformSlugs: (slugs: {
4
4
  }) => {
5
5
  [key: string]: string;
6
6
  };
7
- export declare const getAuthorData: (author: IUser, isAnonymous?: boolean) => "deleted" | "anonymous" | {
7
+ export declare const getAuthorData: (author: IUser, isAnonymous?: boolean) => "anonymous" | "deleted" | {
8
8
  id: string;
9
9
  name: string;
10
10
  organization: string;
@@ -1,4 +1,4 @@
1
- import { type JSX } from 'react';
1
+ /// <reference types="react" />
2
2
  import { IDiscussionFormFunctions } from '../../../../../discussion/shared';
3
3
  interface Props {
4
4
  /** Whether the user is a member of the community */
@@ -1,4 +1,4 @@
1
- import { type JSX } from 'react';
1
+ /// <reference types="react" />
2
2
  interface Props {
3
3
  /** Whether there is a next page */
4
4
  hasNextPage: boolean;
@@ -1,4 +1,4 @@
1
- import { type JSX } from 'react';
1
+ /// <reference types="react" />
2
2
  import { ILikesFeedQueryFns } from '../../../../../discussion/feeds/likes-feed';
3
3
  import { DiscussionType, type IDiscussionFormFns } from '../../../../../discussion/shared';
4
4
  import type { IParsedReplies, IQueryFns } from '../../cache';
@@ -60,6 +60,6 @@ export declare const Input: ({ className, element, id, inputRef: ref, functions,
60
60
  shownValue?: InputValues | undefined;
61
61
  submitOnEnter?: boolean | undefined;
62
62
  validation?: import("../../../form.types").IFieldValidation[] | undefined;
63
- ref: React.RefObject<HTMLInputElement | null>;
63
+ ref: React.RefObject<HTMLInputElement>;
64
64
  }, HTMLInputElement>;
65
65
  export default Input;
@@ -131,7 +131,7 @@ export interface IField {
131
131
  /** The initial value of the field, for dropdown fields */
132
132
  initialValue?: FormValues;
133
133
  /** An optional `ref` for the field, in case we need to interact with it in another file */
134
- inputRef?: React.RefObject<HTMLInputElement | null>;
134
+ inputRef?: React.RefObject<HTMLInputElement>;
135
135
  /** The internationalisation path for the field */
136
136
  intlPath?: string | false;
137
137
  /** The label for the field */
@@ -238,7 +238,7 @@ export interface IFormProps {
238
238
  /** The fields to render in the form */
239
239
  fields: IField[];
240
240
  /** An optional `ref` for the form, in case we need to interact with it in another file */
241
- formRef?: React.RefObject<HTMLFormElement | null>;
241
+ formRef?: React.RefObject<HTMLFormElement>;
242
242
  /** The functions being passed to the form */
243
243
  functions: {
244
244
  /** The function to call when onSuccess fails */
@@ -12,8 +12,8 @@ export default function transform<T extends InputNodeTypes>(node: MdastNode, opt
12
12
  position?: any;
13
13
  ordered?: boolean | undefined;
14
14
  checked?: any;
15
- depth?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
16
15
  lang?: string | undefined;
16
+ depth?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
17
17
  spread?: any;
18
18
  indent?: any;
19
19
  text: string | undefined;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseEditor } from 'slate';
3
- declare const usePositionedElement: (editor: BaseEditor, element: string, fallback: string) => import("react").RefObject<HTMLElement | null>;
3
+ declare const usePositionedElement: (editor: BaseEditor, element: string, fallback: string) => import("react").MutableRefObject<HTMLElement | null>;
4
4
  export default usePositionedElement;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { IntlShape } from 'react-intl';
3
2
  import { IField } from '../../../form/components/form/form.types';
4
3
  import { IShouldShowProps } from './signup-form';
5
4
  interface Props {
@@ -44,7 +43,13 @@ interface Props {
44
43
  dataToSubmit: {
45
44
  [key: string]: string;
46
45
  };
47
- intl: IntlShape;
46
+ intl: {
47
+ formatMessage: (arg: {
48
+ [key: string]: string;
49
+ }, arg2?: {
50
+ [key: string]: (arg: string) => React.ReactNode;
51
+ }) => string;
52
+ };
48
53
  }
49
54
  declare const _default: ({ shouldShow, placeholders, labels, functions: { validateEmail, resendVerificationCode }, refs, state, dispatch, dataToSubmit, intl, }: Props) => IField[];
50
55
  export default _default;
@@ -1,4 +1,4 @@
1
- import React, { type JSX } from 'react';
1
+ import React from 'react';
2
2
  import { ButtonPropsType } from './../button';
3
3
  interface Props {
4
4
  /** The props for each button */
@@ -1,4 +1,4 @@
1
- import React, { type JSX } from 'react';
1
+ import React from 'react';
2
2
  type LinkOnClick = ((e?: React.MouseEvent<HTMLElement>) => void) | undefined;
3
3
  export interface ILinkProps {
4
4
  /** URL for link */
@@ -1,4 +1,4 @@
1
- import React, { type JSX } from 'react';
1
+ import React from 'react';
2
2
  interface Props {
3
3
  /** Optional styling */
4
4
  styling?: {
@@ -38,5 +38,5 @@ interface Props {
38
38
  /** The id of the tooltip */
39
39
  id?: string;
40
40
  }
41
- declare const _default: React.NamedExoticComponent<Props & React.RefAttributes<HTMLElement | null>>;
41
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement | null>>>;
42
42
  export default _default;
package/helpers/intl.d.ts CHANGED
@@ -206,8 +206,6 @@ export declare const checkIntlPathExists: (path: string, language?: {
206
206
  discussion_responses_answer: string;
207
207
  discussion_responses_comment: string;
208
208
  discussion_responses_title: string;
209
- discussion_responses_empty: string;
210
- discussion_responses_empty_answer: string;
211
209
  discussion_responses_placeholder: string;
212
210
  discussion_share_copy_link: string;
213
211
  discussion_share_copy_link_success: string;
@@ -455,6 +453,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
455
453
  footer_legal_cookie: string;
456
454
  footer_legal_accessibility: string;
457
455
  footer_legal_ai: string;
456
+ footer_legal_trust: string;
458
457
  footer_legal_dataProtection: string;
459
458
  footer_legal_euDataProtection: string;
460
459
  footer_contact: string;
@@ -614,4 +613,4 @@ export declare const checkIntlPathExists: (path: string, language?: {
614
613
  }) => boolean;
615
614
  export declare const getIntlPath: (callback: (args1: {
616
615
  id: string;
617
- }, args2?: Record<string, any>) => string, path: string, key: string, value: string, args?: Record<string, any>) => string;
616
+ }, args2?: object) => string, path: string, key: string, value: string, args?: object) => string;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const passPropsToChildren: (children: React.ReactElement, props: object) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
2
+ declare const passPropsToChildren: (children: React.ReactElement, props: object) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
3
3
  export default passPropsToChildren;
@@ -1,3 +1,3 @@
1
- import { RefObject } from 'react';
2
- declare const _default: (shouldResize: boolean, inputRef?: RefObject<HTMLTextAreaElement | HTMLInputElement | null>) => false | RefObject<HTMLTextAreaElement | HTMLInputElement | null>;
1
+ import { MutableRefObject } from 'react';
2
+ declare const _default: (shouldResize: boolean, inputRef?: MutableRefObject<HTMLTextAreaElement | HTMLInputElement | null>) => false | MutableRefObject<HTMLTextAreaElement | HTMLInputElement | null>;
3
3
  export default _default;