@apolitical/component-library 4.1.0-beta.4 → 4.1.0-beta.6

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.
@@ -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;
@@ -31,6 +31,5 @@ declare const Likes: ({ element, likes, peopleWhoLiked, isShort, userLiked, cont
31
31
  onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
32
32
  onMouseEnter: () => void;
33
33
  onMouseLeave: () => void;
34
- onBlur: () => void;
35
34
  }, HTMLElement>;
36
35
  export default Likes;
@@ -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,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;
@@ -12,12 +12,16 @@ interface Props {
12
12
  onClick?: ((e?: React.MouseEvent<HTMLElement>) => void) | undefined;
13
13
  /** Function to be called when focused */
14
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;
15
17
  /** GTM event context */
16
18
  gtmContext?: string;
17
19
  /** GTM event type */
18
20
  gtmType?: string;
19
21
  /** Target for link */
20
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;
21
25
  /** Whether link should be disabled */
22
26
  disabled?: boolean;
23
27
  /** An ARIA label for the link */
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;