@apolitical/component-library 6.1.3 → 6.2.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.
@@ -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,20 +1,12 @@
1
1
  import React from 'react';
2
- import { FormValues, IFormValues } from '../../components/form/form.types';
3
- export interface IPasswordFormProps {
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
  /** Specify custom text for the submit button */
20
12
  button?: {
package/helpers/intl.d.ts CHANGED
@@ -171,7 +171,6 @@ export declare const checkIntlPathExists: (path: string, language?: {
171
171
  discussion_moreMenu_report: string;
172
172
  discussion_comments_screenReader: string;
173
173
  discussion_comments: string;
174
- discussion_comments_loading: string;
175
174
  discussion_responses_answer: string;
176
175
  discussion_responses_comment: string;
177
176
  discussion_responses_title: string;