@apolitical/component-library 2.0.4-4125.1 → 2.0.4

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.
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { ResponsiveImageType } from '../../general';
3
+ export type HighlightSectionProps = {
4
+ /** The content to display */
5
+ content: string | React.ReactNode;
6
+ /** Additional className */
7
+ className?: string;
8
+ /** How to align the image, left or right. Defaults to left */
9
+ alignImage?: 'left' | 'right';
10
+ /** The image to display */
11
+ image?: ResponsiveImageType;
12
+ };
13
+ declare const _default: import("react").MemoExoticComponent<({ alignImage, className, content, image, }: HighlightSectionProps) => import("react/jsx-runtime").JSX.Element>;
14
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as HighlightSection } from './highlight-section';
@@ -1,2 +1,3 @@
1
1
  export * from './banner-section';
2
+ export * from './highlight-section';
2
3
  export * from './marketing-block';
@@ -1,3 +1,3 @@
1
1
  import { IFormProps } from './form.types';
2
- declare const Form: ({ fields, className, id: formId, formRef: ref, intlPath, button, cancelButton, meta: { shouldShowCancelButton, shouldReset, showRequiredLabels, showSuccessMessage }, gtm, functions: { onSuccess, onCancel, onCatch, onFailure }, ...props }: IFormProps) => import("react/jsx-runtime").JSX.Element | null;
2
+ declare const Form: ({ fields, className, id: formId, formRef: ref, intlPath, button, meta: { shouldReset, showRequiredLabels }, gtm, functions: { onSuccess, onCatch, onFailure }, ...props }: IFormProps) => import("react/jsx-runtime").JSX.Element | null;
3
3
  export default Form;
@@ -39,7 +39,7 @@ export interface IFormPayload {
39
39
  /** Function to call when everything succeeds */
40
40
  onSuccess?: (arg: IFormValues) => void;
41
41
  /** Function to call when something fails */
42
- onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
42
+ onFailure?: (arg: IFormValues) => void;
43
43
  }
44
44
  export interface IFormReducerAction extends IReducerAction<IFormPayload> {
45
45
  }
@@ -136,10 +136,6 @@ export interface IField {
136
136
  /** The value of the field */
137
137
  value?: FormValues;
138
138
  }
139
- export interface FormCancelButtonPropsType extends ButtonPropsType {
140
- /** The text to show on the button */
141
- text?: string;
142
- }
143
139
  export interface FormButtonPropsType extends ButtonPropsType {
144
140
  /** A custom component to render when the form is submitting */
145
141
  customOnSubmit?: React.ReactNode | false;
@@ -147,10 +143,8 @@ export interface FormButtonPropsType extends ButtonPropsType {
147
143
  text?: string;
148
144
  }
149
145
  export interface IFormProps {
150
- /** The form submit button */
146
+ /** The button to render at the bottom of the form */
151
147
  button?: FormButtonPropsType;
152
- /** The button to cancel the form (can be used to redirects user to another url or close modal) */
153
- cancelButton?: FormCancelButtonPropsType;
154
148
  /** The classes to add to the form */
155
149
  className?: string;
156
150
  /** The fields to render in the form */
@@ -162,11 +156,9 @@ export interface IFormProps {
162
156
  /** The function to call when onSuccess fails */
163
157
  onCatch?: (error?: unknown) => void;
164
158
  /** The function to call when the form submission fails */
165
- onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
159
+ onFailure?: (arg: IFormValues) => void;
166
160
  /** The function to call when the form is successfully submitted */
167
- onSuccess?: (arg: IFormValues) => Promise<void>;
168
- /** The function to call when the cancel button is clicked */
169
- onCancel?: () => void;
161
+ onSuccess?: (arg: IFormValues) => void;
170
162
  };
171
163
  /** The Google Tag Manager data to be passed to the field */
172
164
  gtm?: {
@@ -185,10 +177,6 @@ export interface IFormProps {
185
177
  shouldReset?: boolean;
186
178
  /** Whether the form should show required labels */
187
179
  showRequiredLabels?: boolean;
188
- /** Whether the form should show success message*/
189
- showSuccessMessage?: boolean | string;
190
- /** Whether the form should show cancel button */
191
- shouldShowCancelButton?: boolean;
192
180
  };
193
181
  }
194
182
  export interface IFieldWrapper extends IField {
@@ -4,7 +4,7 @@ interface IContactFormProps {
4
4
  event?: string;
5
5
  };
6
6
  functions: {
7
- onSuccess?: () => Promise<void>;
7
+ onSuccess?: () => void;
8
8
  onFailure?: () => void;
9
9
  };
10
10
  }
@@ -1,9 +1 @@
1
1
  export declare const valueIsNotEmpty: (value: string) => boolean;
2
- export declare const passwordValidator: (password: string) => {
3
- isValid: boolean;
4
- matchingRules: {
5
- isMoreThanEightCharacters: boolean;
6
- includesNumberAndSymbol: boolean;
7
- includesLowerAndUppercase: boolean;
8
- };
9
- };
package/index.d.ts CHANGED
@@ -18,4 +18,3 @@ export * from './sections';
18
18
  export * from './text';
19
19
  export * from './user';
20
20
  export * from './helpers/prerender';
21
- export { passwordValidator } from './helpers';