@apolitical/component-library 5.4.5-SW.0 → 5.5.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.
@@ -1,13 +1,10 @@
1
+ import { type ILabelProps } from '../../../../../form';
1
2
  import { IDiscussionContentType } from './../../../../discussion.d';
2
- interface Props {
3
- /** The ID of the form */
4
- formID: string;
3
+ interface Props extends ILabelProps {
5
4
  /** The internationalisation path for the label */
6
5
  intlPath: string;
7
- /** Whether the label should show visually */
8
- showLabel: boolean;
9
6
  /** The content type */
10
7
  type: IDiscussionContentType;
11
8
  }
12
- declare const Label: ({ formID, intlPath, showLabel, type }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ declare const Label: ({ intlPath, type, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
13
10
  export default Label;
@@ -1,2 +1,2 @@
1
1
  export { default as Form } from './form';
2
- export type { IField, FormValues, IFormMeta, IFormProps } from './form.types';
2
+ export type { IField, FormValues, IFormMeta, IFormProps, IFormValues, } from './form.types';
@@ -1,3 +1,4 @@
1
1
  export * from './context';
2
2
  export * from './editor';
3
+ export * from './label';
3
4
  export * from './toolbar';
@@ -0,0 +1,2 @@
1
+ export { default as Label } from './label';
2
+ export { type ILabelProps } from './label';
@@ -0,0 +1,13 @@
1
+ export interface ILabelProps {
2
+ /** The ID of the form */
3
+ formID: string;
4
+ /** The text to show on the label */
5
+ label?: {
6
+ visible?: string;
7
+ screenreader?: string;
8
+ };
9
+ /** Whether the label should show visually */
10
+ showLabel: boolean;
11
+ }
12
+ declare const Label: ({ formID, label, showLabel }: ILabelProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default Label;
@@ -1,2 +1,3 @@
1
+ export { Label, type ILabelProps } from './components';
1
2
  export { default as RichTextEditor } from './rich-text-editor';
2
3
  export * from './rich-text-editor.types';
@@ -2,5 +2,6 @@ export * from './contact-form';
2
2
  export * from './invite-form';
3
3
  export * from './password-form';
4
4
  export * from './profile-form';
5
+ export * from './publish-article-form';
5
6
  export * from './search-form';
6
7
  export * from './signup-form';
@@ -0,0 +1 @@
1
+ export { default as PublishArticleForm } from './publish-article-form';
@@ -0,0 +1,3 @@
1
+ import type { IPublishArticleFormProps } from './publish-article-form.types';
2
+ declare const PublishArticleForm: ({ id, values, functions, meta, gtm, }: IPublishArticleFormProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default PublishArticleForm;
@@ -0,0 +1,39 @@
1
+ export interface IPublishArticleFormValues {
2
+ title: string;
3
+ subtitle: string;
4
+ body: string;
5
+ }
6
+ export interface IPublishArticleFormProps {
7
+ /** A unique ID for the form */
8
+ id?: string;
9
+ /** Values to pre-populate the form with */
10
+ values?: {
11
+ /** The title of the form */
12
+ title?: string;
13
+ /** The subtitle of the form */
14
+ subtitle?: string;
15
+ /** The body of the form */
16
+ body?: string;
17
+ };
18
+ /** The functions to handle the form */
19
+ functions?: {
20
+ /** The function to publish the article */
21
+ create: (args: IPublishArticleFormValues) => Promise<void>;
22
+ /** The function called when the form is successfully published */
23
+ onSuccess?: (args: IPublishArticleFormValues) => void;
24
+ /** A function to call when there's an error with the form */
25
+ onFailure?: () => void;
26
+ };
27
+ /** Metadata about the form */
28
+ meta?: {
29
+ /** Whether the form is rendered in an overlay */
30
+ isInOverlay?: boolean;
31
+ };
32
+ /** The tracking details for GTM */
33
+ gtm?: {
34
+ /** The context for GTM */
35
+ context?: string;
36
+ /** The event for GTM */
37
+ event?: string;
38
+ };
39
+ }
@@ -1 +1 @@
1
- export { default as ProgressTracker, type INavigationDotsProps as IProgressTrackerProps, } from './progress-tracker';
1
+ export { default as ProgressTracker } from './progress-tracker';
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- export interface INavigationDotsProps {
2
+ interface Props {
3
3
  /** The current step */
4
4
  currentStep?: number;
5
5
  /** The total number of steps */
6
6
  steps?: number;
7
7
  }
8
- declare const NavigationDots: React.FC<INavigationDotsProps>;
8
+ declare const NavigationDots: React.FC<Props>;
9
9
  export default NavigationDots;
package/helpers/intl.d.ts CHANGED
@@ -272,6 +272,20 @@ export declare const checkIntlPathExists: (path: string, language?: {
272
272
  profileImageChange_cta_change: string;
273
273
  profileImageChange_cta_upload: string;
274
274
  profileImageChange_error: string;
275
+ publishArticleForm_title_label: string;
276
+ publishArticleForm_title_placeholder: string;
277
+ publishArticleForm_title_error: string;
278
+ publishArticleForm_subtitle_label: string;
279
+ publishArticleForm_subtitle_placeholder: string;
280
+ publishArticleForm_body_label: string;
281
+ publishArticleForm_disclaimer: string;
282
+ publishArticleForm_cta_submit: string;
283
+ publishArticleForm_cta_submitting: string;
284
+ publishArticleForm_cta_submitted: string;
285
+ publishArticleForm_aria_success: string;
286
+ publishArticleForm_error: string;
287
+ publishArticleForm_error_underMinLength: string;
288
+ publishArticleForm_error_loggedOut: string;
275
289
  ratings_text: string;
276
290
  ratings_stars: string;
277
291
  ratings_low: string;