@apolitical/component-library 5.5.3-jc.0 → 5.5.4-SW.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 | null | string);
16
+ export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean);
17
17
  export interface IFieldOption {
18
18
  /** The ID of the option */
19
19
  id: string;
@@ -1,3 +1,2 @@
1
- export { default as PasswordForm } from './password-form';
2
- export type { IPasswordFormProps } from './password-form';
1
+ export { default as PasswordForm, type IPasswordFormProps } from './password-form';
3
2
  export * from './helper';
@@ -1,12 +1,24 @@
1
1
  import React from 'react';
2
- import type { IFormProps, IFormValues } from '../../components/form/form.types';
3
- export interface IPasswordFormProps extends Omit<IFormProps, 'id' | 'fields'> {
2
+ import { FormValues, IFormValues } from '../../components/form/form.types';
3
+ export interface IPasswordFormProps {
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: IFormProps['functions'] & {
7
+ 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
+ };
19
+ /** Specify custom text for the submit button */
20
+ button?: {
21
+ text: string;
10
22
  };
11
23
  }
12
24
  declare const PasswordForm: React.FC<IPasswordFormProps>;
@@ -1,5 +1,7 @@
1
1
  import type { IFormValues, IFormMeta } from './../../components/form/form.types';
2
2
  export interface IProfileFormProps<OnSuccessArgs = IFormValues> {
3
+ /** Indicated for whether to the form is for creating the profile */
4
+ isCreateProfile?: boolean;
3
5
  /** The hooks used in the form */
4
6
  hooks: {
5
7
  /** The hook to predict the user's location */
@@ -16,7 +18,7 @@ export interface IProfileFormProps<OnSuccessArgs = IFormValues> {
16
18
  /** The functions to call */
17
19
  functions: {
18
20
  /** The function to upload the user's profile image */
19
- uploadImage: () => Promise<unknown>;
21
+ uploadImage?: () => Promise<unknown>;
20
22
  /** The function to call on success */
21
23
  onSuccess?: (data: OnSuccessArgs) => Promise<void>;
22
24
  /** The function to call when the form is cancelled, e.g. the user presses a cancel button */
@@ -31,6 +33,10 @@ export interface IProfileFormProps<OnSuccessArgs = IFormValues> {
31
33
  context?: string;
32
34
  event?: string;
33
35
  };
36
+ /** Specify custom text for the submit button */
37
+ button?: {
38
+ text: string;
39
+ };
34
40
  }
35
- declare const ProfileForm: ({ hooks, functions, meta, gtm }: IProfileFormProps) => import("react/jsx-runtime").JSX.Element;
41
+ declare const ProfileForm: ({ isCreateProfile, hooks, functions, meta, gtm, ...props }: IProfileFormProps) => import("react/jsx-runtime").JSX.Element;
36
42
  export default ProfileForm;
@@ -1 +1 @@
1
- export { default as ProgressTracker } from './progress-tracker';
1
+ export { default as ProgressTracker, type INavigationDotsProps as IProgressTrackerProps, } from './progress-tracker';
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- interface Props {
2
+ export interface INavigationDotsProps {
3
3
  /** The current step */
4
4
  currentStep?: number;
5
5
  /** The total number of steps */
6
6
  steps?: number;
7
7
  }
8
- declare const NavigationDots: React.FC<Props>;
8
+ declare const NavigationDots: React.FC<INavigationDotsProps>;
9
9
  export default NavigationDots;