@apolitical/component-library 2.0.2-ac.2 → 2.0.2-ac.3
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/form/components/form/components/fields/checkbox/checkbox.d.ts +5 -0
- package/form/components/form/components/fields/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/form/components/form/components/fields/input/input.d.ts +5 -0
- package/form/components/form/form.types.d.ts +11 -0
- package/index.js +19 -19
- package/index.mjs +1695 -1642
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/base/_accessibility.scss +1 -4
- package/styles/base/form/_checkbox.scss +53 -0
- package/styles/base/form/_index.scss +1 -1
- package/styles/mixins/_accessibility.scss +6 -0
- package/styles/mixins/_index.scss +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IField } from '../../../form.types';
|
|
3
3
|
export declare const Checkbox: ({ className, disabled, element, functions: allFunctions, id, inputRef: ref, intlPath, label, shownValue: value, type, value: isChecked, ...props }: IField) => React.DOMElement<{
|
|
4
|
+
onMultiSelectSubmit?: ((arg1: import("../../../form.types").FormValues) => void) | undefined;
|
|
4
5
|
onBlur?: (() => void) | undefined;
|
|
5
6
|
onFocus?: (() => void) | undefined;
|
|
6
7
|
'aria-describedby'?: string | undefined;
|
|
@@ -17,6 +18,10 @@ export declare const Checkbox: ({ className, disabled, element, functions: allFu
|
|
|
17
18
|
initialValue?: import("../../../form.types").FormValues;
|
|
18
19
|
limit?: number | undefined;
|
|
19
20
|
multiSelect?: boolean | undefined;
|
|
21
|
+
multiSelectOptions?: {
|
|
22
|
+
topbar?: boolean | undefined;
|
|
23
|
+
submitSection?: boolean | undefined;
|
|
24
|
+
} | undefined;
|
|
20
25
|
name?: string | undefined;
|
|
21
26
|
options?: import("../../../form.types").IFieldOption[] | undefined;
|
|
22
27
|
placeholder?: string | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IField } from '../../../../../../form/components/form/form.types';
|
|
2
|
-
declare const DropdownMenu: ({ className, options, initialValue, value, functions: allFunctions, gtm: { context }, }: IField) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const DropdownMenu: ({ className, options, initialValue, value, functions: allFunctions, gtm: { context }, placeholder, multiSelect, multiSelectOptions, }: IField) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default DropdownMenu;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { IField, InputTypes, InputValues } from '../../../form.types';
|
|
3
3
|
export declare const Input: ({ className, element, id, inputRef: ref, functions, name, placeholder, type, value, ...props }: IField) => React.DOMElement<{
|
|
4
4
|
onChange: (e: React.FormEvent<HTMLInputElement>) => void;
|
|
5
|
+
onMultiSelectSubmit?: ((arg1: import("../../../form.types").FormValues) => void) | undefined;
|
|
5
6
|
onBlur?: (() => void) | undefined;
|
|
6
7
|
onFocus?: (() => void) | undefined;
|
|
7
8
|
type: InputTypes;
|
|
@@ -27,6 +28,10 @@ export declare const Input: ({ className, element, id, inputRef: ref, functions,
|
|
|
27
28
|
label?: React.ReactNode;
|
|
28
29
|
limit?: number | undefined;
|
|
29
30
|
multiSelect?: boolean | undefined;
|
|
31
|
+
multiSelectOptions?: {
|
|
32
|
+
topbar?: boolean | undefined;
|
|
33
|
+
submitSection?: boolean | undefined;
|
|
34
|
+
} | undefined;
|
|
30
35
|
options?: import("../../../form.types").IFieldOption[] | undefined;
|
|
31
36
|
props?: {
|
|
32
37
|
[key: string]: string | boolean | React.RefObject<any> | (() => void);
|
|
@@ -89,6 +89,8 @@ export interface IField {
|
|
|
89
89
|
[key: string]: string | boolean;
|
|
90
90
|
};
|
|
91
91
|
}) => void) => void;
|
|
92
|
+
/** The function to call when the field is submitted */
|
|
93
|
+
onMultiSelectSubmit?: (arg1: FormValues) => void;
|
|
92
94
|
/** The function to call when the field is blurred */
|
|
93
95
|
onBlur?: () => void;
|
|
94
96
|
/** The function to call when the field is focused */
|
|
@@ -115,6 +117,13 @@ export interface IField {
|
|
|
115
117
|
limit?: number;
|
|
116
118
|
/** Whether the field can have multiple values, for checkboxes */
|
|
117
119
|
multiSelect?: boolean;
|
|
120
|
+
/** The additional options for multiselect, for dropdowns */
|
|
121
|
+
multiSelectOptions?: {
|
|
122
|
+
/** Whether to display the topbar in the dropdown - this includes a total of the checked boxes and an option to select all or none */
|
|
123
|
+
topbar?: boolean;
|
|
124
|
+
/** Whether to display the submit button in the dropdown - this allows the user to submit the dropdown only */
|
|
125
|
+
submitSection?: boolean;
|
|
126
|
+
};
|
|
118
127
|
/** The name of the field */
|
|
119
128
|
name?: string;
|
|
120
129
|
/** The options for the field, for checkboxes and dropdowns */
|
|
@@ -141,6 +150,8 @@ export interface FormButtonPropsType extends ButtonPropsType {
|
|
|
141
150
|
customOnSubmit?: React.ReactNode | false;
|
|
142
151
|
/** The text to show on the button */
|
|
143
152
|
text?: string;
|
|
153
|
+
/** The option to not have the submit button at all */
|
|
154
|
+
hideButton?: boolean;
|
|
144
155
|
}
|
|
145
156
|
export interface IFormProps {
|
|
146
157
|
/** The button to render at the bottom of the form */
|