@trackunit/react-form-components 0.0.67 → 0.0.70
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/index.cjs +14355 -1195
- package/index.js +14372 -1206
- package/package.json +5 -5
- package/src/components/ActionButton/ActionButton.d.ts +26 -26
- package/src/components/ActionButton/index.d.ts +1 -1
- package/src/components/BaseInput/BaseInput.d.ts +62 -62
- package/src/components/BaseInput/index.d.ts +1 -1
- package/src/components/Checkbox/CheckIcon.d.ts +12 -12
- package/src/components/Checkbox/Checkbox.d.ts +48 -48
- package/src/components/Checkbox/IndeterminateIcon.d.ts +10 -10
- package/src/components/Checkbox/index.d.ts +1 -1
- package/src/components/DateField/DateField.d.ts +19 -19
- package/src/components/DateInput/DateInput.d.ts +28 -28
- package/src/components/DropZone/DropZone.d.ts +34 -34
- package/src/components/EmailField/EmailField.d.ts +17 -17
- package/src/components/EmailInput/EmailInput.d.ts +13 -13
- package/src/components/EmailInput/index.d.ts +1 -1
- package/src/components/FormGroup/FormGroup.d.ts +39 -39
- package/src/components/Label/Label.d.ts +34 -34
- package/src/components/Label/index.d.ts +1 -1
- package/src/components/NumberField/NumberField.d.ts +19 -19
- package/src/components/NumberInput/NumberInput.d.ts +12 -12
- package/src/components/OptionCard/OptionCard.d.ts +24 -24
- package/src/components/PhoneField/PhoneField.d.ts +28 -28
- package/src/components/PhoneInput/CountryCodeSelect.d.ts +23 -23
- package/src/components/PhoneInput/CountryCodes.d.ts +5 -5
- package/src/components/PhoneInput/PhoneInput.d.ts +34 -34
- package/src/components/PhoneInput/PhoneNumberUtilities.d.ts +13 -13
- package/src/components/PhoneInput/index.d.ts +1 -1
- package/src/components/RadioGroup/RadioGroup.d.ts +57 -57
- package/src/components/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/src/components/RadioGroup/RadioItem.d.ts +23 -23
- package/src/components/RadioGroup/index.d.ts +2 -2
- package/src/components/Schedule/Schedule.d.ts +45 -37
- package/src/components/Schedule/Schedule.variants.d.ts +2 -2
- package/src/components/Search/Search.d.ts +62 -62
- package/src/components/Search/index.d.ts +1 -1
- package/src/components/Select/CreatableSelect.d.ts +38 -38
- package/src/components/Select/FieldContainer.d.ts +20 -20
- package/src/components/Select/Select.d.ts +18 -18
- package/src/components/Select/SelectMenuItem/SelectMenuItem.d.ts +49 -49
- package/src/components/Select/TagWithWidth.d.ts +17 -17
- package/src/components/Select/TagsContainer.d.ts +45 -45
- package/src/components/Select/index.d.ts +7 -7
- package/src/components/Select/shared.d.ts +15 -15
- package/src/components/Select/useCustomComponents.d.ts +19 -19
- package/src/components/Select/useCustomStyles.d.ts +14 -14
- package/src/components/Select/useSelect.d.ts +143 -143
- package/src/components/TextArea/TextArea.d.ts +30 -30
- package/src/components/TextArea/index.d.ts +1 -1
- package/src/components/TextAreaField/TextAreaField.d.ts +18 -18
- package/src/components/TextAreaField/index.d.ts +1 -1
- package/src/components/TextField/TextField.d.ts +24 -24
- package/src/components/TextField/TextLenghtIndicator.d.ts +19 -19
- package/src/components/TextField/index.d.ts +1 -1
- package/src/components/TextInput/TextInput.d.ts +12 -12
- package/src/components/TimeRange/TimeRange.d.ts +52 -52
- package/src/components/TimeRange/TimeRange.variants.d.ts +1 -3
- package/src/components/TimeRange/index.d.ts +1 -1
- package/src/components/TimeRangeField/TimeRangeField.d.ts +18 -18
- package/src/components/Toggle/Toggle.d.ts +61 -61
- package/src/components/Toggle/index.d.ts +1 -1
- package/src/components/UploadField/UploadField.d.ts +15 -15
- package/src/components/UploadInput/UploadInput.d.ts +33 -33
- package/src/index.d.ts +28 -28
- package/src/test-utils/hooks.d.ts +4 -4
- package/src/test-utils/test-utils.d.ts +5 -5
- package/src/translation.d.ts +34 -34
- package/src/utilities/usePhoneInput.d.ts +56 -56
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export interface TimeRangeInput {
|
|
4
|
-
/**
|
|
5
|
-
* The starting time of the range.
|
|
6
|
-
*/
|
|
7
|
-
timeFrom: string;
|
|
8
|
-
/**
|
|
9
|
-
* The ending time of the range.
|
|
10
|
-
*/
|
|
11
|
-
timeTo: string;
|
|
12
|
-
}
|
|
13
|
-
export interface TimeRangeProps extends CommonProps {
|
|
14
|
-
/**
|
|
15
|
-
* Unique element identifier.
|
|
16
|
-
*/
|
|
17
|
-
id?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Custom node to separate start time input and end time input.
|
|
20
|
-
*
|
|
21
|
-
* @default <div data-testid={`${dataTestId}-separator`}>-</div>
|
|
22
|
-
*/
|
|
23
|
-
children?: React.ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
* Sets start time of the range and end time of the range.
|
|
26
|
-
*
|
|
27
|
-
* @default { timeFrom: "", timeTo: "" }
|
|
28
|
-
*/
|
|
29
|
-
range?: TimeRangeInput;
|
|
30
|
-
/**
|
|
31
|
-
* Disables time selectors.
|
|
32
|
-
*/
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* If true the range is rendered in its invalid state.
|
|
36
|
-
*/
|
|
37
|
-
isInvalid?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Called when time range changes.
|
|
40
|
-
*
|
|
41
|
-
* @param {TimeRangeInput} range - Selected time range.
|
|
42
|
-
* @returns {void}
|
|
43
|
-
*/
|
|
44
|
-
onChange: (range: TimeRangeInput) => void;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* TimeRange is used to create a time range entry.
|
|
48
|
-
*
|
|
49
|
-
* @param {TimeRangeProps} props - The props for the TimeRange component
|
|
50
|
-
* @returns {JSX.Element} TimeRange component
|
|
51
|
-
*/
|
|
52
|
-
export declare const TimeRange: ({ id, className, dataTestId, children, range, onChange, disabled, isInvalid, }: TimeRangeProps) => JSX.Element;
|
|
1
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface TimeRangeInput {
|
|
4
|
+
/**
|
|
5
|
+
* The starting time of the range.
|
|
6
|
+
*/
|
|
7
|
+
timeFrom: string;
|
|
8
|
+
/**
|
|
9
|
+
* The ending time of the range.
|
|
10
|
+
*/
|
|
11
|
+
timeTo: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TimeRangeProps extends CommonProps {
|
|
14
|
+
/**
|
|
15
|
+
* Unique element identifier.
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom node to separate start time input and end time input.
|
|
20
|
+
*
|
|
21
|
+
* @default <div data-testid={`${dataTestId}-separator`}>-</div>
|
|
22
|
+
*/
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Sets start time of the range and end time of the range.
|
|
26
|
+
*
|
|
27
|
+
* @default { timeFrom: "", timeTo: "" }
|
|
28
|
+
*/
|
|
29
|
+
range?: TimeRangeInput;
|
|
30
|
+
/**
|
|
31
|
+
* Disables time selectors.
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If true the range is rendered in its invalid state.
|
|
36
|
+
*/
|
|
37
|
+
isInvalid?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Called when time range changes.
|
|
40
|
+
*
|
|
41
|
+
* @param {TimeRangeInput} range - Selected time range.
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
onChange: (range: TimeRangeInput) => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* TimeRange is used to create a time range entry.
|
|
48
|
+
*
|
|
49
|
+
* @param {TimeRangeProps} props - The props for the TimeRange component
|
|
50
|
+
* @returns {JSX.Element} TimeRange component
|
|
51
|
+
*/
|
|
52
|
+
export declare const TimeRange: ({ id, className, dataTestId, children, range, onChange, disabled, isInvalid, }: TimeRangeProps) => JSX.Element;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export declare const cvaTimeRange: (props?: (
|
|
2
|
-
isValid?: boolean | null | undefined;
|
|
3
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
1
|
+
export declare const cvaTimeRange: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./TimeRange";
|
|
1
|
+
export * from "./TimeRange";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormGroupProps } from "../FormGroup/FormGroup";
|
|
3
|
-
import { TimeRangeProps } from "../TimeRange/TimeRange";
|
|
4
|
-
type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
|
|
5
|
-
export interface TimeRangeFieldProps extends TimeRangeProps, FormGroupExposedProps {
|
|
6
|
-
/**
|
|
7
|
-
* If a value is set, the field is rendered in its invalid state.
|
|
8
|
-
*/
|
|
9
|
-
errorMessage?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* TimeRangeField Description. <-- Please add a proper Description this is used in Storybook.
|
|
13
|
-
*
|
|
14
|
-
* @param {TimeRangeFieldProps} props - The props for the TimeRangeField component
|
|
15
|
-
* @returns {JSX.Element} TimeRangeField component
|
|
16
|
-
*/
|
|
17
|
-
export declare const TimeRangeField: ({ className, dataTestId, onChange, isInvalid, errorMessage, label, tip, disabled, children, helpText, id, ...rest }: TimeRangeFieldProps) => JSX.Element;
|
|
18
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormGroupProps } from "../FormGroup/FormGroup";
|
|
3
|
+
import { TimeRangeProps } from "../TimeRange/TimeRange";
|
|
4
|
+
type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
|
|
5
|
+
export interface TimeRangeFieldProps extends TimeRangeProps, FormGroupExposedProps {
|
|
6
|
+
/**
|
|
7
|
+
* If a value is set, the field is rendered in its invalid state.
|
|
8
|
+
*/
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* TimeRangeField Description. <-- Please add a proper Description this is used in Storybook.
|
|
13
|
+
*
|
|
14
|
+
* @param {TimeRangeFieldProps} props - The props for the TimeRangeField component
|
|
15
|
+
* @returns {JSX.Element} TimeRangeField component
|
|
16
|
+
*/
|
|
17
|
+
export declare const TimeRangeField: ({ className, dataTestId, onChange, isInvalid, errorMessage, label, tip, disabled, children, helpText, id, ...rest }: TimeRangeFieldProps) => JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import "./Toggle.css";
|
|
4
|
-
export type ToggleSize = "small" | "medium";
|
|
5
|
-
export interface ToggleProps extends CommonProps {
|
|
6
|
-
/**
|
|
7
|
-
* ID of the toggle.
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
/**
|
|
11
|
-
* Whether the toggle is toggled(active) or not.
|
|
12
|
-
*/
|
|
13
|
-
toggled: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* onChange event handler.
|
|
16
|
-
*/
|
|
17
|
-
onChange: (toggled: boolean, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
/**
|
|
19
|
-
* OnClick event handler it is thrown on root element of the component tree.
|
|
20
|
-
*/
|
|
21
|
-
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
22
|
-
/**
|
|
23
|
-
* Whether the toggle is disabled or not.
|
|
24
|
-
*/
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Size of the toggle.
|
|
28
|
-
*/
|
|
29
|
-
size?: ToggleSize;
|
|
30
|
-
/**
|
|
31
|
-
* Tab index specifies the keyboard tab order of the toggle relative to the other controls on the page.
|
|
32
|
-
*/
|
|
33
|
-
tabIndex?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Whether the toggle is required or not.
|
|
36
|
-
*/
|
|
37
|
-
required?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Name of the toggle.
|
|
40
|
-
*/
|
|
41
|
-
name?: string;
|
|
42
|
-
/**
|
|
43
|
-
* The description of the toggle.
|
|
44
|
-
*/
|
|
45
|
-
description?: string;
|
|
46
|
-
/**
|
|
47
|
-
* onBlur event handler.
|
|
48
|
-
*/
|
|
49
|
-
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Use Toggle when you have to only enable/disable a feature.
|
|
53
|
-
*
|
|
54
|
-
* _**Do use** Toggle in forms or settings._
|
|
55
|
-
*
|
|
56
|
-
* _**Do not use** Toggle if a user can select many option from a list, use checkboxes instead of toggle._
|
|
57
|
-
*
|
|
58
|
-
* @param {ToggleProps} props - The props for the Toggle component
|
|
59
|
-
* @returns {JSX.Element} Toggle component
|
|
60
|
-
*/
|
|
61
|
-
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;
|
|
1
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import "./Toggle.css";
|
|
4
|
+
export type ToggleSize = "small" | "medium";
|
|
5
|
+
export interface ToggleProps extends CommonProps {
|
|
6
|
+
/**
|
|
7
|
+
* ID of the toggle.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the toggle is toggled(active) or not.
|
|
12
|
+
*/
|
|
13
|
+
toggled: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* onChange event handler.
|
|
16
|
+
*/
|
|
17
|
+
onChange: (toggled: boolean, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* OnClick event handler it is thrown on root element of the component tree.
|
|
20
|
+
*/
|
|
21
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the toggle is disabled or not.
|
|
24
|
+
*/
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Size of the toggle.
|
|
28
|
+
*/
|
|
29
|
+
size?: ToggleSize;
|
|
30
|
+
/**
|
|
31
|
+
* Tab index specifies the keyboard tab order of the toggle relative to the other controls on the page.
|
|
32
|
+
*/
|
|
33
|
+
tabIndex?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the toggle is required or not.
|
|
36
|
+
*/
|
|
37
|
+
required?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Name of the toggle.
|
|
40
|
+
*/
|
|
41
|
+
name?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The description of the toggle.
|
|
44
|
+
*/
|
|
45
|
+
description?: string;
|
|
46
|
+
/**
|
|
47
|
+
* onBlur event handler.
|
|
48
|
+
*/
|
|
49
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Use Toggle when you have to only enable/disable a feature.
|
|
53
|
+
*
|
|
54
|
+
* _**Do use** Toggle in forms or settings._
|
|
55
|
+
*
|
|
56
|
+
* _**Do not use** Toggle if a user can select many option from a list, use checkboxes instead of toggle._
|
|
57
|
+
*
|
|
58
|
+
* @param {ToggleProps} props - The props for the Toggle component
|
|
59
|
+
* @returns {JSX.Element} Toggle component
|
|
60
|
+
*/
|
|
61
|
+
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Toggle";
|
|
1
|
+
export * from "./Toggle";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormGroupProps } from "../FormGroup/FormGroup";
|
|
3
|
-
import { UploadInputProps } from "../UploadInput/UploadInput";
|
|
4
|
-
type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
|
|
5
|
-
export interface UploadFieldProps extends UploadInputProps, FormGroupExposedProps {
|
|
6
|
-
/**
|
|
7
|
-
* If a value is set, the field is rendered in its invalid state.
|
|
8
|
-
*/
|
|
9
|
-
errorMessage?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Upload fields enable the user to upload Files.
|
|
13
|
-
*/
|
|
14
|
-
export declare const UploadField: import("react").ForwardRefExoticComponent<UploadFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormGroupProps } from "../FormGroup/FormGroup";
|
|
3
|
+
import { UploadInputProps } from "../UploadInput/UploadInput";
|
|
4
|
+
type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
|
|
5
|
+
export interface UploadFieldProps extends UploadInputProps, FormGroupExposedProps {
|
|
6
|
+
/**
|
|
7
|
+
* If a value is set, the field is rendered in its invalid state.
|
|
8
|
+
*/
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Upload fields enable the user to upload Files.
|
|
13
|
+
*/
|
|
14
|
+
export declare const UploadField: import("react").ForwardRefExoticComponent<UploadFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export {};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CommonProps } from "@trackunit/react-components";
|
|
3
|
-
import { BaseInputProps } from "../BaseInput";
|
|
4
|
-
type BaseInputExposedProps = Omit<BaseInputProps, "type" | "suffix" | "prefix" | "addonAfter" | "addonBefore" | "actions" | "placeholder">;
|
|
5
|
-
export interface UploadInputProps extends BaseInputExposedProps, CommonProps {
|
|
6
|
-
/**
|
|
7
|
-
* A flag to disable the upload input.
|
|
8
|
-
*/
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* A string to set the file formats, for example '.pdf' or '.pdf, .jgp'.
|
|
12
|
-
*/
|
|
13
|
-
acceptedTypes?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Label for the file selector button,
|
|
16
|
-
*/
|
|
17
|
-
uploadLabel: string;
|
|
18
|
-
/**
|
|
19
|
-
* A flag to allow the upload input to accept multiple files.
|
|
20
|
-
*/
|
|
21
|
-
multipleFiles?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* A flag to disable interaction with input for example if you want to use input as a child of higher component
|
|
24
|
-
*/
|
|
25
|
-
nonInteractive?: boolean;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* A thin wrapper around the `BaseInput` component for upload input fields.
|
|
29
|
-
*
|
|
30
|
-
* NOTE: If shown with a label, please use the `UploadField` component instead.
|
|
31
|
-
*/
|
|
32
|
-
export declare const UploadInput: import("react").ForwardRefExoticComponent<UploadInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
33
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from "@trackunit/react-components";
|
|
3
|
+
import { BaseInputProps } from "../BaseInput";
|
|
4
|
+
type BaseInputExposedProps = Omit<BaseInputProps, "type" | "suffix" | "prefix" | "addonAfter" | "addonBefore" | "actions" | "placeholder">;
|
|
5
|
+
export interface UploadInputProps extends BaseInputExposedProps, CommonProps {
|
|
6
|
+
/**
|
|
7
|
+
* A flag to disable the upload input.
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* A string to set the file formats, for example '.pdf' or '.pdf, .jgp'.
|
|
12
|
+
*/
|
|
13
|
+
acceptedTypes?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Label for the file selector button,
|
|
16
|
+
*/
|
|
17
|
+
uploadLabel: string;
|
|
18
|
+
/**
|
|
19
|
+
* A flag to allow the upload input to accept multiple files.
|
|
20
|
+
*/
|
|
21
|
+
multipleFiles?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* A flag to disable interaction with input for example if you want to use input as a child of higher component
|
|
24
|
+
*/
|
|
25
|
+
nonInteractive?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A thin wrapper around the `BaseInput` component for upload input fields.
|
|
29
|
+
*
|
|
30
|
+
* NOTE: If shown with a label, please use the `UploadField` component instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare const UploadInput: import("react").ForwardRefExoticComponent<UploadInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
33
|
+
export {};
|
package/src/index.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
export * from "./components/ActionButton";
|
|
2
|
-
export * from "./components/BaseInput";
|
|
3
|
-
export * from "./components/Checkbox";
|
|
4
|
-
export * from "./components/DateField/DateField";
|
|
5
|
-
export * from "./components/DateInput/DateInput";
|
|
6
|
-
export * from "./components/DropZone/DropZone";
|
|
7
|
-
export * from "./components/EmailField/EmailField";
|
|
8
|
-
export * from "./components/EmailInput";
|
|
9
|
-
export * from "./components/FormGroup/FormGroup";
|
|
10
|
-
export * from "./components/Label/Label";
|
|
11
|
-
export * from "./components/NumberField/NumberField";
|
|
12
|
-
export * from "./components/NumberInput/NumberInput";
|
|
13
|
-
export * from "./components/OptionCard/OptionCard";
|
|
14
|
-
export * from "./components/PhoneField/PhoneField";
|
|
15
|
-
export * from "./components/PhoneInput/PhoneInput";
|
|
16
|
-
export * from "./components/RadioGroup";
|
|
17
|
-
export * from "./components/Schedule/Schedule";
|
|
18
|
-
export * from "./components/Search";
|
|
19
|
-
export * from "./components/Select";
|
|
20
|
-
export * from "./components/TextArea";
|
|
21
|
-
export * from "./components/TextAreaField";
|
|
22
|
-
export * from "./components/TextField";
|
|
23
|
-
export * from "./components/TextInput/TextInput";
|
|
24
|
-
export * from "./components/TimeRange";
|
|
25
|
-
export * from "./components/TimeRangeField/TimeRangeField";
|
|
26
|
-
export * from "./components/Toggle";
|
|
27
|
-
export * from "./components/UploadField/UploadField";
|
|
28
|
-
export * from "./components/UploadInput/UploadInput";
|
|
1
|
+
export * from "./components/ActionButton";
|
|
2
|
+
export * from "./components/BaseInput";
|
|
3
|
+
export * from "./components/Checkbox";
|
|
4
|
+
export * from "./components/DateField/DateField";
|
|
5
|
+
export * from "./components/DateInput/DateInput";
|
|
6
|
+
export * from "./components/DropZone/DropZone";
|
|
7
|
+
export * from "./components/EmailField/EmailField";
|
|
8
|
+
export * from "./components/EmailInput";
|
|
9
|
+
export * from "./components/FormGroup/FormGroup";
|
|
10
|
+
export * from "./components/Label/Label";
|
|
11
|
+
export * from "./components/NumberField/NumberField";
|
|
12
|
+
export * from "./components/NumberInput/NumberInput";
|
|
13
|
+
export * from "./components/OptionCard/OptionCard";
|
|
14
|
+
export * from "./components/PhoneField/PhoneField";
|
|
15
|
+
export * from "./components/PhoneInput/PhoneInput";
|
|
16
|
+
export * from "./components/RadioGroup";
|
|
17
|
+
export * from "./components/Schedule/Schedule";
|
|
18
|
+
export * from "./components/Search";
|
|
19
|
+
export * from "./components/Select";
|
|
20
|
+
export * from "./components/TextArea";
|
|
21
|
+
export * from "./components/TextAreaField";
|
|
22
|
+
export * from "./components/TextField";
|
|
23
|
+
export * from "./components/TextInput/TextInput";
|
|
24
|
+
export * from "./components/TimeRange";
|
|
25
|
+
export * from "./components/TimeRangeField/TimeRangeField";
|
|
26
|
+
export * from "./components/Toggle";
|
|
27
|
+
export * from "./components/UploadField/UploadField";
|
|
28
|
+
export * from "./components/UploadInput/UploadInput";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderHookOptions } from "@testing-library/react";
|
|
2
|
-
declare const customRenderHook: <T, K>(callback: (props: T) => K, options?: RenderHookOptions<T, typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement> | undefined) => import("@testing-library/react").RenderHookResult<K, T>;
|
|
3
|
-
export * from "@testing-library/react";
|
|
4
|
-
export { customRenderHook as renderHook };
|
|
1
|
+
import { RenderHookOptions } from "@testing-library/react";
|
|
2
|
+
declare const customRenderHook: <T, K>(callback: (props: T) => K, options?: RenderHookOptions<T, typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement> | undefined) => import("@testing-library/react").RenderHookResult<K, T>;
|
|
3
|
+
export * from "@testing-library/react";
|
|
4
|
+
export { customRenderHook as renderHook };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RenderOptions } from "@testing-library/react";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
declare const customRender: (ui: React.ReactElement, options?: Omit<RenderOptions, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
4
|
-
export * from "@testing-library/react";
|
|
5
|
-
export { customRender as render };
|
|
1
|
+
import { RenderOptions } from "@testing-library/react";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const customRender: (ui: React.ReactElement, options?: Omit<RenderOptions, "queries">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
4
|
+
export * from "@testing-library/react";
|
|
5
|
+
export { customRender as render };
|
package/src/translation.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { NamespaceTransProps, TransForLibs, TranslationResource } from "@trackunit/i18n-library-translation";
|
|
3
|
-
import defaultTranslations from "./locales/en/translation.json";
|
|
4
|
-
/** A type for all available translation keys in this library */
|
|
5
|
-
export type TranslationKeys = keyof typeof defaultTranslations;
|
|
6
|
-
/** The translation namespace for this library */
|
|
7
|
-
export declare const namespace = "react.form-components";
|
|
8
|
-
/**
|
|
9
|
-
* The TranslationResource for this Library.
|
|
10
|
-
* Holds lazy loaded imports for all languages supported by the library.
|
|
11
|
-
*
|
|
12
|
-
* This is used to register the translations for this library before initializing i18next.
|
|
13
|
-
*/
|
|
14
|
-
export declare const translations: TranslationResource<TranslationKeys>;
|
|
15
|
-
/**
|
|
16
|
-
* Local useTranslation for this specific library
|
|
17
|
-
*/
|
|
18
|
-
export declare const useTranslation: () => [TransForLibs<never>, import("i18next").i18n, boolean] & {
|
|
19
|
-
t: TransForLibs<never>;
|
|
20
|
-
i18n: import("i18next").i18n;
|
|
21
|
-
ready: boolean;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Type of the t function for the local useTranslation for this specific library
|
|
25
|
-
*/
|
|
26
|
-
export type TranslationFunction = TransForLibs<TranslationKeys>;
|
|
27
|
-
/**
|
|
28
|
-
* Trans for this specific library.
|
|
29
|
-
*/
|
|
30
|
-
export declare const Trans: (props: NamespaceTransProps<TranslationKeys>) => JSX.Element;
|
|
31
|
-
/**
|
|
32
|
-
* Registers the translations for this library
|
|
33
|
-
*/
|
|
34
|
-
export declare const setupLibraryTranslations: () => void;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NamespaceTransProps, TransForLibs, TranslationResource } from "@trackunit/i18n-library-translation";
|
|
3
|
+
import defaultTranslations from "./locales/en/translation.json";
|
|
4
|
+
/** A type for all available translation keys in this library */
|
|
5
|
+
export type TranslationKeys = keyof typeof defaultTranslations;
|
|
6
|
+
/** The translation namespace for this library */
|
|
7
|
+
export declare const namespace = "react.form-components";
|
|
8
|
+
/**
|
|
9
|
+
* The TranslationResource for this Library.
|
|
10
|
+
* Holds lazy loaded imports for all languages supported by the library.
|
|
11
|
+
*
|
|
12
|
+
* This is used to register the translations for this library before initializing i18next.
|
|
13
|
+
*/
|
|
14
|
+
export declare const translations: TranslationResource<TranslationKeys>;
|
|
15
|
+
/**
|
|
16
|
+
* Local useTranslation for this specific library
|
|
17
|
+
*/
|
|
18
|
+
export declare const useTranslation: () => [TransForLibs<never>, import("i18next").i18n, boolean] & {
|
|
19
|
+
t: TransForLibs<never>;
|
|
20
|
+
i18n: import("i18next").i18n;
|
|
21
|
+
ready: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Type of the t function for the local useTranslation for this specific library
|
|
25
|
+
*/
|
|
26
|
+
export type TranslationFunction = TransForLibs<TranslationKeys>;
|
|
27
|
+
/**
|
|
28
|
+
* Trans for this specific library.
|
|
29
|
+
*/
|
|
30
|
+
export declare const Trans: (props: NamespaceTransProps<TranslationKeys>) => JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Registers the translations for this library
|
|
33
|
+
*/
|
|
34
|
+
export declare const setupLibraryTranslations: () => void;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface usePhoneInputProps {
|
|
3
|
-
/**
|
|
4
|
-
* The current country code value.
|
|
5
|
-
*/
|
|
6
|
-
countryCode: string;
|
|
7
|
-
/**
|
|
8
|
-
* The current phone number value.
|
|
9
|
-
*/
|
|
10
|
-
phoneNumber: string;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the country code value is invalid.
|
|
13
|
-
*/
|
|
14
|
-
isCountryCodeInvalid: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the phone number value is invalid.
|
|
17
|
-
*/
|
|
18
|
-
isPhoneNumberInvalid: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the full phone number value is valid.
|
|
21
|
-
*
|
|
22
|
-
* @returns {boolean} Whether the full phone number value is valid.
|
|
23
|
-
*/
|
|
24
|
-
isCombinedValueInvalid: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* A function for handling changes to the country code input.
|
|
27
|
-
*/
|
|
28
|
-
handleCountryCodeChange: (option: {
|
|
29
|
-
label: string;
|
|
30
|
-
value: string;
|
|
31
|
-
} | null) => void;
|
|
32
|
-
/**
|
|
33
|
-
* A function for handling changes to the phone number input.
|
|
34
|
-
*/
|
|
35
|
-
handlePhoneNumberChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
36
|
-
/**
|
|
37
|
-
* The combined country code and phone number value.
|
|
38
|
-
*
|
|
39
|
-
* @example "+123456789"
|
|
40
|
-
* @returns {string} Combined phone number
|
|
41
|
-
*/
|
|
42
|
-
combinedValue: string | number | readonly string[] | undefined;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A custom hook for managing phone number input state and validation.
|
|
46
|
-
*
|
|
47
|
-
* @returns {object} - An object containing state values and event handler functions.
|
|
48
|
-
* @property {string} countryCode - The current country code value.
|
|
49
|
-
* @property {string} phoneNumber - The current phone number value.
|
|
50
|
-
* @property {boolean} isCountryCodeInvalid - Whether the country code value is invalid.
|
|
51
|
-
* @property {boolean} isPhoneNumberInvalid - Whether the phone number value is invalid.
|
|
52
|
-
* @property {Function} handleCountryCodeChange - A function for handling changes to the country code input.
|
|
53
|
-
* @property {Function} handlePhoneNumberChange - A function for handling changes to the phone number input.
|
|
54
|
-
* @property {string} combinedValue - The combined country code and phone number value.
|
|
55
|
-
*/
|
|
56
|
-
export declare const usePhoneInput: (value: string | number | readonly string[] | undefined) => usePhoneInputProps;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface usePhoneInputProps {
|
|
3
|
+
/**
|
|
4
|
+
* The current country code value.
|
|
5
|
+
*/
|
|
6
|
+
countryCode: string;
|
|
7
|
+
/**
|
|
8
|
+
* The current phone number value.
|
|
9
|
+
*/
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the country code value is invalid.
|
|
13
|
+
*/
|
|
14
|
+
isCountryCodeInvalid: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the phone number value is invalid.
|
|
17
|
+
*/
|
|
18
|
+
isPhoneNumberInvalid: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the full phone number value is valid.
|
|
21
|
+
*
|
|
22
|
+
* @returns {boolean} Whether the full phone number value is valid.
|
|
23
|
+
*/
|
|
24
|
+
isCombinedValueInvalid: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A function for handling changes to the country code input.
|
|
27
|
+
*/
|
|
28
|
+
handleCountryCodeChange: (option: {
|
|
29
|
+
label: string;
|
|
30
|
+
value: string;
|
|
31
|
+
} | null) => void;
|
|
32
|
+
/**
|
|
33
|
+
* A function for handling changes to the phone number input.
|
|
34
|
+
*/
|
|
35
|
+
handlePhoneNumberChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
36
|
+
/**
|
|
37
|
+
* The combined country code and phone number value.
|
|
38
|
+
*
|
|
39
|
+
* @example "+123456789"
|
|
40
|
+
* @returns {string} Combined phone number
|
|
41
|
+
*/
|
|
42
|
+
combinedValue: string | number | readonly string[] | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A custom hook for managing phone number input state and validation.
|
|
46
|
+
*
|
|
47
|
+
* @returns {object} - An object containing state values and event handler functions.
|
|
48
|
+
* @property {string} countryCode - The current country code value.
|
|
49
|
+
* @property {string} phoneNumber - The current phone number value.
|
|
50
|
+
* @property {boolean} isCountryCodeInvalid - Whether the country code value is invalid.
|
|
51
|
+
* @property {boolean} isPhoneNumberInvalid - Whether the phone number value is invalid.
|
|
52
|
+
* @property {Function} handleCountryCodeChange - A function for handling changes to the country code input.
|
|
53
|
+
* @property {Function} handlePhoneNumberChange - A function for handling changes to the phone number input.
|
|
54
|
+
* @property {string} combinedValue - The combined country code and phone number value.
|
|
55
|
+
*/
|
|
56
|
+
export declare const usePhoneInput: (value: string | number | readonly string[] | undefined) => usePhoneInputProps;
|