@apolitical/component-library 4.1.0-beta.0 → 4.1.0-beta.10

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 (41) hide show
  1. package/accessibility/visually-hidden/visually-hidden.d.ts +18 -0
  2. package/discussion/components/form/form.d.ts +3 -4
  3. package/discussion/components/likes/likes.d.ts +7 -1
  4. package/form/components/form/form.d.ts +1 -1
  5. package/form/components/form/form.types.d.ts +2 -0
  6. package/form/components/rich-text-editor/components/context/context.d.ts +3 -7
  7. package/form/components/rich-text-editor/components/toolbar/components/block-option/index.d.ts +1 -0
  8. package/form/components/rich-text-editor/components/toolbar/components/link-editor/link-editor.helpers.d.ts +2 -2
  9. package/form/components/rich-text-editor/components/toolbar/components/mark-option/mark-option.helpers.d.ts +2 -0
  10. package/form/components/rich-text-editor/components/toolbar/index.d.ts +1 -1
  11. package/form/components/rich-text-editor/helpers/ast-types/ast-types.d.ts +156 -0
  12. package/form/components/rich-text-editor/helpers/ast-types/index.d.ts +1 -0
  13. package/form/components/rich-text-editor/helpers/deserialize/deserialize.d.ts +3 -0
  14. package/form/components/rich-text-editor/helpers/deserialize/index.d.ts +1 -0
  15. package/form/components/rich-text-editor/helpers/helpers.data.d.ts +97 -0
  16. package/form/components/rich-text-editor/helpers/hot-keys/hot-keys.d.ts +4 -0
  17. package/form/components/rich-text-editor/helpers/hot-keys/index.d.ts +1 -0
  18. package/form/components/rich-text-editor/helpers/index.d.ts +5 -0
  19. package/form/components/rich-text-editor/helpers/serialize/do-serialize.d.ts +3 -0
  20. package/form/components/rich-text-editor/helpers/serialize/index.d.ts +2 -0
  21. package/form/components/rich-text-editor/helpers/serialize/serialize.d.ts +8 -0
  22. package/form/components/rich-text-editor/helpers/transform/index.d.ts +1 -0
  23. package/form/components/rich-text-editor/helpers/transform/transform.d.ts +21 -0
  24. package/form/components/rich-text-editor/plugins/with-linlines/with-inlines.d.ts +1 -1
  25. package/form/components/rich-text-editor/rich-text-editor.d.ts +1 -2
  26. package/general/buttons/button/button.d.ts +7 -1
  27. package/general/index.d.ts +1 -0
  28. package/general/link/link.d.ts +6 -0
  29. package/general/portal/index.d.ts +1 -0
  30. package/general/portal/portal.d.ts +5 -0
  31. package/general/tooltip/tooltip.d.ts +2 -0
  32. package/helpers/intl.d.ts +2 -0
  33. package/index.js +57 -60
  34. package/index.mjs +7211 -7057
  35. package/package.json +1 -2
  36. package/style.css +1 -1
  37. package/styles/base/_accessibility.scss +5 -0
  38. package/styles/base/_links.scss +12 -3
  39. package/styles/base/buttons/_icons.scss +2 -0
  40. package/text/markdown-text/components/span/span.d.ts +2 -1
  41. package/form/components/rich-text-editor/rich-text-editor.helpers.d.ts +0 -5
@@ -8,21 +8,39 @@ interface Props {
8
8
  children: React.ReactNode | JSX.Element | string;
9
9
  /** An `href`, for links */
10
10
  href?: string;
11
+ /** An `onBlur`, for buttons */
12
+ onBlur?: (e: React.FocusEvent) => void;
11
13
  /** An `onClick`, for buttons */
12
14
  onClick?: (e: React.MouseEvent) => void;
15
+ /** An `onFocus`, for buttons */
16
+ onFocus?: (e: React.FocusEvent) => void;
17
+ /** An `onKeyDown`, for buttons */
18
+ onKeyDown?: (e: React.KeyboardEvent) => void;
13
19
  /** `for`, for labels */
14
20
  htmlFor?: string;
15
21
  /** Additional classes */
16
22
  className?: string;
23
+ /** Additional aria props */
24
+ 'aria-expanded'?: boolean;
25
+ 'aria-controls'?: string;
17
26
  }
18
27
  declare const _default: React.MemoExoticComponent<({ element, showOnFocus, children, className, ...props }: Props) => React.DetailedReactHTMLElement<{
19
28
  className: string;
20
29
  children: React.ReactNode | JSX.Element;
21
30
  /** An `href`, for links */
22
31
  href?: string | undefined;
32
+ /** An `onBlur`, for buttons */
33
+ onBlur?: ((e: React.FocusEvent<Element, Element>) => void) | undefined;
23
34
  /** An `onClick`, for buttons */
24
35
  onClick?: ((e: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
36
+ /** An `onFocus`, for buttons */
37
+ onFocus?: ((e: React.FocusEvent<Element, Element>) => void) | undefined;
38
+ /** An `onKeyDown`, for buttons */
39
+ onKeyDown?: ((e: React.KeyboardEvent<Element>) => void) | undefined;
25
40
  /** `for`, for labels */
26
41
  htmlFor?: string | undefined;
42
+ /** Additional aria props */
43
+ 'aria-expanded'?: boolean | undefined;
44
+ 'aria-controls'?: string | undefined;
27
45
  }, HTMLElement>>;
28
46
  export default _default;
@@ -1,6 +1,7 @@
1
- import React from 'react';
2
1
  import { DiscussionCreateContentFunction, IDiscussionContent } from './../../discussion';
3
2
  export interface IDiscussionForm {
3
+ /** A unique ID for the form */
4
+ id?: string;
4
5
  /** Information about the content being created/edited */
5
6
  content: IDiscussionContent;
6
7
  /** If the user has permission to interact with the form, e.g. if they're a member of the community */
@@ -20,8 +21,6 @@ export interface IDiscussionForm {
20
21
  /** Whether the success message should show on a successful submit */
21
22
  showSuccessMessage?: boolean;
22
23
  };
23
- /** The `ref` for the input, if we need to have control over it in the parent */
24
- editorRef?: React.MutableRefObject<string | null>;
25
24
  /** The placeholder text - this defaults to the intl text */
26
25
  placeholder?: string;
27
26
  /** The maximum number of characters */
@@ -50,5 +49,5 @@ export interface IDiscussionForm {
50
49
  /** The language to use for the text */
51
50
  locale?: string;
52
51
  }
53
- declare const Form: ({ content, userHasPermissions, meta, editorRef, placeholder, maxLength, forceShow, functions, gtmContext, }: IDiscussionForm) => import("react/jsx-runtime").JSX.Element;
52
+ declare const Form: ({ id, content, userHasPermissions, meta, placeholder, maxLength, forceShow, functions, gtmContext, }: IDiscussionForm) => import("react/jsx-runtime").JSX.Element;
54
53
  export default Form;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { MemberProps } from '../../../user';
2
3
  import { IDiscussionContent } from './../../discussion';
3
4
  interface Props {
@@ -25,5 +26,10 @@ interface Props {
25
26
  /** The language to use for the text */
26
27
  locale?: string;
27
28
  }
28
- declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, functions: { createLike, deleteLike }, }: Props) => import("react/jsx-runtime").JSX.Element;
29
+ declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, content, canLike, functions: { createLike, deleteLike }, }: Props) => React.DetailedReactHTMLElement<{
30
+ className: string;
31
+ onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
32
+ onMouseEnter: () => void;
33
+ onMouseLeave: () => void;
34
+ }, HTMLElement>;
29
35
  export default Likes;
@@ -1,3 +1,3 @@
1
1
  import { IFormProps } from './form.types';
2
- declare const Form: ({ fields, className, id: formId, formRef: ref, intlPath, button, secondaryActionButton, meta, gtm, functions: { onSuccess, onCancel, onCatch, onFailure, }, ...props }: IFormProps) => import("react/jsx-runtime").JSX.Element | null;
2
+ declare const Form: ({ element, fields, className, id: formId, formRef: ref, intlPath, button, secondaryActionButton, meta, gtm, functions: { onSuccess, onCancel, onCatch, onFailure, }, ...props }: IFormProps) => import("react/jsx-runtime").JSX.Element | null;
3
3
  export default Form;
@@ -174,6 +174,8 @@ export interface IFormProps {
174
174
  secondaryActionButton?: FormCancelButtonPropsType;
175
175
  /** The classes to add to the form */
176
176
  className?: string;
177
+ /** The type of element to render. This is in case we need to render a separate form inside the first, e.g. rendering the link form on the rich text editor inside the discussion form. */
178
+ element?: 'form' | 'fieldset';
177
179
  /** The fields to render in the form */
178
180
  fields: IField[];
179
181
  /** An optional `ref` for the form, in case we need to interact with it in another file */
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { Dispatch } from 'react';
2
2
  import { Point } from 'slate';
3
3
  declare const RichTextEditorContext: import("react").Context<{
4
4
  /** The id of the editor */
@@ -9,15 +9,11 @@ declare const RichTextEditorContext: import("react").Context<{
9
9
  setFocus: (option: string | null) => void;
10
10
  /** The tooltip that is currently open */
11
11
  openTooltip: string | null;
12
- /** The function to set the open tooltip */
13
- setOpenTooltip: (option: string | null) => void;
14
12
  /** Whether the link editor is open */
15
13
  showLinkEditor: boolean;
16
- /** The function to set the link editor */
17
- setShowLinkEditor: (open: boolean) => void;
18
14
  /** The last anchor point (used for Slate to know where the cursor is) */
19
15
  lastAnchor: Point | null;
20
- /** The function to set the last anchor */
21
- setLastAnchor: (anchor: Point | null) => void;
16
+ /** The function to update the state */
17
+ dispatch: Dispatch<any>;
22
18
  }>;
23
19
  export default RichTextEditorContext;
@@ -1 +1,2 @@
1
1
  export { default as BlockOption } from './block-option';
2
+ export * from './block-option.helpers';
@@ -1,5 +1,5 @@
1
1
  import { BaseEditor } from 'slate';
2
2
  export declare const isLinkActive: (editor: BaseEditor) => boolean;
3
- export declare const insertLink: (editor: BaseEditor, url: string) => void;
4
- export declare const wrapLink: (editor: BaseEditor, url: string) => void;
3
+ export declare const insertLink: (editor: BaseEditor, url: string, id: string) => void;
4
+ export declare const wrapLink: (editor: BaseEditor, url: string, id: string) => void;
5
5
  export declare const unwrapLink: (editor: BaseEditor) => void;
@@ -1,3 +1,5 @@
1
1
  import { BaseEditor } from 'slate';
2
+ import { MarkOptionType } from '../../../../../../../form/components/rich-text-editor/rich-text-editor.types';
3
+ export declare const isMarkOptionType: (value: string) => value is MarkOptionType;
2
4
  export declare const isMarkActive: (editor: BaseEditor, format: string) => boolean;
3
5
  export declare const toggleMark: (editor: BaseEditor, format: string) => void;
@@ -1,3 +1,3 @@
1
1
  export { default as Toolbar } from './toolbar';
2
2
  export * from './toolbar.data';
3
- export { toggleMark, wrapLink } from './components';
3
+ export { isMarkOptionType, toggleBlock, toggleMark, wrapLink } from './components';
@@ -0,0 +1,156 @@
1
+ export interface NodeTypes {
2
+ paragraph: string;
3
+ block_quote: string;
4
+ code_block: string;
5
+ link: string;
6
+ ul_list: string;
7
+ ol_list: string;
8
+ listItem: string;
9
+ heading: {
10
+ 1: string;
11
+ 2: string;
12
+ 3: string;
13
+ 4: string;
14
+ 5: string;
15
+ 6: string;
16
+ };
17
+ emphasis_mark: string;
18
+ strong_mark: string;
19
+ delete_mark: string;
20
+ inline_code_mark: string;
21
+ thematic_break: string;
22
+ image: string;
23
+ }
24
+ export type MdastNodeType = 'paragraph' | 'heading' | 'list' | 'listItem' | 'link' | 'image' | 'blockquote' | 'code' | 'html' | 'emphasis' | 'strong' | 'delete' | 'inlineCode' | 'thematicBreak' | 'text';
25
+ export declare const defaultNodeTypes: NodeTypes;
26
+ export interface LeafType {
27
+ text: string;
28
+ strikeThrough?: boolean;
29
+ bold?: boolean;
30
+ italic?: boolean;
31
+ code?: boolean;
32
+ parentType?: string;
33
+ }
34
+ export interface BlockType {
35
+ type: string;
36
+ parentType?: string;
37
+ link?: string;
38
+ caption?: string;
39
+ language?: string;
40
+ break?: boolean;
41
+ children: Array<BlockType | LeafType>;
42
+ }
43
+ export interface InputNodeTypes {
44
+ paragraph: string;
45
+ block_quote: string;
46
+ code_block: string;
47
+ link: string;
48
+ ul_list: string;
49
+ ol_list: string;
50
+ listItem: string;
51
+ heading: {
52
+ 1: string;
53
+ 2: string;
54
+ 3: string;
55
+ 4: string;
56
+ 5: string;
57
+ 6: string;
58
+ };
59
+ emphasis_mark: string;
60
+ strong_mark: string;
61
+ delete_mark: string;
62
+ inline_code_mark: string;
63
+ thematic_break: string;
64
+ image: string;
65
+ }
66
+ type RecursivePartial<T> = {
67
+ [P in keyof T]?: RecursivePartial<T[P]>;
68
+ };
69
+ export interface OptionType<T extends InputNodeTypes = InputNodeTypes> {
70
+ nodeTypes?: RecursivePartial<T>;
71
+ linkDestinationKey?: string;
72
+ imageSourceKey?: string;
73
+ imageCaptionKey?: string;
74
+ }
75
+ export interface MdastNode {
76
+ type?: MdastNodeType;
77
+ ordered?: boolean;
78
+ value?: string;
79
+ text?: string;
80
+ children?: Array<MdastNode>;
81
+ depth?: 1 | 2 | 3 | 4 | 5 | 6;
82
+ url?: string;
83
+ alt?: string;
84
+ lang?: string;
85
+ position?: any;
86
+ spread?: any;
87
+ checked?: any;
88
+ indent?: any;
89
+ }
90
+ export type TextNode = {
91
+ text?: string | undefined;
92
+ };
93
+ export type CodeBlockNode<T extends InputNodeTypes> = {
94
+ type: T['code_block'];
95
+ language: string | undefined;
96
+ children: Array<TextNode>;
97
+ };
98
+ export type HeadingNode<T extends InputNodeTypes> = {
99
+ type: T['heading'][1] | T['heading'][2] | T['heading'][3] | T['heading'][4] | T['heading'][5] | T['heading'][6];
100
+ children: Array<DeserializedNode<T>>;
101
+ };
102
+ export type ListNode<T extends InputNodeTypes> = {
103
+ type: T['ol_list'] | T['ul_list'];
104
+ children: Array<DeserializedNode<T>>;
105
+ };
106
+ export type ListItemNode<T extends InputNodeTypes> = {
107
+ type: T['listItem'];
108
+ children: Array<DeserializedNode<T>>;
109
+ };
110
+ export type ParagraphNode<T extends InputNodeTypes> = {
111
+ type: T['paragraph'];
112
+ break?: true;
113
+ children: Array<DeserializedNode<T>>;
114
+ };
115
+ export type LinkNode<T extends InputNodeTypes> = {
116
+ type: T['link'];
117
+ children: Array<DeserializedNode<T>>;
118
+ [urlKey: string]: string | undefined | Array<DeserializedNode<T>>;
119
+ };
120
+ export type ImageNode<T extends InputNodeTypes> = {
121
+ type: T['image'];
122
+ children: Array<DeserializedNode<T>>;
123
+ [sourceOrCaptionKey: string]: string | undefined | Array<DeserializedNode<T>>;
124
+ };
125
+ export type BlockQuoteNode<T extends InputNodeTypes> = {
126
+ type: T['block_quote'];
127
+ children: Array<DeserializedNode<T>>;
128
+ };
129
+ export type InlineCodeMarkNode<T extends InputNodeTypes> = {
130
+ type: T['inline_code_mark'];
131
+ children: Array<TextNode>;
132
+ language: string | undefined;
133
+ };
134
+ export type ThematicBreakNode<T extends InputNodeTypes> = {
135
+ type: T['thematic_break'];
136
+ children: Array<DeserializedNode<T>>;
137
+ };
138
+ export type ItalicNode<T extends InputNodeTypes> = {
139
+ [K in T['emphasis_mark']]: true;
140
+ } & {
141
+ children: TextNode;
142
+ };
143
+ export type BoldNode = {
144
+ bold: true;
145
+ children: TextNode;
146
+ };
147
+ export type StrikeThoughNode = {
148
+ strikeThrough: true;
149
+ children: TextNode;
150
+ };
151
+ export type InlineCodeNode = {
152
+ code: true;
153
+ text: string | undefined;
154
+ };
155
+ export type DeserializedNode<T extends InputNodeTypes> = CodeBlockNode<T> | HeadingNode<T> | ListNode<T> | ListItemNode<T> | ParagraphNode<T> | LinkNode<T> | ImageNode<T> | BlockQuoteNode<T> | InlineCodeMarkNode<T> | ThematicBreakNode<T> | ItalicNode<T> | BoldNode | StrikeThoughNode | InlineCodeNode | TextNode;
156
+ export {};
@@ -0,0 +1 @@
1
+ export * from './ast-types';
@@ -0,0 +1,3 @@
1
+ import { Descendant } from 'slate';
2
+ declare const deserialize: (node: string, callback?: (v: Descendant[]) => void) => void;
3
+ export default deserialize;
@@ -0,0 +1 @@
1
+ export { default as deserialize } from './deserialize';
@@ -0,0 +1,97 @@
1
+ export declare const html: {
2
+ paragraph: {
3
+ type: string;
4
+ children: {
5
+ text: string;
6
+ }[];
7
+ }[];
8
+ link: {
9
+ type: string;
10
+ children: ({
11
+ text: string;
12
+ type?: undefined;
13
+ link?: undefined;
14
+ children?: undefined;
15
+ } | {
16
+ type: string;
17
+ link: string;
18
+ children: {
19
+ text: string;
20
+ }[];
21
+ text?: undefined;
22
+ })[];
23
+ }[];
24
+ bold: {
25
+ type: string;
26
+ children: ({
27
+ text: string;
28
+ bold?: undefined;
29
+ } | {
30
+ bold: boolean;
31
+ text: string;
32
+ })[];
33
+ }[];
34
+ italic: {
35
+ type: string;
36
+ children: ({
37
+ text: string;
38
+ italic?: undefined;
39
+ } | {
40
+ italic: boolean;
41
+ text: string;
42
+ })[];
43
+ }[];
44
+ strikethrough: {
45
+ type: string;
46
+ children: ({
47
+ text: string;
48
+ strikeThrough?: undefined;
49
+ } | {
50
+ strikeThrough: boolean;
51
+ text: string;
52
+ })[];
53
+ }[];
54
+ blockquote: {
55
+ type: string;
56
+ children: {
57
+ type: string;
58
+ children: {
59
+ text: string;
60
+ }[];
61
+ }[];
62
+ }[];
63
+ ulList: {
64
+ type: string;
65
+ children: {
66
+ type: string;
67
+ children: {
68
+ type: string;
69
+ children: {
70
+ text: string;
71
+ }[];
72
+ }[];
73
+ }[];
74
+ }[];
75
+ olList: {
76
+ type: string;
77
+ children: {
78
+ type: string;
79
+ children: {
80
+ type: string;
81
+ children: {
82
+ text: string;
83
+ }[];
84
+ }[];
85
+ }[];
86
+ }[];
87
+ };
88
+ export declare const text: {
89
+ paragraph: string;
90
+ link: string;
91
+ bold: string;
92
+ italic: string;
93
+ strikethrough: string;
94
+ blockquote: string;
95
+ ulList: string;
96
+ olList: string;
97
+ };
@@ -0,0 +1,4 @@
1
+ declare const HOTKEYS: {
2
+ [key: string]: string;
3
+ };
4
+ export default HOTKEYS;
@@ -0,0 +1 @@
1
+ export { default as HOTKEYS } from './hot-keys';
@@ -0,0 +1,5 @@
1
+ export * from './ast-types';
2
+ export * from './deserialize';
3
+ export * from './hot-keys';
4
+ export * from './serialize';
5
+ export * from './transform';
@@ -0,0 +1,3 @@
1
+ import { Descendant } from 'slate';
2
+ declare const doSerialize: (value: Descendant[]) => string;
3
+ export default doSerialize;
@@ -0,0 +1,2 @@
1
+ export { default as serialize } from './serialize';
2
+ export { default as doSerialize } from './do-serialize';
@@ -0,0 +1,8 @@
1
+ import { BlockType, LeafType, NodeTypes } from './../ast-types';
2
+ interface Options {
3
+ nodeTypes: NodeTypes;
4
+ listDepth?: number;
5
+ ignoreParagraphNewline?: boolean;
6
+ }
7
+ export default function serialize(chunk: BlockType | LeafType, opts?: Options): string | undefined;
8
+ export {};
@@ -0,0 +1 @@
1
+ export { default as transform } from './transform';
@@ -0,0 +1,21 @@
1
+ import { BlockQuoteNode, CodeBlockNode, HeadingNode, ImageNode, InputNodeTypes, ItalicNode, LinkNode, ListItemNode, ListNode, MdastNode, OptionType, ParagraphNode, ThematicBreakNode } from './../ast-types';
2
+ export default function transform<T extends InputNodeTypes>(node: MdastNode, opts?: OptionType<T>): CodeBlockNode<T> | HeadingNode<T> | ListNode<T> | ListItemNode<T> | ParagraphNode<T> | LinkNode<T> | ImageNode<T> | BlockQuoteNode<T> | ThematicBreakNode<T> | ItalicNode<T> | {
3
+ type: string;
4
+ children: {
5
+ text: string;
6
+ }[];
7
+ } | {
8
+ value?: string | undefined;
9
+ position?: any;
10
+ url?: string | undefined;
11
+ alt?: string | undefined;
12
+ checked?: any;
13
+ ordered?: boolean | undefined;
14
+ depth?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
15
+ lang?: string | undefined;
16
+ spread?: any;
17
+ indent?: any;
18
+ text: string | undefined;
19
+ type?: undefined;
20
+ children?: undefined;
21
+ };
@@ -1,5 +1,5 @@
1
1
  import { BaseEditor } from 'slate';
2
2
  import { HistoryEditor } from 'slate-history';
3
3
  import { ReactEditor } from 'slate-react';
4
- declare const withInlines: (editor: BaseEditor & ReactEditor & HistoryEditor) => BaseEditor & ReactEditor & HistoryEditor;
4
+ declare const withInlines: (editor: BaseEditor & ReactEditor & HistoryEditor, id: string) => BaseEditor & ReactEditor & HistoryEditor;
5
5
  export default withInlines;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  interface Props {
3
2
  /** The id of the rich text editor */
4
3
  id?: string;
@@ -15,5 +14,5 @@ interface Props {
15
14
  /** Optional aria error message */
16
15
  'aria-errormessage'?: string;
17
16
  }
18
- declare const RichTextEditor: React.ForwardRefExoticComponent<Props & React.RefAttributes<string | null>>;
17
+ declare const RichTextEditor: ({ id, value, placeholder, onChange, autoFocus, ...props }: Props) => import("react/jsx-runtime").JSX.Element | null;
19
18
  export default RichTextEditor;
@@ -28,6 +28,12 @@ export interface ButtonPropsType {
28
28
  element?: string;
29
29
  /** The function the button should run when clicked */
30
30
  onClick?: false | ((e: React.MouseEvent<HTMLElement>) => void);
31
+ /** An optional function to call on focus */
32
+ onFocus?: () => void;
33
+ /** An optional function to call on blur */
34
+ onBlur?: () => void;
35
+ /** An optional function to call on keydown */
36
+ onKeyDown?: (e: React.KeyboardEvent<HTMLElement>) => void;
31
37
  /** Additional classes to add to the button */
32
38
  className?: string;
33
39
  /** `disabled` is usually true or false, but we will want nuance in some places, for example the ability
@@ -61,6 +67,6 @@ export interface ButtonPropsType {
61
67
  'data-testid'?: string;
62
68
  }
63
69
  declare const Button: ({ variant, size, styling, icon, href, element, onClick, className, disabled, screenreaderText, children, ...rest }: ButtonPropsType) => React.DOMElement<{
64
- [key: string]: string | boolean | addClasses.ArgumentArray | ((e: React.MouseEvent<HTMLElement>) => void) | React.RefObject<HTMLButtonElement>;
70
+ [key: string]: string | boolean | addClasses.ArgumentArray | (() => void) | ((e: React.KeyboardEvent<HTMLElement>) => void) | ((e: React.MouseEvent<HTMLElement>) => void) | React.RefObject<HTMLButtonElement>;
65
71
  }, Element>;
66
72
  export default Button;
@@ -2,6 +2,7 @@ export * from './buttons';
2
2
  export * from './divider';
3
3
  export * from './image-container';
4
4
  export * from './link';
5
+ export * from './portal';
5
6
  export * from './progress-tracker';
6
7
  export * from './responsive-image';
7
8
  export * from './return-to-nav-button';
@@ -10,12 +10,18 @@ interface Props {
10
10
  className?: string;
11
11
  /** Function to be called when clicked */
12
12
  onClick?: ((e?: React.MouseEvent<HTMLElement>) => void) | undefined;
13
+ /** Function to be called when focused */
14
+ onFocus?: ((e?: React.FocusEvent<HTMLElement>) => void) | undefined;
15
+ /** Function to be called when key is pressed */
16
+ onKeyDown?: ((e?: React.KeyboardEvent<HTMLElement>) => void) | undefined;
13
17
  /** GTM event context */
14
18
  gtmContext?: string;
15
19
  /** GTM event type */
16
20
  gtmType?: string;
17
21
  /** Target for link */
18
22
  target?: '_blank' | '_self' | '_parent' | '_top';
23
+ /** The tab index of the link, e.g. in case we're setting up event handlers to move the focus on arrow press and want to remove the default tabability of the link */
24
+ tabIndex?: number;
19
25
  /** Whether link should be disabled */
20
26
  disabled?: boolean;
21
27
  /** An ARIA label for the link */
@@ -0,0 +1 @@
1
+ export { default as Portal } from './portal';
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ declare const Portal: ({ children }: {
3
+ children?: ReactNode;
4
+ }) => import("react").ReactPortal | null;
5
+ export default Portal;
@@ -30,6 +30,8 @@ interface Props {
30
30
  };
31
31
  /** Whether the tooltip is hidden from screen readers or not */
32
32
  'aria-hidden'?: boolean;
33
+ /** The id of the tooltip */
34
+ id?: string;
33
35
  }
34
36
  declare const Tooltip: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement | null>>;
35
37
  export default Tooltip;
package/helpers/intl.d.ts CHANGED
@@ -132,6 +132,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
132
132
  discussion_likes_more: string;
133
133
  discussion_likes_like: string;
134
134
  discussion_likes_unlike: string;
135
+ discussion_likes_show: string;
135
136
  discussion_moreMenu_edit: string;
136
137
  discussion_moreMenu_delete: string;
137
138
  discussion_moreMenu_report: string;
@@ -301,6 +302,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
301
302
  footer_legal_terms: string;
302
303
  footer_legal_cookie: string;
303
304
  footer_legal_accessibility: string;
305
+ footer_legal_ai: string;
304
306
  footer_legal_dataProtection: string;
305
307
  footer_legal_euDataProtection: string;
306
308
  footer_contact: string;