@apolitical/component-library 6.6.14 → 6.6.15
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.
- package/form/components/form/form.types.d.ts +2 -0
- package/general/link/link.d.ts +8 -3
- package/general/portal/index.d.ts +1 -1
- package/general/portal/portal.d.ts +4 -3
- package/index.js +40 -40
- package/index.mjs +2858 -2845
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -223,6 +223,8 @@ export interface IFormMeta {
|
|
|
223
223
|
showSuccessMessage?: boolean | string;
|
|
224
224
|
/** Whether the form should show cancel button */
|
|
225
225
|
shouldShowCancelButton?: boolean;
|
|
226
|
+
/** Whether the form should scroll up when there are no errors */
|
|
227
|
+
shouldScrollOnSuccess?: boolean;
|
|
226
228
|
}
|
|
227
229
|
export interface IFormProps {
|
|
228
230
|
/** The form submit button */
|
package/general/link/link.d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
type LinkOnClick = ((e?: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
2
3
|
export interface ILinkProps {
|
|
3
4
|
/** URL for link */
|
|
4
5
|
href?: string | undefined;
|
|
5
6
|
/** Content to rendered */
|
|
6
7
|
children: JSX.Element | JSX.Element[] | string;
|
|
7
8
|
/** The element the content should be wrapped in, if it is not a link; nothing is rendered if it's undefined */
|
|
8
|
-
fallbackElement?: '
|
|
9
|
+
fallbackElement?: 'div' | 'li' | 'span' | 'strong';
|
|
9
10
|
/** Additonal classes */
|
|
10
11
|
className?: string;
|
|
11
12
|
/** Function to be called when clicked */
|
|
12
|
-
onClick?:
|
|
13
|
+
onClick?: LinkOnClick;
|
|
13
14
|
/** Function to be called when focused */
|
|
14
15
|
onFocus?: ((e?: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
15
16
|
/** Function to be called when key is pressed */
|
|
16
17
|
onKeyDown?: ((e?: React.KeyboardEvent<HTMLElement>) => void) | undefined;
|
|
18
|
+
meta?: {
|
|
19
|
+
/** Whether to force the onClick event to fire, even if the element is not a link */
|
|
20
|
+
forceOnClick?: boolean;
|
|
21
|
+
};
|
|
17
22
|
/** GTM event context */
|
|
18
23
|
gtmContext?: string;
|
|
19
24
|
/** GTM event type */
|
|
@@ -33,5 +38,5 @@ export interface ILinkProps {
|
|
|
33
38
|
/** Data attributes for the link */
|
|
34
39
|
'data-before'?: string;
|
|
35
40
|
}
|
|
36
|
-
declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: ILinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare const Link: ({ href, children, fallbackElement, meta, className, onClick, gtmContext, gtmType, ...props }: ILinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
42
|
export default Link;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Portal } from './portal';
|
|
1
|
+
export { default as Portal, type IPortalProps } from './portal';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
parent?:
|
|
2
|
+
export interface IPortalProps {
|
|
3
|
+
parent?: HTMLElement | Element | DocumentFragment;
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
declare const Portal: ({ parent, children }: IPortalProps) => import("react").ReactPortal | null;
|
|
6
7
|
export default Portal;
|