@apolitical/component-library 4.5.10 → 4.5.11-beta.2
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.
- package/context/user/user.context.d.ts +13 -5
- package/context/user/user.provider.d.ts +2 -1
- package/form/components/form/form.types.d.ts +13 -12
- package/form/components/form/index.d.ts +1 -1
- package/form/components/profile-image-change/profile-image-change.d.ts +20 -7
- package/form/types/index.d.ts +1 -0
- package/form/types/profile-form/index.d.ts +1 -0
- package/form/types/profile-form/profile-form.d.ts +25 -0
- package/helpers/intl.d.ts +20 -6
- package/index.js +63 -63
- package/index.mjs +23115 -22874
- package/modals/components/index.d.ts +2 -0
- package/modals/{overlay → components/overlay}/overlay.d.ts +1 -1
- package/modals/index.d.ts +2 -4
- package/modals/{discussion-form-modal → types/discussion-form-modal}/discussion-form-modal.d.ts +1 -1
- package/modals/types/index.d.ts +3 -0
- package/modals/types/profile-modal/index.d.ts +1 -0
- package/modals/types/profile-modal/profile-modal.d.ts +25 -0
- package/package.json +1 -1
- package/sections/edit-section/edit-section.d.ts +4 -2
- package/style.css +1 -1
- package/user/profile-picture/profile-picture.d.ts +3 -1
- /package/modals/{modal → components/modal}/index.d.ts +0 -0
- /package/modals/{modal → components/modal}/modal.d.ts +0 -0
- /package/modals/{overlay → components/overlay}/index.d.ts +0 -0
- /package/modals/{overlay → components/overlay}/overlay.helpers.d.ts +0 -0
- /package/modals/{discussion-form-modal → types/discussion-form-modal}/index.d.ts +0 -0
- /package/modals/{invite-modal → types/invite-modal}/index.d.ts +0 -0
- /package/modals/{invite-modal → types/invite-modal}/invite-modal.d.ts +0 -0
package/modals/index.d.ts
CHANGED
package/modals/{discussion-form-modal → types/discussion-form-modal}/discussion-form-modal.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type IDiscussionForm, type CachedText, type IMentions } from '
|
|
2
|
+
import { type IDiscussionForm, type CachedText, type IMentions } from '../../../discussion';
|
|
3
3
|
interface Props {
|
|
4
4
|
/** Whether the modal is open on page load */
|
|
5
5
|
showModal?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProfileModal } from './profile-modal';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type IProfileFormProps } from '../../../form';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Whether the modal is open on page load */
|
|
4
|
+
showModal?: boolean;
|
|
5
|
+
/** Optional content to show inside the modal, above the form */
|
|
6
|
+
content?: {
|
|
7
|
+
/** The banner title across the top of the modal, used to show a success, e.g. we might want to show 'Your post has been created' if we show the modal after the user has made a new post on communities */
|
|
8
|
+
successMessage?: string;
|
|
9
|
+
/** The title to show above the form */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** The text to show above the form */
|
|
12
|
+
text?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Functions used inside the modal */
|
|
15
|
+
functions: {
|
|
16
|
+
/** Function to call when the modal is closed */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
};
|
|
19
|
+
/** Props for the ProfileForm component */
|
|
20
|
+
form: IProfileFormProps;
|
|
21
|
+
/** Additional classes */
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const ProfileModal: ({ showModal, content: { successMessage, title, text }, functions: modalFunctions, form, className, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default ProfileModal;
|
package/package.json
CHANGED
|
@@ -20,8 +20,10 @@ interface Props {
|
|
|
20
20
|
title: string;
|
|
21
21
|
/** Modal Title */
|
|
22
22
|
modalTitle?: string;
|
|
23
|
-
/** Form fields to be rendered inside a modal form when user clicks cta or edit button */
|
|
23
|
+
/** Form fields to be rendered inside a modal form when user clicks cta or edit button. Alternatively, we can pass a whole form in `form`, if there's an existing component. */
|
|
24
24
|
formProps?: IFormProps;
|
|
25
|
+
/** A form to render inside the modal. Alternatively, we can use `formProps` to create a new form if the component doesn't already exist. */
|
|
26
|
+
formComponent?: JSX.Element;
|
|
25
27
|
/** Link to a url where user can edit the data */
|
|
26
28
|
href?: THref;
|
|
27
29
|
/** Whether to show a divider at the bottom of the section */
|
|
@@ -29,5 +31,5 @@ interface Props {
|
|
|
29
31
|
/** Placeholder settings */
|
|
30
32
|
placeholder?: IPlaceholder;
|
|
31
33
|
}
|
|
32
|
-
declare const EditSection: ({ children, className, formProps, href, title, modalTitle, placeholder, showDivider, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare const EditSection: ({ children, className, formProps, formComponent: originalFormComponent, href, title, modalTitle, placeholder, showDivider, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
33
35
|
export default EditSection;
|