@apolitical/component-library 3.0.1-ac.0 → 3.0.2-ac.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.
@@ -27,7 +27,7 @@ export declare const Checkbox: ({ className, disabled, element, functions: allFu
27
27
  options?: import("../../../form.types").IFieldOption[] | undefined;
28
28
  placeholder?: string | undefined;
29
29
  props?: {
30
- [key: string]: string | boolean | React.RefObject<any> | (() => void);
30
+ [key: string]: string | boolean | object | React.RefObject<any> | (() => void);
31
31
  } | undefined;
32
32
  required?: boolean | undefined;
33
33
  validation?: import("../../../form.types").IFieldValidation[] | undefined;
@@ -35,7 +35,7 @@ export declare const Input: ({ className, element, id, inputRef: ref, functions,
35
35
  } | undefined;
36
36
  options?: import("../../../form.types").IFieldOption[] | undefined;
37
37
  props?: {
38
- [key: string]: string | boolean | React.RefObject<any> | (() => void);
38
+ [key: string]: string | boolean | object | React.RefObject<any> | (() => void);
39
39
  } | undefined;
40
40
  required?: boolean | undefined;
41
41
  shownValue?: InputValues | undefined;
@@ -5,7 +5,7 @@ import { IntlShape } from 'react-intl';
5
5
  export type InputValues = string | number | boolean | null;
6
6
  export type MultipleInputValues = InputValues[];
7
7
  export type FormValues = InputValues | MultipleInputValues | undefined;
8
- export type InputTypes = 'text' | 'textarea' | 'email' | 'checkbox' | 'select' | 'radio' | 'password' | 'autocomplete';
8
+ export type InputTypes = 'text' | 'textarea' | 'email' | 'checkbox' | 'select' | 'radio' | 'password' | 'autocomplete' | 'number';
9
9
  export interface ILabel {
10
10
  /** The element to be used, defaulting to `label` */
11
11
  element?: string;
@@ -134,7 +134,7 @@ export interface IField {
134
134
  placeholder?: string;
135
135
  /** Additional props to be passed to the field */
136
136
  props?: {
137
- [key: string]: string | boolean | (() => void) | React.RefObject<any>;
137
+ [key: string]: string | boolean | object | (() => void) | React.RefObject<any>;
138
138
  };
139
139
  /** Whether the field is required */
140
140
  required?: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- type MatchingRules = {
2
+ export type MatchingRules = {
3
3
  isMoreThanEightCharacters: boolean;
4
4
  includesNumberAndSymbol: boolean;
5
5
  includesLowerAndUppercase: boolean;
@@ -1,4 +1,5 @@
1
1
  export * from './contact-form';
2
2
  export * from './invite-form';
3
+ export * from './password-form';
3
4
  export * from './search-form';
4
5
  export * from './signup-form';
@@ -0,0 +1 @@
1
+ export function generateConditions(conditions: any): any;
@@ -0,0 +1,2 @@
1
+ export { default as PasswordForm } from './password-form';
2
+ export * from './helper';
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { FormValues, IFormValues } from '../../components/form/form.types';
3
+ interface Props {
4
+ /** Indicated for whether to show the current password field */
5
+ isPasswordChange?: boolean;
6
+ /** The functions being passed to the form */
7
+ functions: {
8
+ /** The function to call when onSuccess fails */
9
+ onCatch?: (error?: unknown) => void;
10
+ /** The function to call when the form submission fails */
11
+ onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
12
+ /** The function to call when the form is successfully submitted */
13
+ onSuccess?: (arg: IFormValues) => Promise<void>;
14
+ /** The function to call when the cancel button is clicked */
15
+ onCancel?: () => void;
16
+ };
17
+ }
18
+ declare const PasswordForm: React.FC<Props>;
19
+ export default PasswordForm;