@apolitical/component-library 6.6.14-beta.0 → 6.6.14
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/constants/stats.d.ts +1 -1
- package/form/components/form/components/fields/checkbox/checkbox.d.ts +3 -0
- package/form/components/form/components/fields/input/input.d.ts +3 -0
- package/form/components/form/components/fields/multiple-options/multiple-options.d.ts +1 -1
- package/form/components/form/form.types.d.ts +5 -2
- package/form/types/publish-article-form/publish-article-form.d.ts +1 -1
- package/form/types/publish-article-form/publish-article-form.types.d.ts +17 -0
- package/general/link/link.d.ts +3 -8
- package/general/portal/index.d.ts +1 -1
- package/general/portal/portal.d.ts +3 -4
- package/helpers/intl.d.ts +15 -0
- package/index.js +49 -49
- package/index.mjs +5383 -5348
- package/package.json +1 -1
- package/style.css +1 -1
package/constants/stats.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const NUMBER_OF_USERS = "
|
|
1
|
+
export declare const NUMBER_OF_USERS = "250,000+";
|
|
2
2
|
export declare const NUMBER_OF_COUNTRIES = "160+";
|
|
@@ -27,6 +27,9 @@ export declare const Checkbox: ({ className, disabled, element, functions: allFu
|
|
|
27
27
|
topbar?: boolean | undefined;
|
|
28
28
|
submitSection?: boolean | undefined;
|
|
29
29
|
} | undefined;
|
|
30
|
+
multipleOptions?: {
|
|
31
|
+
limit?: number | undefined;
|
|
32
|
+
} | undefined;
|
|
30
33
|
multipleInputs?: {
|
|
31
34
|
showCount?: boolean | undefined;
|
|
32
35
|
label?: string | undefined;
|
|
@@ -40,6 +40,9 @@ export declare const Input: ({ className, element, id, inputRef: ref, functions,
|
|
|
40
40
|
topbar?: boolean | undefined;
|
|
41
41
|
submitSection?: boolean | undefined;
|
|
42
42
|
} | undefined;
|
|
43
|
+
multipleOptions?: {
|
|
44
|
+
limit?: number | undefined;
|
|
45
|
+
} | undefined;
|
|
43
46
|
multipleInputs?: {
|
|
44
47
|
showCount?: boolean | undefined;
|
|
45
48
|
label?: string | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IField } from '../../../form.types';
|
|
2
|
-
export declare const MultipleOptions: ({ className, functions, intlPath, id: groupId, label, multiSelect, name, options, required, type, value, accessibilityOptions, styling: { displayOptionsAsPills }, ...props }: IField) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MultipleOptions: ({ className, functions, intlPath, id: groupId, label, multiSelect, name, options, required, type, value, accessibilityOptions, styling: { displayOptionsAsPills }, multipleOptions, ...props }: IField) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MultipleOptions;
|
|
@@ -147,6 +147,11 @@ export interface IField {
|
|
|
147
147
|
/** Whether to display the submit button in the dropdown - this allows the user to submit the dropdown only */
|
|
148
148
|
submitSection?: boolean;
|
|
149
149
|
};
|
|
150
|
+
/** The additional options for multiple options, for checkboxes */
|
|
151
|
+
multipleOptions?: {
|
|
152
|
+
/** The limit of the number of options that can be selected */
|
|
153
|
+
limit?: number;
|
|
154
|
+
};
|
|
150
155
|
/** Props for the inputs rendered in a `multiple` field */
|
|
151
156
|
multipleInputs?: {
|
|
152
157
|
/** Whether or not to show the number of filled in inputs in the legend */
|
|
@@ -218,8 +223,6 @@ export interface IFormMeta {
|
|
|
218
223
|
showSuccessMessage?: boolean | string;
|
|
219
224
|
/** Whether the form should show cancel button */
|
|
220
225
|
shouldShowCancelButton?: boolean;
|
|
221
|
-
/** Whether the form should scroll up when there are no errors */
|
|
222
|
-
shouldScrollOnSuccess?: boolean;
|
|
223
226
|
}
|
|
224
227
|
export interface IFormProps {
|
|
225
228
|
/** The form submit button */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IPublishArticleFormProps } from './publish-article-form.types';
|
|
2
2
|
declare const PublishArticleForm: ({ id, values, functions, meta, gtm, }: IPublishArticleFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default PublishArticleForm;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
export declare enum ArticleTags {
|
|
2
|
+
CitiesAndLocalGovernment = "topic_CitiesAndLocalGovernment",
|
|
3
|
+
Climate = "topic_Climate",
|
|
4
|
+
DigitalAndData = "topic_DigitalAndData",
|
|
5
|
+
Education = "topic_Education",
|
|
6
|
+
EquityJusticeAndInclusion = "topic_EquityJusticeAndInclusion",
|
|
7
|
+
HealthAndSocialCare = "topic_HealthAndSocialCare",
|
|
8
|
+
Innovation = "topic_Innovation",
|
|
9
|
+
LeadershipAndSkills = "topic_LeadershipAndSkills",
|
|
10
|
+
LifeInGovernment = "topic_LifeInGovernment",
|
|
11
|
+
Policymaking = "topic_Policymaking",
|
|
12
|
+
TransportAndInfrastructure = "topic_TransportAndInfrastructure",
|
|
13
|
+
WorkingAndTheEconomy = "topic_WorkAndTheEconomy"
|
|
14
|
+
}
|
|
1
15
|
export interface IPublishArticleFormValues {
|
|
2
16
|
title: string;
|
|
3
17
|
subtitle: string;
|
|
4
18
|
body: string;
|
|
19
|
+
tags: ArticleTags[];
|
|
5
20
|
}
|
|
6
21
|
export interface IPublishArticleFormProps {
|
|
7
22
|
/** A unique ID for the form */
|
|
@@ -14,6 +29,8 @@ export interface IPublishArticleFormProps {
|
|
|
14
29
|
subtitle?: string;
|
|
15
30
|
/** The body of the form */
|
|
16
31
|
body?: string;
|
|
32
|
+
/** The tags of the form */
|
|
33
|
+
tags?: ArticleTags[];
|
|
17
34
|
};
|
|
18
35
|
/** The functions to handle the form */
|
|
19
36
|
functions?: {
|
package/general/link/link.d.ts
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type LinkOnClick = ((e?: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
3
2
|
export interface ILinkProps {
|
|
4
3
|
/** URL for link */
|
|
5
4
|
href?: string | undefined;
|
|
6
5
|
/** Content to rendered */
|
|
7
6
|
children: JSX.Element | JSX.Element[] | string;
|
|
8
7
|
/** The element the content should be wrapped in, if it is not a link; nothing is rendered if it's undefined */
|
|
9
|
-
fallbackElement?: '
|
|
8
|
+
fallbackElement?: 'span' | 'strong' | 'li';
|
|
10
9
|
/** Additonal classes */
|
|
11
10
|
className?: string;
|
|
12
11
|
/** Function to be called when clicked */
|
|
13
|
-
onClick?:
|
|
12
|
+
onClick?: ((e?: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
14
13
|
/** Function to be called when focused */
|
|
15
14
|
onFocus?: ((e?: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
16
15
|
/** Function to be called when key is pressed */
|
|
17
16
|
onKeyDown?: ((e?: React.KeyboardEvent<HTMLElement>) => void) | undefined;
|
|
18
|
-
meta?: {
|
|
19
|
-
/** Whether to force the onClick event to fire, even if the element is not a link */
|
|
20
|
-
forceOnClick?: boolean;
|
|
21
|
-
};
|
|
22
17
|
/** GTM event context */
|
|
23
18
|
gtmContext?: string;
|
|
24
19
|
/** GTM event type */
|
|
@@ -38,5 +33,5 @@ export interface ILinkProps {
|
|
|
38
33
|
/** Data attributes for the link */
|
|
39
34
|
'data-before'?: string;
|
|
40
35
|
}
|
|
41
|
-
declare const Link: ({ href, children, fallbackElement,
|
|
36
|
+
declare const Link: ({ href, children, fallbackElement, className, onClick, gtmContext, gtmType, ...props }: ILinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
37
|
export default Link;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Portal
|
|
1
|
+
export { default as Portal } from './portal';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
parent?: HTMLElement |
|
|
2
|
+
declare const Portal: ({ parent, children, }: {
|
|
3
|
+
parent?: Element | HTMLElement | DocumentFragment | undefined;
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
declare const Portal: ({ parent, children }: IPortalProps) => import("react").ReactPortal | null;
|
|
5
|
+
}) => import("react").ReactPortal | null;
|
|
7
6
|
export default Portal;
|
package/helpers/intl.d.ts
CHANGED
|
@@ -293,6 +293,21 @@ export declare const checkIntlPathExists: (path: string, language?: {
|
|
|
293
293
|
publishArticleForm_subtitle_placeholder: string;
|
|
294
294
|
publishArticleForm_body_label: string;
|
|
295
295
|
publishArticleForm_body_placeholder: string;
|
|
296
|
+
publishArticleForm_tags_label: string;
|
|
297
|
+
publishArticleForm__tags_topic_CitiesAndLocalGovernment: string;
|
|
298
|
+
publishArticleForm__tags_topic_Climate: string;
|
|
299
|
+
publishArticleForm__tags_topic_DigitalAndData: string;
|
|
300
|
+
publishArticleForm__tags_topic_Education: string;
|
|
301
|
+
publishArticleForm__tags_topic_EquityJusticeAndInclusion: string;
|
|
302
|
+
publishArticleForm__tags_topic_HealthAndSocialCare: string;
|
|
303
|
+
publishArticleForm__tags_topic_Innovation: string;
|
|
304
|
+
publishArticleForm__tags_topic_LeadershipAndSkills: string;
|
|
305
|
+
publishArticleForm__tags_topic_LifeInGovernment: string;
|
|
306
|
+
publishArticleForm__tags_topic_Policymaking: string;
|
|
307
|
+
publishArticleForm__tags_topic_TransportAndInfrastructure: string;
|
|
308
|
+
publishArticleForm__tags_topic_WorkAndTheEconomy: string;
|
|
309
|
+
publishArticleForm_tags_error_over_three: string;
|
|
310
|
+
publishArticleForm_tags_error_required: string;
|
|
296
311
|
publishArticleForm_disclaimer: string;
|
|
297
312
|
publishArticleForm_cta_submit: string;
|
|
298
313
|
publishArticleForm_cta_submitting: string;
|