@apolitical/component-library 5.5.3-bht.0 → 5.5.3-jc.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.
- package/form/components/form/form.types.d.ts +1 -1
- package/form/types/password-form/index.d.ts +1 -0
- package/form/types/password-form/password-form.d.ts +4 -12
- package/package.json +1 -1
- package/text/pill/index.d.ts +1 -0
- package/text/pill/pill.d.ts +2 -2
- package/text/status-banner/index.d.ts +1 -0
- package/text/status-banner/status-banner.d.ts +2 -2
|
@@ -13,7 +13,7 @@ export interface ILabel {
|
|
|
13
13
|
htmlFor?: string;
|
|
14
14
|
}
|
|
15
15
|
export type FormActionTypes = 'addError' | 'formSubmitted' | 'formSubmittedAndReset' | 'removeError' | 'submitForm' | 'updateValue';
|
|
16
|
-
export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean);
|
|
16
|
+
export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean | null | string);
|
|
17
17
|
export interface IFieldOption {
|
|
18
18
|
/** The ID of the option */
|
|
19
19
|
id: string;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
2
|
+
import type { IFormProps, IFormValues } from '../../components/form/form.types';
|
|
3
|
+
export interface IPasswordFormProps extends Omit<IFormProps, 'id' | 'fields'> {
|
|
4
4
|
/** Indicated for whether to show the current password field */
|
|
5
5
|
isPasswordChange?: boolean;
|
|
6
6
|
/** The functions being passed to the form */
|
|
7
|
-
functions: {
|
|
7
|
+
functions: IFormProps['functions'] & {
|
|
8
8
|
/** The function to call to create the password */
|
|
9
9
|
createPassword: (arg: IFormValues) => Promise<void>;
|
|
10
|
-
/** The function to call when onSuccess fails */
|
|
11
|
-
onCatch?: (error?: unknown) => void;
|
|
12
|
-
/** The function to call when the form submission fails */
|
|
13
|
-
onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
|
|
14
|
-
/** The function to call when the form is successfully submitted */
|
|
15
|
-
onSuccess?: (arg: IFormValues) => Promise<void>;
|
|
16
|
-
/** The function to call when the cancel button is clicked */
|
|
17
|
-
onCancel?: () => void;
|
|
18
10
|
};
|
|
19
11
|
}
|
|
20
|
-
declare const PasswordForm: React.FC<
|
|
12
|
+
declare const PasswordForm: React.FC<IPasswordFormProps>;
|
|
21
13
|
export default PasswordForm;
|
package/package.json
CHANGED
package/text/pill/index.d.ts
CHANGED
package/text/pill/pill.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
export interface IPillProps {
|
|
3
3
|
/** The element to render the pill as; defaults to span. */
|
|
4
4
|
element?: 'span' | 'li';
|
|
5
5
|
/** The size of the pill */
|
|
@@ -17,7 +17,7 @@ interface Props {
|
|
|
17
17
|
/** Optional test ID */
|
|
18
18
|
'data-testid'?: string;
|
|
19
19
|
}
|
|
20
|
-
declare const Pill: ({ size, variant, className, icon, tooltip, children, element, ...props }:
|
|
20
|
+
declare const Pill: ({ size, variant, className, icon, tooltip, children, element, ...props }: IPillProps) => React.DetailedReactHTMLElement<{
|
|
21
21
|
className: string;
|
|
22
22
|
}, HTMLElement>;
|
|
23
23
|
export default Pill;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
export interface IStatusBannerProps {
|
|
3
3
|
/** The element that will render around the content */
|
|
4
4
|
element?: 'span' | 'small' | 'strong' | 'em' | 'p' | 'li';
|
|
5
5
|
/** The content to be hidden from screen readers */
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
/** Test ID for Jest tests */
|
|
12
12
|
'data-testid'?: string;
|
|
13
13
|
}
|
|
14
|
-
declare const StatusBanner: ({ element, children, className, ...props }:
|
|
14
|
+
declare const StatusBanner: ({ element, children, className, ...props }: IStatusBannerProps) => React.DetailedReactHTMLElement<{
|
|
15
15
|
className: string;
|
|
16
16
|
'aria-live': "assertive";
|
|
17
17
|
/** Optional ID, for errors */
|