@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,23 +1,23 @@
1
- import { CommonProps } from "@trackunit/react-components";
2
- import * as React from "react";
3
- export interface RadioItemProps<V extends string | number = string> extends CommonProps {
4
- /**
5
- * The label of the radio item.
6
- */
7
- label: React.ReactNode;
8
- /**
9
- * The value of the radio item.
10
- */
11
- value: V;
12
- /**
13
- * The description of the radio item.
14
- */
15
- description?: string;
16
- }
17
- /**
18
- * The RadioItem component.
19
- *
20
- * @param {RadioItemProps} props - The props for the RadioItem component
21
- * @returns {JSX.Element} RadioItem component
22
- */
23
- export declare const RadioItem: <V extends string | number>({ label, value, dataTestId, className, description, }: RadioItemProps<V>) => JSX.Element;
1
+ import { CommonProps } from "@trackunit/react-components";
2
+ import * as React from "react";
3
+ export interface RadioItemProps<V extends string | number = string> extends CommonProps {
4
+ /**
5
+ * The label of the radio item.
6
+ */
7
+ label: React.ReactNode;
8
+ /**
9
+ * The value of the radio item.
10
+ */
11
+ value: V;
12
+ /**
13
+ * The description of the radio item.
14
+ */
15
+ description?: string;
16
+ }
17
+ /**
18
+ * The RadioItem component.
19
+ *
20
+ * @param {RadioItemProps} props - The props for the RadioItem component
21
+ * @returns {JSX.Element} RadioItem component
22
+ */
23
+ export declare const RadioItem: <V extends string | number>({ label, value, dataTestId, className, description, }: RadioItemProps<V>) => JSX.Element;
@@ -1,2 +1,2 @@
1
- export * from "./RadioGroup";
2
- export * from "./RadioItem";
1
+ export * from "./RadioGroup";
2
+ export * from "./RadioItem";
@@ -1,37 +1,45 @@
1
- /// <reference types="react" />
2
- import { CommonProps } from "@trackunit/react-components";
3
- import { TimeRangeInput } from "../TimeRange";
4
- export interface ScheduleItem {
5
- /**
6
- * The label for the schedule item.
7
- */
8
- label: string;
9
- /**
10
- * The time range input for the schedule item.
11
- */
12
- range: TimeRangeInput;
13
- /**
14
- * Indicates whether the schedule item is active.
15
- */
16
- isActive: boolean;
17
- }
18
- export interface ScheduleProps extends CommonProps {
19
- /**
20
- * List of schedule rows.
21
- */
22
- schedule: ScheduleItem[];
23
- /**
24
- * Called when time range or checkbox changes state.
25
- *
26
- * @param {ScheduleItem[]} schedules Updated schedule entries
27
- * @returns {void}
28
- */
29
- onChange: (schedules: ScheduleItem[]) => void;
30
- }
31
- /**
32
- * Schedule is used to create a time range entries.
33
- *
34
- * @param {ScheduleProps} props - The props for the Schedule component
35
- * @returns {JSX.Element} Schedule component
36
- */
37
- export declare const Schedule: ({ className, dataTestId, schedule, onChange }: ScheduleProps) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { CommonProps } from "@trackunit/react-components";
3
+ import { TimeRangeInput } from "../TimeRange";
4
+ export interface ScheduleItem {
5
+ /**
6
+ * The key for the schedule item.
7
+ */
8
+ key?: string;
9
+ /**
10
+ * The label for the schedule item.
11
+ */
12
+ label: string;
13
+ /**
14
+ * The time range input for the schedule item.
15
+ */
16
+ range: TimeRangeInput;
17
+ /**
18
+ * Indicates whether the schedule item is active.
19
+ */
20
+ isActive: boolean;
21
+ }
22
+ export interface ScheduleProps extends CommonProps {
23
+ /**
24
+ * List of schedule rows.
25
+ */
26
+ schedule: ScheduleItem[];
27
+ /**
28
+ * List of invalid keys.
29
+ */
30
+ invalidKeys?: string[];
31
+ /**
32
+ * Called when time range or checkbox changes state.
33
+ *
34
+ * @param {ScheduleItem[]} schedules Updated schedule entries
35
+ * @returns {void}
36
+ */
37
+ onChange: (schedules: ScheduleItem[]) => void;
38
+ }
39
+ /**
40
+ * Schedule is used to create a time range entries.
41
+ *
42
+ * @param {ScheduleProps} props - The props for the Schedule component
43
+ * @returns {JSX.Element} Schedule component
44
+ */
45
+ export declare const Schedule: ({ className, dataTestId, schedule, onChange, invalidKeys }: ScheduleProps) => JSX.Element;
@@ -1,2 +1,2 @@
1
- export declare const cvaScheduleItem: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
2
- export declare const cvaScheduleItemText: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
1
+ export declare const cvaScheduleItem: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
2
+ export declare const cvaScheduleItemText: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
@@ -1,62 +1,62 @@
1
- import { CommonProps } from "@trackunit/react-components";
2
- import * as React from "react";
3
- import { TextInputProps } from "../TextInput/TextInput";
4
- export interface SearchProps extends CommonProps, TextInputProps {
5
- /**
6
- * The name for the HTML element.
7
- */
8
- name?: string;
9
- /**
10
- * Placeholder string to be shown in the search box.
11
- */
12
- placeholder?: string;
13
- /**
14
- * Whether the search box should widen to take up full width while in focus or not.
15
- * If disabled, the search box takes up full width when not in focus.
16
- */
17
- widenInputOnFocus?: boolean;
18
- /**
19
- * Whether the border for the search box should be displayed while the search box is not in focus.
20
- */
21
- showBorderWhenNotInFocus?: boolean;
22
- /**
23
- * Value rendered in the search box.
24
- */
25
- value?: string;
26
- /**
27
- * Whether the search box is disabled or not.
28
- */
29
- disabled?: boolean;
30
- /**
31
- * Specify what if any permission the user agent has to provide automated assistance in filling out search values.
32
- */
33
- autoComplete?: string;
34
- /**
35
- * Event that occurs when the user releases a key.
36
- */
37
- onKeyUp?: (evt: React.KeyboardEvent<HTMLInputElement>) => void;
38
- /**
39
- * Event that occurs when there is a change.
40
- */
41
- onChange?: (evt: React.ChangeEvent<HTMLInputElement>) => void;
42
- /**
43
- * Event that occurs when the search box is on focus.
44
- */
45
- onFocus?: (evt: React.FocusEvent<HTMLInputElement>) => void;
46
- /**
47
- * Event that occurs when search box is blurred.
48
- */
49
- onBlur?: (evt: React.FocusEvent<HTMLInputElement>) => void;
50
- /**
51
- * Event that search box is cleared.
52
- */
53
- onClear?: () => void;
54
- ref?: React.Ref<HTMLInputElement | undefined>;
55
- }
56
- /**
57
- * The Search component is used to render a search input field.
58
- *
59
- * @param {SearchProps} props - The props for the Search component
60
- * @returns {JSX.Element} Search component
61
- */
62
- export declare const Search: ({ className, placeholder, value, widenInputOnFocus, showBorderWhenNotInFocus, disabled, onKeyUp, onChange, onFocus, onBlur, name, onClear, dataTestId, autoComplete, ref, ...rest }: SearchProps) => JSX.Element;
1
+ import { CommonProps } from "@trackunit/react-components";
2
+ import * as React from "react";
3
+ import { TextInputProps } from "../TextInput/TextInput";
4
+ export interface SearchProps extends CommonProps, TextInputProps {
5
+ /**
6
+ * The name for the HTML element.
7
+ */
8
+ name?: string;
9
+ /**
10
+ * Placeholder string to be shown in the search box.
11
+ */
12
+ placeholder?: string;
13
+ /**
14
+ * Whether the search box should widen to take up full width while in focus or not.
15
+ * If disabled, the search box takes up full width when not in focus.
16
+ */
17
+ widenInputOnFocus?: boolean;
18
+ /**
19
+ * Whether the border for the search box should be displayed while the search box is not in focus.
20
+ */
21
+ showBorderWhenNotInFocus?: boolean;
22
+ /**
23
+ * Value rendered in the search box.
24
+ */
25
+ value?: string;
26
+ /**
27
+ * Whether the search box is disabled or not.
28
+ */
29
+ disabled?: boolean;
30
+ /**
31
+ * Specify what if any permission the user agent has to provide automated assistance in filling out search values.
32
+ */
33
+ autoComplete?: string;
34
+ /**
35
+ * Event that occurs when the user releases a key.
36
+ */
37
+ onKeyUp?: (evt: React.KeyboardEvent<HTMLInputElement>) => void;
38
+ /**
39
+ * Event that occurs when there is a change.
40
+ */
41
+ onChange?: (evt: React.ChangeEvent<HTMLInputElement>) => void;
42
+ /**
43
+ * Event that occurs when the search box is on focus.
44
+ */
45
+ onFocus?: (evt: React.FocusEvent<HTMLInputElement>) => void;
46
+ /**
47
+ * Event that occurs when search box is blurred.
48
+ */
49
+ onBlur?: (evt: React.FocusEvent<HTMLInputElement>) => void;
50
+ /**
51
+ * Event that search box is cleared.
52
+ */
53
+ onClear?: () => void;
54
+ ref?: React.Ref<HTMLInputElement | undefined>;
55
+ }
56
+ /**
57
+ * The Search component is used to render a search input field.
58
+ *
59
+ * @param {SearchProps} props - The props for the Search component
60
+ * @returns {JSX.Element} Search component
61
+ */
62
+ export declare const Search: ({ className, placeholder, value, widenInputOnFocus, showBorderWhenNotInFocus, disabled, onKeyUp, onChange, onFocus, onBlur, name, onClear, dataTestId, autoComplete, ref, ...rest }: SearchProps) => JSX.Element;
@@ -1 +1 @@
1
- export * from "./Search";
1
+ export * from "./Search";
@@ -1,38 +1,38 @@
1
- import React from "react";
2
- import { GroupBase } from "react-select";
3
- import { SelectProps } from "./useSelect";
4
- interface CreateableSelectProps<Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> extends SelectProps<Option, IsAsync, IsMulti, Group> {
5
- /**
6
- * To hide the label.
7
- */
8
- hideLabel?: boolean;
9
- /**
10
- * Description for the select component.
11
- */
12
- description?: string;
13
- /**
14
- * Whether the component is invalid.
15
- */
16
- isInvalid?: boolean;
17
- /**
18
- * Info of the select component.
19
- */
20
- info?: React.ReactNode;
21
- /**
22
- * Error of the select component.
23
- */
24
- error?: React.ReactNode;
25
- /**
26
- * Size of the component.
27
- */
28
- size?: SelectSize;
29
- }
30
- export type SelectSize = "small" | "default";
31
- /**
32
- * The CreatableSelect component.
33
- *
34
- * @param {CreateableSelectProps} props - The props for the CreatableSelect component
35
- * @returns {JSX.Element} CreatableSelect component
36
- */
37
- export declare const CreatableSelect: <Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: CreateableSelectProps<Option, IsAsync, IsMulti, Group>) => JSX.Element;
38
- export {};
1
+ import React from "react";
2
+ import { GroupBase } from "react-select";
3
+ import { SelectProps } from "./useSelect";
4
+ interface CreateableSelectProps<Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> extends SelectProps<Option, IsAsync, IsMulti, Group> {
5
+ /**
6
+ * To hide the label.
7
+ */
8
+ hideLabel?: boolean;
9
+ /**
10
+ * Description for the select component.
11
+ */
12
+ description?: string;
13
+ /**
14
+ * Whether the component is invalid.
15
+ */
16
+ isInvalid?: boolean;
17
+ /**
18
+ * Info of the select component.
19
+ */
20
+ info?: React.ReactNode;
21
+ /**
22
+ * Error of the select component.
23
+ */
24
+ error?: React.ReactNode;
25
+ /**
26
+ * Size of the component.
27
+ */
28
+ size?: SelectSize;
29
+ }
30
+ export type SelectSize = "small" | "default";
31
+ /**
32
+ * The CreatableSelect component.
33
+ *
34
+ * @param {CreateableSelectProps} props - The props for the CreatableSelect component
35
+ * @returns {JSX.Element} CreatableSelect component
36
+ */
37
+ export declare const CreatableSelect: <Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: CreateableSelectProps<Option, IsAsync, IsMulti, Group>) => JSX.Element;
38
+ export {};
@@ -1,20 +1,20 @@
1
- import * as React from "react";
2
- export interface SelectContainerProps {
3
- children: React.ReactElement;
4
- label?: string;
5
- hideLabel?: boolean;
6
- hasError?: boolean;
7
- id?: string;
8
- description?: string;
9
- error?: React.ReactNode;
10
- info?: React.ReactNode;
11
- dataTestId?: string;
12
- isDisabled?: boolean;
13
- }
14
- /**
15
- * The SelectContainer component.
16
- *
17
- * @param {SelectContainerProps} props - The props for the SelectContainer component
18
- * @returns {JSX.Element} SelectContainer component
19
- */
20
- export declare const SelectContainer: ({ children, label, hideLabel, id, hasError, error, description, info, dataTestId, isDisabled, }: SelectContainerProps) => JSX.Element;
1
+ import * as React from "react";
2
+ export interface SelectContainerProps {
3
+ children: React.ReactElement;
4
+ label?: string;
5
+ hideLabel?: boolean;
6
+ hasError?: boolean;
7
+ id?: string;
8
+ description?: string;
9
+ error?: React.ReactNode;
10
+ info?: React.ReactNode;
11
+ dataTestId?: string;
12
+ isDisabled?: boolean;
13
+ }
14
+ /**
15
+ * The SelectContainer component.
16
+ *
17
+ * @param {SelectContainerProps} props - The props for the SelectContainer component
18
+ * @returns {JSX.Element} SelectContainer component
19
+ */
20
+ export declare const SelectContainer: ({ children, label, hideLabel, id, hasError, error, description, info, dataTestId, isDisabled, }: SelectContainerProps) => JSX.Element;
@@ -1,18 +1,18 @@
1
- /// <reference types="react" />
2
- import { GroupBase } from "react-select";
3
- import { SelectProps } from "./useSelect";
4
- export interface SelectOption<T extends string> {
5
- label: string;
6
- value: T;
7
- disabled?: boolean;
8
- }
9
- /**
10
- * Selects are input components used to choose a value from a set.
11
- *
12
- * @param {SelectProps} props - The props for the Select component
13
- * @returns {JSX.Element} Select component
14
- */
15
- export declare const Select: {
16
- <Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: SelectProps<Option, IsAsync, IsMulti, Group>): JSX.Element;
17
- displayName: string;
18
- };
1
+ /// <reference types="react" />
2
+ import { GroupBase } from "react-select";
3
+ import { SelectProps } from "./useSelect";
4
+ export interface SelectOption<T extends string> {
5
+ label: string;
6
+ value: T;
7
+ disabled?: boolean;
8
+ }
9
+ /**
10
+ * Selects are input components used to choose a value from a set.
11
+ *
12
+ * @param {SelectProps} props - The props for the Select component
13
+ * @returns {JSX.Element} Select component
14
+ */
15
+ export declare const Select: {
16
+ <Option, IsAsync extends boolean = false, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: SelectProps<Option, IsAsync, IsMulti, Group>): JSX.Element;
17
+ displayName: string;
18
+ };
@@ -1,49 +1,49 @@
1
- import { CommonProps } from "@trackunit/react-components";
2
- import * as React from "react";
3
- interface SelectMenuItemProps extends CommonProps {
4
- /**
5
- * An string to render as a item label.
6
- *
7
- */
8
- label: string;
9
- /**
10
- * An handler for click on element
11
- */
12
- onClick?: React.MouseEventHandler<HTMLDivElement>;
13
- /**
14
- * A boolean prop to set menu item to selected state
15
- */
16
- selected?: boolean;
17
- /**
18
- * A boolean prop to set menu item to focused state
19
- * used for keyboard navigation
20
- */
21
- focused?: boolean;
22
- /**
23
- * A boolean prop to set menu item to disabled state
24
- * used in disabled select options
25
- */
26
- disabled?: boolean;
27
- }
28
- export interface SingleSelectMenuItemProps extends SelectMenuItemProps {
29
- /**
30
- * An React element to render before the text in the select.
31
- * This is typically used to render an icon.
32
- */
33
- icon?: JSX.Element;
34
- }
35
- /**
36
- * A single select menu item is a basic wrapper around Menu item designed to be used as a single value render in Select list
37
- *
38
- * @param {SelectMenuItemProps} props - The props for the SingleSelectMenuItem
39
- * @returns {JSX.Element} SingleSelectMenuItem
40
- */
41
- export declare const SingleSelectMenuItem: ({ label, icon, onClick, selected, dataTestId, focused, disabled, }: SingleSelectMenuItemProps) => JSX.Element;
42
- /**
43
- * A multi select menu item is a basic wrapper around Menu item designed to be used as a multi value render in Select list
44
- *
45
- * @param {SelectMenuItemProps} props - The props for the MultiSelectMenuItem
46
- * @returns {JSX.Element} multi select menu item
47
- */
48
- export declare const MultiSelectMenuItem: ({ label, onClick, selected, dataTestId, focused, disabled, }: SelectMenuItemProps) => JSX.Element;
49
- export {};
1
+ import { CommonProps } from "@trackunit/react-components";
2
+ import * as React from "react";
3
+ interface SelectMenuItemProps extends CommonProps {
4
+ /**
5
+ * An string to render as a item label.
6
+ *
7
+ */
8
+ label: string;
9
+ /**
10
+ * An handler for click on element
11
+ */
12
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
13
+ /**
14
+ * A boolean prop to set menu item to selected state
15
+ */
16
+ selected?: boolean;
17
+ /**
18
+ * A boolean prop to set menu item to focused state
19
+ * used for keyboard navigation
20
+ */
21
+ focused?: boolean;
22
+ /**
23
+ * A boolean prop to set menu item to disabled state
24
+ * used in disabled select options
25
+ */
26
+ disabled?: boolean;
27
+ }
28
+ export interface SingleSelectMenuItemProps extends SelectMenuItemProps {
29
+ /**
30
+ * An React element to render before the text in the select.
31
+ * This is typically used to render an icon.
32
+ */
33
+ icon?: JSX.Element;
34
+ }
35
+ /**
36
+ * A single select menu item is a basic wrapper around Menu item designed to be used as a single value render in Select list
37
+ *
38
+ * @param {SelectMenuItemProps} props - The props for the SingleSelectMenuItem
39
+ * @returns {JSX.Element} SingleSelectMenuItem
40
+ */
41
+ export declare const SingleSelectMenuItem: ({ label, icon, onClick, selected, dataTestId, focused, disabled, }: SingleSelectMenuItemProps) => JSX.Element;
42
+ /**
43
+ * A multi select menu item is a basic wrapper around Menu item designed to be used as a multi value render in Select list
44
+ *
45
+ * @param {SelectMenuItemProps} props - The props for the MultiSelectMenuItem
46
+ * @returns {JSX.Element} multi select menu item
47
+ */
48
+ export declare const MultiSelectMenuItem: ({ label, onClick, selected, dataTestId, focused, disabled, }: SelectMenuItemProps) => JSX.Element;
49
+ export {};
@@ -1,17 +1,17 @@
1
- /// <reference types="react" />
2
- import { TagProps } from "@trackunit/react-components";
3
- type TagsPropsNoRef = Omit<TagProps, "ref">;
4
- interface TagWithWidthProps extends TagsPropsNoRef {
5
- onWidthKnown?: ({ width }: {
6
- width: number;
7
- }) => void;
8
- }
9
- /**
10
- * Extended Tag component with information about its own width.
11
- * Used in the select component.
12
- *
13
- * @param {TagProps} props - The props for the tag component
14
- * @returns {JSX.Element} TagWithWidth component
15
- */
16
- export declare const TagWithWidth: ({ onWidthKnown, children, ...rest }: TagWithWidthProps) => JSX.Element;
17
- export {};
1
+ /// <reference types="react" />
2
+ import { TagProps } from "@trackunit/react-components";
3
+ type TagsPropsNoRef = Omit<TagProps, "ref">;
4
+ interface TagWithWidthProps extends TagsPropsNoRef {
5
+ onWidthKnown?: ({ width }: {
6
+ width: number;
7
+ }) => void;
8
+ }
9
+ /**
10
+ * Extended Tag component with information about its own width.
11
+ * Used in the select component.
12
+ *
13
+ * @param {TagProps} props - The props for the tag component
14
+ * @returns {JSX.Element} TagWithWidth component
15
+ */
16
+ export declare const TagWithWidth: ({ onWidthKnown, children, ...rest }: TagWithWidthProps) => JSX.Element;
17
+ export {};
@@ -1,45 +1,45 @@
1
- /// <reference types="react" />
2
- interface TagsContainerItem {
3
- /**
4
- * A text value to be passed to tags inside container
5
- */
6
- text: string;
7
- /**
8
- * OnClick handler for a tags
9
- */
10
- onClick: () => void;
11
- /**
12
- * A flag to set tags to readonly mode (without close button)
13
- */
14
- disabled: boolean;
15
- }
16
- interface TagsContainerProps {
17
- /**
18
- * An items to be rendered inside container if they fit available space. If they overlap then the counter will be displayed.
19
- */
20
- items: TagsContainerItem[];
21
- /**
22
- * An css property to set a custom width for container
23
- * Default behavior is to take 100% width of parent element
24
- * You can provide a value with unit (pixels, percents, rem, etc)
25
- *
26
- * @memberof TagsContainerProps
27
- */
28
- width?: string;
29
- /**
30
- * In case you have a gap between items then you can provide it to be used in calculation of available space,
31
- * default value is 5, so if you don't need it then provide 0
32
- *
33
- * @memberof TagsContainerProps
34
- */
35
- itemsGap?: number;
36
- postFix: JSX.Element;
37
- }
38
- /**
39
- * TagsContainer component to display tags in limited space when children can't fit space it displays counter
40
- *
41
- * @param {TagsContainerProps} props - The props for the TagContainer
42
- * @returns {JSX.Element} TagsContainer
43
- */
44
- export declare const TagsContainer: ({ items, width, itemsGap, postFix }: TagsContainerProps) => JSX.Element;
45
- export {};
1
+ /// <reference types="react" />
2
+ interface TagsContainerItem {
3
+ /**
4
+ * A text value to be passed to tags inside container
5
+ */
6
+ text: string;
7
+ /**
8
+ * OnClick handler for a tags
9
+ */
10
+ onClick: () => void;
11
+ /**
12
+ * A flag to set tags to readonly mode (without close button)
13
+ */
14
+ disabled: boolean;
15
+ }
16
+ interface TagsContainerProps {
17
+ /**
18
+ * An items to be rendered inside container if they fit available space. If they overlap then the counter will be displayed.
19
+ */
20
+ items: TagsContainerItem[];
21
+ /**
22
+ * An css property to set a custom width for container
23
+ * Default behavior is to take 100% width of parent element
24
+ * You can provide a value with unit (pixels, percents, rem, etc)
25
+ *
26
+ * @memberof TagsContainerProps
27
+ */
28
+ width?: string;
29
+ /**
30
+ * In case you have a gap between items then you can provide it to be used in calculation of available space,
31
+ * default value is 5, so if you don't need it then provide 0
32
+ *
33
+ * @memberof TagsContainerProps
34
+ */
35
+ itemsGap?: number;
36
+ postFix: JSX.Element;
37
+ }
38
+ /**
39
+ * TagsContainer component to display tags in limited space when children can't fit space it displays counter
40
+ *
41
+ * @param {TagsContainerProps} props - The props for the TagContainer
42
+ * @returns {JSX.Element} TagsContainer
43
+ */
44
+ export declare const TagsContainer: ({ items, width, itemsGap, postFix }: TagsContainerProps) => JSX.Element;
45
+ export {};