@apolitical/component-library 6.0.4 → 6.1.0-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.
@@ -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
@@ -345,6 +345,10 @@ export declare const checkIntlPathExists: (path: string, language?: {
345
345
  signup_submitting: string;
346
346
  signup_success_title: string;
347
347
  signup_success_text: string;
348
+ poll_instructions: string;
349
+ poll_num_votes: string;
350
+ poll_remove_vote_button: string;
351
+ poll_aria_votes: string;
348
352
  tableOfContents: string;
349
353
  timeToComplete_hours: string;
350
354
  timeToComplete_hours_short: string;
package/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './mappers';
16
16
  export * from './modals';
17
17
  export * from './navigation';
18
18
  export * from './pages';
19
+ export * from './polls';
19
20
  export * from './sections';
20
21
  export * from './text';
21
22
  export * from './user';