@apolitical/component-library 8.7.25 → 9.0.0-beta.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/accessibility/visually-hidden/visually-hidden.d.ts +1 -1
  2. package/discussion/components/thread/thread.d.ts +1 -1
  3. package/discussion/feeds/replies-feed/components/add-reply-form/add-reply-form.d.ts +1 -1
  4. package/discussion/feeds/replies-feed/components/load-more-replies-button/load-more-replies-button.d.ts +1 -1
  5. package/discussion/feeds/replies-feed/components/reply-item/reply-item.d.ts +1 -1
  6. package/form/components/form/components/fields/input/input.d.ts +1 -1
  7. package/form/components/form/form.types.d.ts +2 -2
  8. package/form/components/rich-text-editor/hooks/use-positioned-element/use-positioned-element.d.ts +1 -1
  9. package/form/types/signup-form/signup-form.helpers.get-fields.d.ts +2 -7
  10. package/general/buttons/button-wrapper/button-wrapper.d.ts +1 -1
  11. package/general/link/link.d.ts +1 -1
  12. package/general/tooltip/tooltip.d.ts +2 -2
  13. package/helpers/intl.d.ts +1 -1
  14. package/helpers/pass-props-to-children.d.ts +1 -1
  15. package/hooks/use-auto-resize/use-auto-resize.d.ts +2 -2
  16. package/index.js +133 -138
  17. package/index.mjs +12669 -13010
  18. package/layout/page-layout/page-layout.d.ts +1 -1
  19. package/modals/components/modal/modal.d.ts +2 -2
  20. package/modals/components/overlay/overlay.d.ts +1 -1
  21. package/navigation/more-menu/more-menu.d.ts +2 -2
  22. package/navigation/tabs/tabs.d.ts +1 -1
  23. package/package.json +4 -4
  24. package/sections/edit-section/edit-section.d.ts +1 -1
  25. package/sections/full-width-section/full-width-section.d.ts +1 -1
  26. package/style.css +1 -1
  27. package/text/helper-text-box/helper-text-box.d.ts +1 -1
  28. package/text/highlighted-text-box/highlighted-text-box.d.ts +1 -1
  29. package/text/icon-bulleted-list/icon-bulleted-list.d.ts +1 -1
  30. package/text/markdown-text/components/div/div.d.ts +1 -1
  31. package/text/markdown-text/components/empty-component/empty-component.d.ts +1 -3
  32. package/text/markdown-text/components/link/link.d.ts +1 -1
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { type JSX } from 'react';
2
2
  import { type IAriaLive } from '../../types';
3
3
  interface Props {
4
4
  /** The ID of the element */
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { type JSX } from 'react';
2
2
  import { IDiscussionForm } from './../form';
3
3
  interface Props {
4
4
  /** Props for the load more button */
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { IDiscussionFormFunctions } from '../../../../../discussion/shared';
2
+ import type { JSX } from "react";
3
3
  interface Props {
4
4
  /** Whether the user is a member of the community */
5
5
  isMember: boolean;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import type { JSX } from "react";
2
2
  interface Props {
3
3
  /** Whether there is a next page */
4
4
  hasNextPage: boolean;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { ILikesFeedQueryFns } from '../../../../../discussion/feeds/likes-feed';
3
2
  import { DiscussionType, type IDiscussionFormFns } from '../../../../../discussion/shared';
4
3
  import type { IParsedReplies, IQueryFns } from '../../cache';
4
+ import type { JSX } from "react";
5
5
  interface IMutations {
6
6
  edit: (params: {
7
7
  replyId: string;
@@ -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>;
63
+ ref: React.RefObject<HTMLInputElement | null>;
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>;
134
+ inputRef?: React.RefObject<HTMLInputElement | null>;
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>;
241
+ formRef?: React.RefObject<HTMLFormElement | null>;
242
242
  /** The functions being passed to the form */
243
243
  functions: {
244
244
  /** The function to call when onSuccess fails */
@@ -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").MutableRefObject<HTMLElement | null>;
3
+ declare const usePositionedElement: (editor: BaseEditor, element: string, fallback: string) => import("react").RefObject<HTMLElement | null>;
4
4
  export default usePositionedElement;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { IntlShape } from 'react-intl';
2
3
  import { IField } from '../../../form/components/form/form.types';
3
4
  import { IShouldShowProps } from './signup-form';
4
5
  interface Props {
@@ -43,13 +44,7 @@ interface Props {
43
44
  dataToSubmit: {
44
45
  [key: string]: string;
45
46
  };
46
- intl: {
47
- formatMessage: (arg: {
48
- [key: string]: string;
49
- }, arg2?: {
50
- [key: string]: (arg: string) => React.ReactNode;
51
- }) => string;
52
- };
47
+ intl: IntlShape;
53
48
  }
54
49
  declare const _default: ({ shouldShow, placeholders, labels, functions: { validateEmail, resendVerificationCode }, refs, state, dispatch, dataToSubmit, intl, }: Props) => IField[];
55
50
  export default _default;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { type JSX } 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 from 'react';
1
+ import React, { type JSX } 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 from 'react';
1
+ import React, { type JSX } 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.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement | null>>>;
41
+ declare const _default: React.NamedExoticComponent<Props & React.RefAttributes<HTMLElement | null>>;
42
42
  export default _default;
package/helpers/intl.d.ts CHANGED
@@ -610,4 +610,4 @@ export declare const checkIntlPathExists: (path: string, language?: {
610
610
  }) => boolean;
611
611
  export declare const getIntlPath: (callback: (args1: {
612
612
  id: string;
613
- }, args2?: object) => string, path: string, key: string, value: string, args?: object) => string;
613
+ }, args2?: Record<string, any>) => string, path: string, key: string, value: string, args?: Record<string, any>) => string;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const passPropsToChildren: (children: React.ReactElement, props: object) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
2
+ declare const passPropsToChildren: (children: React.ReactElement, props: object) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
3
3
  export default passPropsToChildren;
@@ -1,3 +1,3 @@
1
- import { MutableRefObject } from 'react';
2
- declare const _default: (shouldResize: boolean, inputRef?: MutableRefObject<HTMLTextAreaElement | HTMLInputElement | null>) => false | MutableRefObject<HTMLTextAreaElement | HTMLInputElement | null>;
1
+ import { RefObject } from 'react';
2
+ declare const _default: (shouldResize: boolean, inputRef?: RefObject<HTMLTextAreaElement | HTMLInputElement | null>) => false | RefObject<HTMLTextAreaElement | HTMLInputElement | null>;
3
3
  export default _default;