@apolitical/component-library 4.5.11-beta.1 → 4.5.11-beta.100

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 (28) hide show
  1. package/context/user/user.context.d.ts +3 -10
  2. package/form/components/form/form.types.d.ts +12 -13
  3. package/form/components/form/index.d.ts +1 -1
  4. package/form/components/profile-image-change/profile-image-change.d.ts +7 -20
  5. package/form/types/index.d.ts +0 -1
  6. package/helpers/intl.d.ts +6 -20
  7. package/index.js +63 -63
  8. package/index.mjs +7931 -8169
  9. package/modals/{types/discussion-form-modal → discussion-form-modal}/discussion-form-modal.d.ts +1 -1
  10. package/modals/index.d.ts +4 -2
  11. package/modals/{components/overlay → overlay}/overlay.d.ts +1 -1
  12. package/package.json +1 -1
  13. package/sections/edit-section/edit-section.d.ts +2 -4
  14. package/style.css +1 -1
  15. package/user/profile-picture/profile-picture.d.ts +1 -3
  16. package/form/types/profile-form/index.d.ts +0 -1
  17. package/form/types/profile-form/profile-form.d.ts +0 -25
  18. package/modals/components/index.d.ts +0 -2
  19. package/modals/types/index.d.ts +0 -3
  20. package/modals/types/profile-modal/index.d.ts +0 -1
  21. package/modals/types/profile-modal/profile-modal.d.ts +0 -25
  22. /package/modals/{types/discussion-form-modal → discussion-form-modal}/index.d.ts +0 -0
  23. /package/modals/{types/invite-modal → invite-modal}/index.d.ts +0 -0
  24. /package/modals/{types/invite-modal → invite-modal}/invite-modal.d.ts +0 -0
  25. /package/modals/{components/modal → modal}/index.d.ts +0 -0
  26. /package/modals/{components/modal → modal}/modal.d.ts +0 -0
  27. /package/modals/{components/overlay → overlay}/index.d.ts +0 -0
  28. /package/modals/{components/overlay → overlay}/overlay.helpers.d.ts +0 -0
@@ -1,19 +1,12 @@
1
1
  /// <reference types="react" />
2
- export interface IUserDetailsImage {
3
- thumbnail?: string;
4
- full?: string;
5
- }
6
- export interface IUserDetailsLocation {
7
- country?: string;
8
- }
9
2
  export interface IUserDetails {
10
3
  id?: string;
11
4
  name?: string;
12
- image?: IUserDetailsImage;
5
+ image?: {
6
+ thumbnail?: string;
7
+ };
13
8
  organization?: string;
14
9
  jobTitle?: string;
15
- location?: IUserDetailsLocation;
16
- biography?: string;
17
10
  }
18
11
  export interface IUserContext extends IUserDetails {
19
12
  isLoading: boolean;
@@ -173,18 +173,6 @@ export interface FormButtonPropsType extends ButtonPropsType {
173
173
  /** The option to not have the submit button at all */
174
174
  hideButton?: boolean;
175
175
  }
176
- export interface IFormMeta {
177
- /** Whether the form should reset after submission */
178
- shouldReset?: boolean;
179
- /** Whether the form should hide after submission */
180
- shouldHide?: boolean;
181
- /** Whether the form should show required labels */
182
- showRequiredLabels?: boolean;
183
- /** Whether the form should show success message*/
184
- showSuccessMessage?: boolean | string;
185
- /** Whether the form should show cancel button */
186
- shouldShowCancelButton?: boolean;
187
- }
188
176
  export interface IFormProps {
189
177
  /** The form submit button */
190
178
  button?: FormButtonPropsType;
@@ -221,7 +209,18 @@ export interface IFormProps {
221
209
  /** The internationalisation path for text in the form */
222
210
  intlPath?: string | false;
223
211
  /** Data about the form */
224
- meta?: IFormMeta;
212
+ meta?: {
213
+ /** Whether the form should reset after submission */
214
+ shouldReset?: boolean;
215
+ /** Whether the form should hide after submission */
216
+ shouldHide?: boolean;
217
+ /** Whether the form should show required labels */
218
+ showRequiredLabels?: boolean;
219
+ /** Whether the form should show success message*/
220
+ showSuccessMessage?: boolean | string;
221
+ /** Whether the form should show cancel button */
222
+ shouldShowCancelButton?: boolean;
223
+ };
225
224
  /** Optional children */
226
225
  children?: React.ReactNode;
227
226
  /** An ID for jest tests */
@@ -1,2 +1,2 @@
1
1
  export { default as Form } from './form';
2
- export type { IField, FormValues, IFormMeta } from './form.types';
2
+ export type { IField, FormValues } from './form.types';
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import type { IUserDetailsImage } from '../../../context';
3
2
  interface IUploadImageResponse {
4
3
  thumbnailURL: string;
5
4
  originalURL: string;
6
5
  }
7
- type TSetUserImage = (value: React.SetStateAction<IUserDetailsImage>) => void;
6
+ type TSetUserImage = (value: React.SetStateAction<IUploadImageResponse>) => void;
8
7
  interface IUploadImageProps {
9
8
  fileObject: File;
10
9
  userId: string;
@@ -16,24 +15,12 @@ interface Props {
16
15
  userId: string;
17
16
  /** User name */
18
17
  userName: string;
19
- /** Image data */
20
- src?: IUserDetailsImage;
18
+ /** Thumbnail image */
19
+ src?: string;
21
20
  /** Function to upload the image */
22
- uploadImage: ({ fileObject, userId, }: IUploadImageProps) => Promise<IUploadImageResponse>;
23
- /** Button props */
24
- button?: {
25
- /** Text for the button */
26
- text?: {
27
- /** Text to upload an image for the first time */
28
- upload?: string;
29
- /** Text to change the image */
30
- change?: string;
31
- /** Text to show while the image is being uploaded */
32
- uploading?: string;
33
- };
34
- };
35
- /** Callback function to update state in the parent file */
36
- callback: TSetUserImage;
21
+ uploadImage: ({ fileObject, userId }: IUploadImageProps) => Promise<IUploadImageResponse>;
22
+ /** Function to set the profile info */
23
+ setUserImage: TSetUserImage;
37
24
  }
38
- declare function ProfileImageChange({ className, userId, userName, src, uploadImage, button, callback, }: Props): import("react/jsx-runtime").JSX.Element;
25
+ declare function ProfileImageChange({ className, userId, userName, src, setUserImage, uploadImage, }: Props): import("react/jsx-runtime").JSX.Element;
39
26
  export default ProfileImageChange;
@@ -1,6 +1,5 @@
1
1
  export * from './contact-form';
2
2
  export * from './invite-form';
3
3
  export * from './password-form';
4
- export * from './profile-form';
5
4
  export * from './search-form';
6
5
  export * from './signup-form';
package/helpers/intl.d.ts CHANGED
@@ -233,22 +233,10 @@ export declare const checkIntlPathExists: (path: string, language?: {
233
233
  passwordRules_currentPassword_label: string;
234
234
  passwordRules_newPassword_label: string;
235
235
  passwordRules_confirmPassword_label: string;
236
- profileForm_image: string;
237
- profileForm_name: string;
238
- profileForm_name_placeholder: string;
239
- profileForm_jobTitle: string;
240
- profileForm_jobTitle_placeholder: string;
241
- profileForm_organization: string;
242
- profileForm_organization_placeholder: string;
243
- profileForm_location: string;
244
- profileForm_location_placeholder: string;
245
- profileForm_bio: string;
246
- profileForm_bio_placeholder: string;
247
- profileForm_cta: string;
248
- profileImageChange_cta_uploading: string;
249
- profileImageChange_cta_change: string;
250
- profileImageChange_cta_upload: string;
251
- profileImageChange_error: string;
236
+ profile_image_change_uploading_text: string;
237
+ profile_image_change_cta_with_picture: string;
238
+ profile_image_change_cta_without_picture: string;
239
+ profile_image_change_error: string;
252
240
  ratings_text: string;
253
241
  ratings_stars: string;
254
242
  ratings_low: string;
@@ -405,7 +393,6 @@ export declare const checkIntlPathExists: (path: string, language?: {
405
393
  inviteModal_formLabel: string;
406
394
  inviteModal_cta: string;
407
395
  overlay_close: string;
408
- profileModal_title: string;
409
396
  breadcrumbs_label: string;
410
397
  breadcrumbs_currentPage: string;
411
398
  filters_all: string;
@@ -434,9 +421,8 @@ export declare const checkIntlPathExists: (path: string, language?: {
434
421
  shareLinks_link_email: string;
435
422
  'shareLinks_link_clipboard-copy': string;
436
423
  tags_community: string;
437
- editSection_placeholder_description: string;
438
- editSection_placeholder_cta: string;
439
- editSection_edit: string;
424
+ edit_section_placeholder_description: string;
425
+ edit_section_placeholder_cta: string;
440
426
  notFoundError_title: string;
441
427
  notFoundError_text: string;
442
428
  notFoundError_post_1: string;