@apolitical/component-library 2.1.9 → 2.2.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.
- package/form/components/form/components/fields/checkbox/checkbox.d.ts +1 -0
- package/form/components/form/components/fields/index.d.ts +1 -0
- package/form/components/form/components/fields/input/input.d.ts +1 -0
- package/form/components/form/components/fields/input-autocomplete/index.d.ts +1 -0
- package/form/components/form/components/fields/input-autocomplete/input-autocomplete.d.ts +3 -0
- package/form/components/form/form.types.d.ts +3 -1
- package/form/components/index.d.ts +1 -0
- package/form/components/profile-image-change/index.d.ts +1 -0
- package/form/components/profile-image-change/profile-image-change.d.ts +26 -0
- package/index.d.ts +1 -1
- package/index.js +19 -19
- package/index.mjs +2551 -2411
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/variables/colors/theme/_text.scss +1 -0
|
@@ -4,6 +4,7 @@ export declare const Checkbox: ({ className, disabled, element, functions: allFu
|
|
|
4
4
|
onMultiSelectSubmit?: ((arg1: import("../../../form.types").FormValues) => void) | undefined;
|
|
5
5
|
onBlur?: (() => void) | undefined;
|
|
6
6
|
onFocus?: (() => void) | undefined;
|
|
7
|
+
onKeyInput?: (<T>(arg1: import("../../../form.types").FormValues) => Promise<T>) | undefined;
|
|
7
8
|
'aria-describedby'?: string | undefined;
|
|
8
9
|
'aria-invalid'?: boolean | undefined;
|
|
9
10
|
'aria-required'?: boolean | undefined;
|
|
@@ -5,6 +5,7 @@ export declare const Input: ({ className, element, id, inputRef: ref, functions,
|
|
|
5
5
|
onMultiSelectSubmit?: ((arg1: import("../../../form.types").FormValues) => void) | undefined;
|
|
6
6
|
onBlur?: (() => void) | undefined;
|
|
7
7
|
onFocus?: (() => void) | undefined;
|
|
8
|
+
onKeyInput?: (<T>(arg1: import("../../../form.types").FormValues) => Promise<T>) | undefined;
|
|
8
9
|
type: InputTypes;
|
|
9
10
|
id: string | undefined;
|
|
10
11
|
name: string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InputAutocomplete } from './input-autocomplete';
|
|
@@ -5,7 +5,7 @@ import { IntlShape } from 'react-intl';
|
|
|
5
5
|
export type InputValues = string | number | boolean | null;
|
|
6
6
|
export type MultipleInputValues = InputValues[];
|
|
7
7
|
export type FormValues = InputValues | MultipleInputValues | undefined;
|
|
8
|
-
export type InputTypes = 'text' | 'textarea' | 'email' | 'checkbox' | 'select' | 'radio' | 'password';
|
|
8
|
+
export type InputTypes = 'text' | 'textarea' | 'email' | 'checkbox' | 'select' | 'radio' | 'password' | 'autocomplete';
|
|
9
9
|
export interface ILabel {
|
|
10
10
|
/** The element to be used, defaulting to `label` */
|
|
11
11
|
element?: string;
|
|
@@ -95,6 +95,8 @@ export interface IField {
|
|
|
95
95
|
onBlur?: () => void;
|
|
96
96
|
/** The function to call when the field is focused */
|
|
97
97
|
onFocus?: () => void;
|
|
98
|
+
/** The function to call when a key is pressed */
|
|
99
|
+
onKeyInput?: <T>(arg1: FormValues) => Promise<T>;
|
|
98
100
|
};
|
|
99
101
|
/** The Google Tag Manager data to be passed to the field */
|
|
100
102
|
gtm?: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProfileImageChange } from './profile-image-change';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IUploadImageResponse {
|
|
3
|
+
thumbnailURL: string;
|
|
4
|
+
originalURL: string;
|
|
5
|
+
}
|
|
6
|
+
type TSetUserImage = (value: React.SetStateAction<IUploadImageResponse>) => void;
|
|
7
|
+
interface IUploadImageProps {
|
|
8
|
+
fileObject: File;
|
|
9
|
+
userId: string;
|
|
10
|
+
}
|
|
11
|
+
interface Props {
|
|
12
|
+
/** Additional classes */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** User ID */
|
|
15
|
+
userId: string;
|
|
16
|
+
/** User name */
|
|
17
|
+
userName: string;
|
|
18
|
+
/** Thumbnail image */
|
|
19
|
+
src?: string;
|
|
20
|
+
/** Function to upload the image */
|
|
21
|
+
uploadImage: ({ fileObject, userId }: IUploadImageProps) => Promise<IUploadImageResponse>;
|
|
22
|
+
/** Function to set the profile info */
|
|
23
|
+
setUserImage: TSetUserImage;
|
|
24
|
+
}
|
|
25
|
+
declare function ProfileImageChange({ className, userId, userName, src, setUserImage, uploadImage, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default ProfileImageChange;
|
package/index.d.ts
CHANGED