@apolitical/component-library 2.0.2-ac.30 → 2.0.2-ac.32

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.
Files changed (34) hide show
  1. package/banners/highlight-section/highlight-section.d.ts +14 -0
  2. package/banners/highlight-section/index.d.ts +1 -0
  3. package/banners/index.d.ts +1 -0
  4. package/discussion/components/responses-heading/responses-heading.d.ts +1 -1
  5. package/discussion/discussion.mock.d.ts +4 -0
  6. package/discussion/sections/activity-section/mocks/activity-section.mock.d.ts +3 -0
  7. package/discussion/shared/interfaces/user.interface.d.ts +3 -0
  8. package/form/components/form/form.d.ts +1 -1
  9. package/form/components/form/form.types.d.ts +16 -4
  10. package/form/types/contact-form/contact-form.d.ts +1 -1
  11. package/general/return-to-nav-button/return-to-nav-button.d.ts +3 -0
  12. package/helpers/index.d.ts +1 -0
  13. package/helpers/inline-styling.d.ts +2 -0
  14. package/helpers/validation.d.ts +8 -0
  15. package/index.d.ts +1 -0
  16. package/index.js +19 -19
  17. package/index.mjs +2730 -2548
  18. package/layout/content-layout/contact-footer/contact-footer.d.ts +1 -1
  19. package/layout/page-layout/page-layout.d.ts +1 -1
  20. package/package.json +1 -1
  21. package/sections/edit-section/edit-section.d.ts +33 -0
  22. package/sections/edit-section/index.d.ts +1 -0
  23. package/sections/index.d.ts +1 -0
  24. package/style.css +1 -1
  25. package/styles/variables/colors/theme/_banners.scss +2 -0
  26. package/styles/variables/colors/theme/_form.scss +5 -0
  27. package/styles/variables/colors/theme/_general.scss +5 -0
  28. package/styles/variables/colors/theme/_layout.scss +1 -0
  29. package/styles/variables/colors/theme/_text.scss +1 -0
  30. package/text/index.d.ts +1 -0
  31. package/text/markdown-text/markdown-text.d.ts +3 -1
  32. package/text/pill/pill.d.ts +1 -1
  33. package/text/testimonial-block/index.d.ts +1 -0
  34. package/text/testimonial-block/testimonial-block.d.ts +11 -0
@@ -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';
@@ -2,7 +2,7 @@ interface Props {
2
2
  /** The type of response */
3
3
  type?: 'answer' | 'comment';
4
4
  /** The number of responses to show */
5
- responses: number;
5
+ responses: number | string;
6
6
  /** The language to use for the text */
7
7
  locale?: string;
8
8
  }
@@ -5,6 +5,10 @@ export namespace authors {
5
5
  namespace image {
6
6
  let thumbnail: string;
7
7
  }
8
+ let jobTitle: string;
9
+ namespace location {
10
+ let country: string;
11
+ }
8
12
  }
9
13
  namespace otherUser {
10
14
  let id_1: string;
@@ -7,6 +7,9 @@ export declare const activitySectionMock: {
7
7
  jobTitle: string;
8
8
  name: string;
9
9
  organization: string;
10
+ location: {
11
+ country: string;
12
+ };
10
13
  };
11
14
  };
12
15
  content: string;
@@ -4,6 +4,9 @@ export interface IUser extends EnrichedUser {
4
4
  name?: string;
5
5
  organization?: string;
6
6
  jobTitle?: string;
7
+ location?: {
8
+ country?: string;
9
+ };
7
10
  thumbnail?: string;
8
11
  };
9
12
  }
@@ -1,3 +1,3 @@
1
1
  import { IFormProps } from './form.types';
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;
2
+ declare const Form: ({ fields, className, id: formId, formRef: ref, intlPath, button, secondaryActionButton, meta: { shouldShowCancelButton, shouldReset, showRequiredLabels, showSuccessMessage }, gtm, functions: { onSuccess, onCancel, 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) => void;
42
+ onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
43
43
  }
44
44
  export interface IFormReducerAction extends IReducerAction<IFormPayload> {
45
45
  }
@@ -145,6 +145,10 @@ export interface IField {
145
145
  /** The value of the field */
146
146
  value?: FormValues;
147
147
  }
148
+ export interface FormCancelButtonPropsType extends ButtonPropsType {
149
+ /** The text to show on the button */
150
+ text?: string;
151
+ }
148
152
  export interface FormButtonPropsType extends ButtonPropsType {
149
153
  /** A custom component to render when the form is submitting */
150
154
  customOnSubmit?: React.ReactNode | false;
@@ -154,8 +158,10 @@ export interface FormButtonPropsType extends ButtonPropsType {
154
158
  hideButton?: boolean;
155
159
  }
156
160
  export interface IFormProps {
157
- /** The button to render at the bottom of the form */
161
+ /** The form submit button */
158
162
  button?: FormButtonPropsType;
163
+ /** The button to cancel the form (can be used to redirects user to another url or close modal) */
164
+ secondaryActionButton?: FormCancelButtonPropsType;
159
165
  /** The classes to add to the form */
160
166
  className?: string;
161
167
  /** The fields to render in the form */
@@ -167,9 +173,11 @@ export interface IFormProps {
167
173
  /** The function to call when onSuccess fails */
168
174
  onCatch?: (error?: unknown) => void;
169
175
  /** The function to call when the form submission fails */
170
- onFailure?: (arg: IFormValues) => void;
176
+ onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
171
177
  /** The function to call when the form is successfully submitted */
172
- onSuccess?: (arg: IFormValues) => void;
178
+ onSuccess?: (arg: IFormValues) => Promise<void>;
179
+ /** The function to call when the cancel button is clicked */
180
+ onCancel?: () => void;
173
181
  };
174
182
  /** The Google Tag Manager data to be passed to the field */
175
183
  gtm?: {
@@ -188,6 +196,10 @@ export interface IFormProps {
188
196
  shouldReset?: boolean;
189
197
  /** Whether the form should show required labels */
190
198
  showRequiredLabels?: boolean;
199
+ /** Whether the form should show success message*/
200
+ showSuccessMessage?: boolean | string;
201
+ /** Whether the form should show cancel button */
202
+ shouldShowCancelButton?: boolean;
191
203
  };
192
204
  }
193
205
  export interface IFieldWrapper extends IField {
@@ -4,7 +4,7 @@ interface IContactFormProps {
4
4
  event?: string;
5
5
  };
6
6
  functions: {
7
- onSuccess?: () => void;
7
+ onSuccess?: () => Promise<void>;
8
8
  onFailure?: () => void;
9
9
  };
10
10
  }
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
+ /** Id of the element to scroll to */
3
4
  elementId: string;
5
+ /** Offset from the top of the element to scroll to */
6
+ offset?: number;
4
7
  }
5
8
  declare const ReturnToNavButton: React.FC<Props>;
6
9
  export default ReturnToNavButton;
@@ -1,6 +1,7 @@
1
1
  export { default as basicReducer } from './basic-reducer';
2
2
  export * from './breakpoints';
3
3
  export * from './cases';
4
+ export * from './inline-styling';
4
5
  export * from './dates';
5
6
  export { default as delay } from './delay';
6
7
  export * from './in-development';
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function generateCssIcon(icon: string | undefined): React.CSSProperties;
@@ -1 +1,9 @@
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,3 +18,4 @@ export * from './sections';
18
18
  export * from './text';
19
19
  export * from './user';
20
20
  export * from './helpers/prerender';
21
+ export { passwordValidator } from './helpers';