@apolitical/component-library 5.0.7-ac.0 → 5.0.7-ac.9

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,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { IDiscussionForm } from '../../../discussion/components/form';
3
+ import { ICategory } from '../../shared';
3
4
  interface Props {
4
5
  /** Whether the form should be displayed as a card */
5
6
  isCard?: boolean;
@@ -7,6 +8,8 @@ interface Props {
7
8
  parentId?: string;
8
9
  /** Props for the form - this uses everything the `DiscussionForm` component does */
9
10
  form: IDiscussionForm;
11
+ /** The categories to show in the form */
12
+ categories?: ICategory[];
10
13
  /** Details about what a user needs to have to be able to access the form */
11
14
  membershipRequiredToPost: {
12
15
  /** Whether the user needs to be a member of the community to post */
@@ -1,5 +1,6 @@
1
1
  import { type ListMembers, ClickMentionFallback } from '../../../form';
2
2
  import { DiscussionCreateContentFunction, IDiscussionContent, IListMemberData, IMentions } from './../../discussion';
3
+ import { ICategory } from '../../shared';
3
4
  export interface IDiscussionFormMeta {
4
5
  /** Whether the form data is still loading */
5
6
  isLoading?: boolean;
@@ -23,6 +24,10 @@ export interface IDiscussionFormMeta {
23
24
  };
24
25
  /** Whether title text should show above the form */
25
26
  showTitle?: boolean;
27
+ /** What category options should be made available for the form */
28
+ postCategories?: ICategory[];
29
+ /** Whether the post type should show */
30
+ showPostType?: boolean;
26
31
  /** Whether the community guidelines text should show beneath the form */
27
32
  showGuidelines?: boolean;
28
33
  /** Whether to show a divider before the buttons */
@@ -0,0 +1,4 @@
1
+ export interface ICategory {
2
+ name: string;
3
+ slug: string;
4
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './activity.interface';
2
+ export * from './community.category.interface';
2
3
  export * from './context.interface';
3
4
  export * from './reaction.interface';
4
5
  export * from './user.interface';
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { IField } from '../../../form.types';
3
- export declare const Checkbox: ({ className, disabled, element, functions: allFunctions, id, inputRef: ref, intlPath, label, shownValue: value, type, value: isChecked, ...props }: IField) => React.DOMElement<{
3
+ export declare const Checkbox: ({ className, disabled, element, functions: allFunctions, id, inputRef: ref, intlPath, label, shownValue: value, type, value: isChecked, accessibilityOptions: { checkboxes: { navigateWithArrowKeys } }, ...props }: IField) => React.DOMElement<{
4
4
  onMultiSelectSubmit?: ((arg1: import("../../../form.types").FormValues) => void) | undefined;
5
5
  onBlur?: (() => void) | undefined;
6
6
  onFocus?: (() => void) | undefined;
7
7
  onKeyInput?: (<T>(arg1: import("../../../form.types").FormValues) => Promise<T>) | undefined;
8
- onKeyDown?: ((e: React.KeyboardEvent<HTMLElement>) => void) | undefined;
8
+ onKeyDown: ((e: React.KeyboardEvent<HTMLElement>) => void) | undefined;
9
9
  submitForm?: ((arg: import("../../../form.types").IFormValues) => void) | undefined;
10
10
  'aria-describedby'?: string | undefined;
11
11
  'aria-errormessage'?: string | undefined;
@@ -15,6 +15,11 @@ export declare const Input: ({ className, element, id, inputRef: ref, functions,
15
15
  value: InputValues;
16
16
  placeholder: string | undefined;
17
17
  autoFocus: boolean | undefined;
18
+ accessibilityOptions?: {
19
+ checkboxes?: {
20
+ navigateWithArrowKeys?: boolean | undefined;
21
+ } | undefined;
22
+ } | undefined;
18
23
  'aria-describedby'?: string | undefined;
19
24
  'aria-errormessage'?: string | undefined;
20
25
  'aria-invalid'?: boolean | 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, ...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, ...props }: IField) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MultipleOptions;
@@ -82,6 +82,14 @@ export interface IFieldFunctions {
82
82
  submitForm?: (arg: IFormValues) => void;
83
83
  }
84
84
  export interface IField {
85
+ /** Additional accessibility configuration */
86
+ accessibilityOptions?: {
87
+ /** Additional options for checkboxes */
88
+ checkboxes?: {
89
+ /** Whether the field should be navigable with arrow keys */
90
+ navigateWithArrowKeys?: boolean;
91
+ };
92
+ };
85
93
  /** Optional ID of the element which describes this field, for screen readers */
86
94
  'aria-describedby'?: string;
87
95
  /** Optional ID of the element which provides an error message for this field */
package/helpers/intl.d.ts CHANGED
@@ -127,6 +127,8 @@ export declare const checkIntlPathExists: (path: string, language?: {
127
127
  discussionFormCard_overlay_text: string;
128
128
  discussionFormCard_overlay_cta_discard: string;
129
129
  discussionFormCard_overlay_cta_continue: string;
130
+ discussion_form_postType_label: string;
131
+ 'discussion_form__postType_no-category': string;
130
132
  discussion_form_title: string;
131
133
  discussion_form_titleField_label: string;
132
134
  discussion_form_titleField_placeholder: string;