@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.
Files changed (69) hide show
  1. package/index.cjs +14355 -1195
  2. package/index.js +14372 -1206
  3. package/package.json +5 -5
  4. package/src/components/ActionButton/ActionButton.d.ts +26 -26
  5. package/src/components/ActionButton/index.d.ts +1 -1
  6. package/src/components/BaseInput/BaseInput.d.ts +62 -62
  7. package/src/components/BaseInput/index.d.ts +1 -1
  8. package/src/components/Checkbox/CheckIcon.d.ts +12 -12
  9. package/src/components/Checkbox/Checkbox.d.ts +48 -48
  10. package/src/components/Checkbox/IndeterminateIcon.d.ts +10 -10
  11. package/src/components/Checkbox/index.d.ts +1 -1
  12. package/src/components/DateField/DateField.d.ts +19 -19
  13. package/src/components/DateInput/DateInput.d.ts +28 -28
  14. package/src/components/DropZone/DropZone.d.ts +34 -34
  15. package/src/components/EmailField/EmailField.d.ts +17 -17
  16. package/src/components/EmailInput/EmailInput.d.ts +13 -13
  17. package/src/components/EmailInput/index.d.ts +1 -1
  18. package/src/components/FormGroup/FormGroup.d.ts +39 -39
  19. package/src/components/Label/Label.d.ts +34 -34
  20. package/src/components/Label/index.d.ts +1 -1
  21. package/src/components/NumberField/NumberField.d.ts +19 -19
  22. package/src/components/NumberInput/NumberInput.d.ts +12 -12
  23. package/src/components/OptionCard/OptionCard.d.ts +24 -24
  24. package/src/components/PhoneField/PhoneField.d.ts +28 -28
  25. package/src/components/PhoneInput/CountryCodeSelect.d.ts +23 -23
  26. package/src/components/PhoneInput/CountryCodes.d.ts +5 -5
  27. package/src/components/PhoneInput/PhoneInput.d.ts +34 -34
  28. package/src/components/PhoneInput/PhoneNumberUtilities.d.ts +13 -13
  29. package/src/components/PhoneInput/index.d.ts +1 -1
  30. package/src/components/RadioGroup/RadioGroup.d.ts +57 -57
  31. package/src/components/RadioGroup/RadioGroupContext.d.ts +11 -11
  32. package/src/components/RadioGroup/RadioItem.d.ts +23 -23
  33. package/src/components/RadioGroup/index.d.ts +2 -2
  34. package/src/components/Schedule/Schedule.d.ts +45 -37
  35. package/src/components/Schedule/Schedule.variants.d.ts +2 -2
  36. package/src/components/Search/Search.d.ts +62 -62
  37. package/src/components/Search/index.d.ts +1 -1
  38. package/src/components/Select/CreatableSelect.d.ts +38 -38
  39. package/src/components/Select/FieldContainer.d.ts +20 -20
  40. package/src/components/Select/Select.d.ts +18 -18
  41. package/src/components/Select/SelectMenuItem/SelectMenuItem.d.ts +49 -49
  42. package/src/components/Select/TagWithWidth.d.ts +17 -17
  43. package/src/components/Select/TagsContainer.d.ts +45 -45
  44. package/src/components/Select/index.d.ts +7 -7
  45. package/src/components/Select/shared.d.ts +15 -15
  46. package/src/components/Select/useCustomComponents.d.ts +19 -19
  47. package/src/components/Select/useCustomStyles.d.ts +14 -14
  48. package/src/components/Select/useSelect.d.ts +143 -143
  49. package/src/components/TextArea/TextArea.d.ts +30 -30
  50. package/src/components/TextArea/index.d.ts +1 -1
  51. package/src/components/TextAreaField/TextAreaField.d.ts +18 -18
  52. package/src/components/TextAreaField/index.d.ts +1 -1
  53. package/src/components/TextField/TextField.d.ts +24 -24
  54. package/src/components/TextField/TextLenghtIndicator.d.ts +19 -19
  55. package/src/components/TextField/index.d.ts +1 -1
  56. package/src/components/TextInput/TextInput.d.ts +12 -12
  57. package/src/components/TimeRange/TimeRange.d.ts +52 -52
  58. package/src/components/TimeRange/TimeRange.variants.d.ts +1 -3
  59. package/src/components/TimeRange/index.d.ts +1 -1
  60. package/src/components/TimeRangeField/TimeRangeField.d.ts +18 -18
  61. package/src/components/Toggle/Toggle.d.ts +61 -61
  62. package/src/components/Toggle/index.d.ts +1 -1
  63. package/src/components/UploadField/UploadField.d.ts +15 -15
  64. package/src/components/UploadInput/UploadInput.d.ts +33 -33
  65. package/src/index.d.ts +28 -28
  66. package/src/test-utils/hooks.d.ts +4 -4
  67. package/src/test-utils/test-utils.d.ts +5 -5
  68. package/src/translation.d.ts +34 -34
  69. package/src/utilities/usePhoneInput.d.ts +56 -56
@@ -1,39 +1,39 @@
1
- import { CommonProps } from "@trackunit/react-components";
2
- import * as React from "react";
3
- export interface FormGroupProps extends CommonProps {
4
- /**
5
- * The label for the form group.
6
- */
7
- label: string | React.ReactNode;
8
- /**
9
- * Content to display in the tooltip when hovering the ? icon next to the label.
10
- */
11
- tip?: string | React.ReactNode;
12
- htmlFor?: string;
13
- /**
14
- * A string to display under the input element to help the user understand the input.
15
- */
16
- helpText?: string | null;
17
- /**
18
- * An addon element to render to the right under the input element.
19
- * Used for displaying maxLength etc.
20
- */
21
- helpAddon?: string | React.ReactNode;
22
- /**
23
- * If true the input is rendered in its invalid state.
24
- */
25
- isInvalid?: boolean;
26
- /**
27
- * If true interactions are disabled
28
- */
29
- disabled?: boolean;
30
- children?: React.ReactNode;
31
- }
32
- /**
33
- * The FormGroup component should be used to wrap any Input element that needs a label.
34
- * Besides a label the component supplies an optional Tip, HelpText and HelpAddon support.
35
- *
36
- * @param {FormGroupProps} props - The props for the FormGroup component
37
- * @returns {JSX.Element} FormGroup component
38
- */
39
- export declare const FormGroup: ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, disabled, }: FormGroupProps) => JSX.Element;
1
+ import { CommonProps } from "@trackunit/react-components";
2
+ import * as React from "react";
3
+ export interface FormGroupProps extends CommonProps {
4
+ /**
5
+ * The label for the form group.
6
+ */
7
+ label: string | React.ReactNode;
8
+ /**
9
+ * Content to display in the tooltip when hovering the ? icon next to the label.
10
+ */
11
+ tip?: string | React.ReactNode;
12
+ htmlFor?: string;
13
+ /**
14
+ * A string to display under the input element to help the user understand the input.
15
+ */
16
+ helpText?: string | null;
17
+ /**
18
+ * An addon element to render to the right under the input element.
19
+ * Used for displaying maxLength etc.
20
+ */
21
+ helpAddon?: string | React.ReactNode;
22
+ /**
23
+ * If true the input is rendered in its invalid state.
24
+ */
25
+ isInvalid?: boolean;
26
+ /**
27
+ * If true interactions are disabled
28
+ */
29
+ disabled?: boolean;
30
+ children?: React.ReactNode;
31
+ }
32
+ /**
33
+ * The FormGroup component should be used to wrap any Input element that needs a label.
34
+ * Besides a label the component supplies an optional Tip, HelpText and HelpAddon support.
35
+ *
36
+ * @param {FormGroupProps} props - The props for the FormGroup component
37
+ * @returns {JSX.Element} FormGroup component
38
+ */
39
+ export declare const FormGroup: ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, disabled, }: FormGroupProps) => JSX.Element;
@@ -1,34 +1,34 @@
1
- import { CommonProps } from "@trackunit/react-components";
2
- import * as React from "react";
3
- import "./Label.css";
4
- export interface LabelProps extends CommonProps {
5
- /**
6
- * ID of the label.
7
- */
8
- id?: string;
9
- /**
10
- * Specifies the element to which the label belongs to.
11
- */
12
- htmlFor?: string;
13
- /**
14
- * The label value.
15
- */
16
- children?: React.ReactNode;
17
- /**
18
- * Whether the label is disabled or not.
19
- */
20
- disabled?: boolean;
21
- /**
22
- * A boolean flag to set invalid mode
23
- * can be used for indicating errors
24
- */
25
- isInvalid?: boolean;
26
- }
27
- /**
28
- * The Label component is used for labels for input fields.
29
- * This component is **not used directly**, but is part of the FormGroup and Field components.
30
- *
31
- * @param {LabelProps} props - The props for the Label component
32
- * @returns {JSX.Element} Label component
33
- */
34
- export declare const Label: ({ id, htmlFor, children, className, dataTestId, disabled, isInvalid, }: LabelProps) => JSX.Element;
1
+ import { CommonProps } from "@trackunit/react-components";
2
+ import * as React from "react";
3
+ import "./Label.css";
4
+ export interface LabelProps extends CommonProps {
5
+ /**
6
+ * ID of the label.
7
+ */
8
+ id?: string;
9
+ /**
10
+ * Specifies the element to which the label belongs to.
11
+ */
12
+ htmlFor?: string;
13
+ /**
14
+ * The label value.
15
+ */
16
+ children?: React.ReactNode;
17
+ /**
18
+ * Whether the label is disabled or not.
19
+ */
20
+ disabled?: boolean;
21
+ /**
22
+ * A boolean flag to set invalid mode
23
+ * can be used for indicating errors
24
+ */
25
+ isInvalid?: boolean;
26
+ }
27
+ /**
28
+ * The Label component is used for labels for input fields.
29
+ * This component is **not used directly**, but is part of the FormGroup and Field components.
30
+ *
31
+ * @param {LabelProps} props - The props for the Label component
32
+ * @returns {JSX.Element} Label component
33
+ */
34
+ export declare const Label: ({ id, htmlFor, children, className, dataTestId, disabled, isInvalid, }: LabelProps) => JSX.Element;
@@ -1 +1 @@
1
- export * from "./Label";
1
+ export * from "./Label";
@@ -1,19 +1,19 @@
1
- /// <reference types="react" />
2
- import { FormGroupProps } from "../FormGroup/FormGroup";
3
- import { NumberInputProps } from "../NumberInput/NumberInput";
4
- type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
5
- export interface NumberFieldProps extends NumberInputProps, FormGroupExposedProps {
6
- /**
7
- * If a value is set, the field is rendered in its invalid state.
8
- */
9
- errorMessage?: string;
10
- }
11
- /**
12
- * The number field component is used for entering numeric values and includes controls for incrementally increasing or decreasing the value.
13
- *
14
- * _**Do use**_ the NumberField when the controls to incrementally increase or decrease makes the task easier for the user.
15
- *
16
- * _**Do not use**_ this fields for non-serialized numbers. Use TextField instead.
17
- */
18
- export declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLInputElement>>;
19
- export {};
1
+ /// <reference types="react" />
2
+ import { FormGroupProps } from "../FormGroup/FormGroup";
3
+ import { NumberInputProps } from "../NumberInput/NumberInput";
4
+ type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
5
+ export interface NumberFieldProps extends NumberInputProps, FormGroupExposedProps {
6
+ /**
7
+ * If a value is set, the field is rendered in its invalid state.
8
+ */
9
+ errorMessage?: string;
10
+ }
11
+ /**
12
+ * The number field component is used for entering numeric values and includes controls for incrementally increasing or decreasing the value.
13
+ *
14
+ * _**Do use**_ the NumberField when the controls to incrementally increase or decrease makes the task easier for the user.
15
+ *
16
+ * _**Do not use**_ this fields for non-serialized numbers. Use TextField instead.
17
+ */
18
+ export declare const NumberField: import("react").ForwardRefExoticComponent<NumberFieldProps & import("react").RefAttributes<HTMLInputElement>>;
19
+ export {};
@@ -1,12 +1,12 @@
1
- /// <reference types="react" />
2
- import { BaseInputProps } from "../BaseInput";
3
- type BaseInputExposedProps = Omit<BaseInputProps, "type">;
4
- export interface NumberInputProps extends BaseInputExposedProps {
5
- }
6
- /**
7
- * A thin wrapper around the `BaseInput` component for number input fields.
8
- *
9
- * NOTE: If shown with a label, please use the `NumberField` component instead.
10
- */
11
- export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
12
- export {};
1
+ /// <reference types="react" />
2
+ import { BaseInputProps } from "../BaseInput";
3
+ type BaseInputExposedProps = Omit<BaseInputProps, "type">;
4
+ export interface NumberInputProps extends BaseInputExposedProps {
5
+ }
6
+ /**
7
+ * A thin wrapper around the `BaseInput` component for number input fields.
8
+ *
9
+ * NOTE: If shown with a label, please use the `NumberField` component instead.
10
+ */
11
+ export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
12
+ export {};
@@ -1,24 +1,24 @@
1
- import { CommonProps, IconProps } from "@trackunit/react-components";
2
- import { InputHTMLAttributes, ReactElement } from "react";
3
- export interface IOptionCardProps extends InputHTMLAttributes<HTMLInputElement>, CommonProps {
4
- /**
5
- * Icon displayed at the top inside the OptionCard.
6
- */
7
- icon?: ReactElement<IconProps>;
8
- /**
9
- * Heading displayed below the icon.
10
- */
11
- heading?: string;
12
- /**
13
- * Subheading displayed above the description.
14
- */
15
- subheading?: string;
16
- /**
17
- * Descriptive text displayed inside the OptionCard.
18
- */
19
- description?: string;
20
- }
21
- /**
22
- * A card version of a radio button that includes an icon, headings and a description.
23
- */
24
- export declare const OptionCard: import("react").ForwardRefExoticComponent<IOptionCardProps & import("react").RefAttributes<HTMLInputElement>>;
1
+ import { CommonProps, IconProps } from "@trackunit/react-components";
2
+ import { InputHTMLAttributes, ReactElement } from "react";
3
+ export interface IOptionCardProps extends InputHTMLAttributes<HTMLInputElement>, CommonProps {
4
+ /**
5
+ * Icon displayed at the top inside the OptionCard.
6
+ */
7
+ icon?: ReactElement<IconProps>;
8
+ /**
9
+ * Heading displayed below the icon.
10
+ */
11
+ heading?: string;
12
+ /**
13
+ * Subheading displayed above the description.
14
+ */
15
+ subheading?: string;
16
+ /**
17
+ * Descriptive text displayed inside the OptionCard.
18
+ */
19
+ description?: string;
20
+ }
21
+ /**
22
+ * A card version of a radio button that includes an icon, headings and a description.
23
+ */
24
+ export declare const OptionCard: import("react").ForwardRefExoticComponent<IOptionCardProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,28 +1,28 @@
1
- /// <reference types="react" />
2
- import { FormGroupProps } from "../FormGroup/FormGroup";
3
- import { PhoneInputProps } from "../PhoneInput/PhoneInput";
4
- type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
5
- export interface PhoneFieldProps extends FormGroupExposedProps, PhoneInputProps {
6
- /**
7
- * If a value is set, the field is rendered in its invalid state.
8
- */
9
- errorMessage?: string;
10
- }
11
- /**
12
- * The PhoneField component is used to enter phone number.
13
- * It is a wrapper around the PhoneInput component and the FormGroup component.
14
- * It is used to render a phone number field with a label, a tip, a help text, a help addon and an error message.
15
- *
16
- * @param {string} [label] - The label for the component.
17
- * @param {string} [tip] - The tip for the component.
18
- * @param {string} [helpText] - The help text for the component.
19
- * @param {string} [helpAddon] - The help addon for the component.
20
- * @param {string} [errorMessage] - The error message for the component.
21
- * @param {string} [defaultValue] - The default value for the component.
22
- * @param {boolean} [disabled=false] - Whether the component is disabled or not.
23
- * @param {string} [fieldSize="medium"] - The size of the input field.
24
- * @param {boolean} [disableAction=false] - Whether the action button is disabled or not.
25
- * @returns {JSX.Element} - The PhoneField component.
26
- */
27
- export declare const PhoneField: import("react").ForwardRefExoticComponent<PhoneFieldProps & import("react").RefAttributes<HTMLInputElement>>;
28
- export {};
1
+ /// <reference types="react" />
2
+ import { FormGroupProps } from "../FormGroup/FormGroup";
3
+ import { PhoneInputProps } from "../PhoneInput/PhoneInput";
4
+ type FormGroupExposedProps = Pick<FormGroupProps, "label" | "tip" | "helpText" | "helpAddon">;
5
+ export interface PhoneFieldProps extends FormGroupExposedProps, PhoneInputProps {
6
+ /**
7
+ * If a value is set, the field is rendered in its invalid state.
8
+ */
9
+ errorMessage?: string;
10
+ }
11
+ /**
12
+ * The PhoneField component is used to enter phone number.
13
+ * It is a wrapper around the PhoneInput component and the FormGroup component.
14
+ * It is used to render a phone number field with a label, a tip, a help text, a help addon and an error message.
15
+ *
16
+ * @param {string} [label] - The label for the component.
17
+ * @param {string} [tip] - The tip for the component.
18
+ * @param {string} [helpText] - The help text for the component.
19
+ * @param {string} [helpAddon] - The help addon for the component.
20
+ * @param {string} [errorMessage] - The error message for the component.
21
+ * @param {string} [defaultValue] - The default value for the component.
22
+ * @param {boolean} [disabled=false] - Whether the component is disabled or not.
23
+ * @param {string} [fieldSize="medium"] - The size of the input field.
24
+ * @param {boolean} [disableAction=false] - Whether the action button is disabled or not.
25
+ * @returns {JSX.Element} - The PhoneField component.
26
+ */
27
+ export declare const PhoneField: import("react").ForwardRefExoticComponent<PhoneFieldProps & import("react").RefAttributes<HTMLInputElement>>;
28
+ export {};
@@ -1,23 +1,23 @@
1
- /// <reference types="react" />
2
- import { CommonProps } from "@trackunit/react-components";
3
- import { SingleValue } from "react-select";
4
- import { CountryCode } from "./CountryCodes";
5
- interface CountryCodeSelectProps extends CommonProps {
6
- excludedCountries?: CountryCode;
7
- countryCode?: string;
8
- isInvalid?: boolean;
9
- onChange?: (option: SingleValue<{
10
- label: string;
11
- value: string;
12
- }>) => void;
13
- disabled?: boolean;
14
- placeholder?: string;
15
- }
16
- /**
17
- * The CountryCodeSelect component is used to select a country code for a phone number.
18
- *
19
- * @param {CountryCodeSelectProps} props - The props for the CountryCodeSelect component
20
- * @returns {JSX.Element} CountryCodeSelect component
21
- */
22
- export declare const CountryCodeSelect: ({ excludedCountries, countryCode, isInvalid, onChange, disabled, dataTestId, placeholder, }: CountryCodeSelectProps) => JSX.Element;
23
- export {};
1
+ /// <reference types="react" />
2
+ import { CommonProps } from "@trackunit/react-components";
3
+ import { SingleValue } from "react-select";
4
+ import { CountryCode } from "./CountryCodes";
5
+ interface CountryCodeSelectProps extends CommonProps {
6
+ excludedCountries?: CountryCode;
7
+ countryCode?: string;
8
+ isInvalid?: boolean;
9
+ onChange?: (option: SingleValue<{
10
+ label: string;
11
+ value: string;
12
+ }>) => void;
13
+ disabled?: boolean;
14
+ placeholder?: string;
15
+ }
16
+ /**
17
+ * The CountryCodeSelect component is used to select a country code for a phone number.
18
+ *
19
+ * @param {CountryCodeSelectProps} props - The props for the CountryCodeSelect component
20
+ * @returns {JSX.Element} CountryCodeSelect component
21
+ */
22
+ export declare const CountryCodeSelect: ({ excludedCountries, countryCode, isInvalid, onChange, disabled, dataTestId, placeholder, }: CountryCodeSelectProps) => JSX.Element;
23
+ export {};
@@ -1,5 +1,5 @@
1
- export declare const countryCodes: {
2
- label: string;
3
- value: string;
4
- }[];
5
- export type CountryCode = typeof countryCodes;
1
+ export declare const countryCodes: {
2
+ label: string;
3
+ value: string;
4
+ }[];
5
+ export type CountryCode = typeof countryCodes;
@@ -1,34 +1,34 @@
1
- /// <reference types="react" />
2
- import { BaseInputProps } from "../BaseInput";
3
- type BaseInputExposedProps = Omit<BaseInputProps, "actions">;
4
- interface PhoneNumberProps {
5
- countryCode: string;
6
- phoneNumber: string;
7
- }
8
- export interface PhoneInputProps extends BaseInputExposedProps {
9
- /**
10
- * To disable the action button.
11
- *
12
- * @default false
13
- * @memberof PhoneInputProps
14
- * @example
15
- * <PhoneInput disableAction />
16
- */
17
- disableAction?: boolean;
18
- /**
19
- * A callback function that gives you the country code and phone number as separate values.
20
- */
21
- onChangeGetSeparateValues?: (params: PhoneNumberProps) => void;
22
- }
23
- /**
24
- * A component for inputting phone numbers with an optional action button for initiating a phone call.
25
- *
26
- * @param {string} [dataTestId] - The data test ID for the component.
27
- * @param {string|number} [value] - The value of the input field. The value should include the country code as well.
28
- * @param {boolean} [disabled=false] - Whether the component is disabled or not.
29
- * @param {string} [fieldSize="medium"] - The size of the input field.
30
- * @param {boolean} [disableAction=false] - Whether the action button is disabled or not.
31
- * @returns {JSX.Element} - The PhoneInput component.
32
- */
33
- export declare const PhoneInput: import("react").ForwardRefExoticComponent<PhoneInputProps & import("react").RefAttributes<HTMLInputElement>>;
34
- export {};
1
+ /// <reference types="react" />
2
+ import { BaseInputProps } from "../BaseInput";
3
+ type BaseInputExposedProps = Omit<BaseInputProps, "actions">;
4
+ interface PhoneNumberProps {
5
+ countryCode: string;
6
+ phoneNumber: string;
7
+ }
8
+ export interface PhoneInputProps extends BaseInputExposedProps {
9
+ /**
10
+ * To disable the action button.
11
+ *
12
+ * @default false
13
+ * @memberof PhoneInputProps
14
+ * @example
15
+ * <PhoneInput disableAction />
16
+ */
17
+ disableAction?: boolean;
18
+ /**
19
+ * A callback function that gives you the country code and phone number as separate values.
20
+ */
21
+ onChangeGetSeparateValues?: (params: PhoneNumberProps) => void;
22
+ }
23
+ /**
24
+ * A component for inputting phone numbers with an optional action button for initiating a phone call.
25
+ *
26
+ * @param {string} [dataTestId] - The data test ID for the component.
27
+ * @param {string|number} [value] - The value of the input field. The value should include the country code as well.
28
+ * @param {boolean} [disabled=false] - Whether the component is disabled or not.
29
+ * @param {string} [fieldSize="medium"] - The size of the input field.
30
+ * @param {boolean} [disableAction=false] - Whether the action button is disabled or not.
31
+ * @returns {JSX.Element} - The PhoneInput component.
32
+ */
33
+ export declare const PhoneInput: import("react").ForwardRefExoticComponent<PhoneInputProps & import("react").RefAttributes<HTMLInputElement>>;
34
+ export {};
@@ -1,13 +1,13 @@
1
- /**
2
- * @param phoneNumber - a phone number as a string
3
- * @returns {boolean} true if the phone number starts with a plus sign
4
- * @example checkIfPhoneNumberHasPlus("123456789") // false
5
- * checkIfPhoneNumberHasPlus("+123456789") // true
6
- */
7
- export declare const checkIfPhoneNumberHasPlus: (phoneNumber: string) => boolean;
8
- /**
9
- * @param phoneNumber - a phone number as a string
10
- * @returns {string|number} the phone number with a plus sign in front of it
11
- * @example getPhoneNumberWithPlus("123456789") // "+123456789"
12
- */
13
- export declare const getPhoneNumberWithPlus: (phoneNumber: string | number | readonly string[]) => string;
1
+ /**
2
+ * @param phoneNumber - a phone number as a string
3
+ * @returns {boolean} true if the phone number starts with a plus sign
4
+ * @example checkIfPhoneNumberHasPlus("123456789") // false
5
+ * checkIfPhoneNumberHasPlus("+123456789") // true
6
+ */
7
+ export declare const checkIfPhoneNumberHasPlus: (phoneNumber: string) => boolean;
8
+ /**
9
+ * @param phoneNumber - a phone number as a string
10
+ * @returns {string|number} the phone number with a plus sign in front of it
11
+ * @example getPhoneNumberWithPlus("123456789") // "+123456789"
12
+ */
13
+ export declare const getPhoneNumberWithPlus: (phoneNumber: string | number | readonly string[]) => string;
@@ -1 +1 @@
1
- export * from "./PhoneInput";
1
+ export * from "./PhoneInput";
@@ -1,57 +1,57 @@
1
- import { CommonProps } from "@trackunit/react-components";
2
- import * as React from "react";
3
- import "./RadioGroup.css";
4
- export interface RadioGroupProps<V extends string | number> extends CommonProps, React.InputHTMLAttributes<HTMLInputElement> {
5
- /**
6
- */
7
- children: React.ReactNode;
8
- /**
9
- * The id of the radio group.
10
- */
11
- id: string;
12
- /**
13
- * onChange handler for the radio group.
14
- */
15
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
16
- /**
17
- * The value of the radio group.
18
- */
19
- value: V;
20
- /**
21
- * The name of the radio group.
22
- */
23
- name?: string;
24
- /**
25
- * The label of the radio group.
26
- */
27
- label?: string;
28
- /**
29
- * Whether the radiogroup is inline or not.
30
- */
31
- inline?: boolean;
32
- /**
33
- * Whether the radio group is disabled or not.
34
- */
35
- disabled?: boolean;
36
- /**
37
- * A boolean flag to set invalid mode
38
- * can be used for indicating errors
39
- */
40
- isInvalid?: boolean;
41
- }
42
- /**
43
- * Use radio buttons when you have a group of mutually exclusive choices and only one selection from the group is allowed.
44
- *
45
- * Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.
46
- *
47
- * _**Do use** Radio buttons in forms, settings, or selections in a list._
48
- *
49
- * _**Do not use** Radio buttons if a user can select many option from a list, use checkboxes instead of radio buttons._
50
- *
51
- * @param {RadioGroupProps} props - The props for the RadioGroup component
52
- * @returns {JSX.Element} RadioGroup component
53
- */
54
- export declare const RadioGroup: {
55
- <V extends string | number = string>({ children, id, name, value, disabled, onChange, label, inline, className, dataTestId, isInvalid, }: RadioGroupProps<V>): JSX.Element;
56
- displayName: string;
57
- };
1
+ import { CommonProps } from "@trackunit/react-components";
2
+ import * as React from "react";
3
+ import "./RadioGroup.css";
4
+ export interface RadioGroupProps<V extends string | number> extends CommonProps, React.InputHTMLAttributes<HTMLInputElement> {
5
+ /**
6
+ */
7
+ children: React.ReactNode;
8
+ /**
9
+ * The id of the radio group.
10
+ */
11
+ id: string;
12
+ /**
13
+ * onChange handler for the radio group.
14
+ */
15
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
16
+ /**
17
+ * The value of the radio group.
18
+ */
19
+ value: V;
20
+ /**
21
+ * The name of the radio group.
22
+ */
23
+ name?: string;
24
+ /**
25
+ * The label of the radio group.
26
+ */
27
+ label?: string;
28
+ /**
29
+ * Whether the radiogroup is inline or not.
30
+ */
31
+ inline?: boolean;
32
+ /**
33
+ * Whether the radio group is disabled or not.
34
+ */
35
+ disabled?: boolean;
36
+ /**
37
+ * A boolean flag to set invalid mode
38
+ * can be used for indicating errors
39
+ */
40
+ isInvalid?: boolean;
41
+ }
42
+ /**
43
+ * Use radio buttons when you have a group of mutually exclusive choices and only one selection from the group is allowed.
44
+ *
45
+ * Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.
46
+ *
47
+ * _**Do use** Radio buttons in forms, settings, or selections in a list._
48
+ *
49
+ * _**Do not use** Radio buttons if a user can select many option from a list, use checkboxes instead of radio buttons._
50
+ *
51
+ * @param {RadioGroupProps} props - The props for the RadioGroup component
52
+ * @returns {JSX.Element} RadioGroup component
53
+ */
54
+ export declare const RadioGroup: {
55
+ <V extends string | number = string>({ children, id, name, value, disabled, onChange, label, inline, className, dataTestId, isInvalid, }: RadioGroupProps<V>): JSX.Element;
56
+ displayName: string;
57
+ };
@@ -1,11 +1,11 @@
1
- import * as React from "react";
2
- interface RadioGroupContextProps {
3
- id: string;
4
- name: string;
5
- value: string | number;
6
- disabled?: boolean;
7
- isInvalid?: boolean;
8
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
9
- }
10
- export declare const RadioGroupContext: React.Context<RadioGroupContextProps | null>;
11
- export {};
1
+ import * as React from "react";
2
+ interface RadioGroupContextProps {
3
+ id: string;
4
+ name: string;
5
+ value: string | number;
6
+ disabled?: boolean;
7
+ isInvalid?: boolean;
8
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
9
+ }
10
+ export declare const RadioGroupContext: React.Context<RadioGroupContextProps | null>;
11
+ export {};