@trackunit/react-components 0.0.124 → 0.0.125
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/components/Menu/MenuItem.d.ts +2 -1
- package/components/Select/CreatableSelect.d.ts +32 -4
- package/components/Select/FieldContainer.d.ts +3 -3
- package/components/Select/Select.d.ts +132 -5
- package/components/Select/{Select/TagWithWidth.d.ts → TagWithWidth.d.ts} +1 -1
- package/components/Select/{Select/TagsContainer.d.ts → TagsContainer.d.ts} +0 -0
- package/components/Select/index.d.ts +4 -0
- package/components/Select/shared.d.ts +10 -67
- package/components/Select/useCustomComponents.d.ts +19 -0
- package/components/Select/useCustomStyles.d.ts +14 -0
- package/index.js +802 -181
- package/package.json +1 -1
- package/components/Select/Select/Select.d.ts +0 -122
- package/components/Select/Select/useCustomComponents.d.ts +0 -20
- package/components/Select/Select/useCustomStyles.d.ts +0 -10
- package/components/Select/Select/utils.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GroupBase, MultiValue, SingleValue } from "react-select";
|
|
3
|
-
import { SelectComponents } from "react-select/dist/declarations/src/components";
|
|
4
|
-
import { CommonProps } from "../../../common";
|
|
5
|
-
import { SelectOption } from "./useCustomComponents";
|
|
6
|
-
export interface SelectProps extends CommonProps {
|
|
7
|
-
/**
|
|
8
|
-
* An React element to render before the text in the select.
|
|
9
|
-
* This is typically used to render an icon.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @memberof SelectProps
|
|
13
|
-
*/
|
|
14
|
-
prefix?: JSX.Element;
|
|
15
|
-
/**
|
|
16
|
-
* An string to render in field when there is no value selected.
|
|
17
|
-
* Can be used as a description, example or a hint.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @memberof SelectProps
|
|
21
|
-
*/
|
|
22
|
-
placeholder?: string;
|
|
23
|
-
/**
|
|
24
|
-
* An boolean flag to disable field
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @memberof SelectProps
|
|
28
|
-
*/
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* An field id
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @memberof SelectProps
|
|
35
|
-
*/
|
|
36
|
-
id?: string;
|
|
37
|
-
/**
|
|
38
|
-
* An boolean flag to set select into async mode
|
|
39
|
-
* This is typically used when data is fetched after render
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @memberof SelectProps
|
|
43
|
-
*/
|
|
44
|
-
isAsync?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* A custom icon to be used as a dropdown indicator
|
|
47
|
-
* This is typically used during style customization
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @memberof SelectProps
|
|
51
|
-
*/
|
|
52
|
-
dropdownIcon?: JSX.Element;
|
|
53
|
-
/**
|
|
54
|
-
* A label to be used as a aria-label
|
|
55
|
-
* This is typically used for accessibility
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @memberof SelectProps
|
|
59
|
-
*/
|
|
60
|
-
label?: string;
|
|
61
|
-
/**
|
|
62
|
-
* A number of pixels to limit maximal length of the select menu list
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @memberof SelectProps
|
|
66
|
-
*/
|
|
67
|
-
maxMenuHeight?: number;
|
|
68
|
-
/**
|
|
69
|
-
* A flag to allow multiselect
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @memberof SelectProps
|
|
73
|
-
*/
|
|
74
|
-
multiple?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* A boolean prop to set select into invalid mode
|
|
77
|
-
* typically used when selected value is not compliant with field requirement
|
|
78
|
-
* ex if it breaks validation rules
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* @memberof SelectProps
|
|
82
|
-
*/
|
|
83
|
-
hasError?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* A react select component prop to overide
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* @memberof SelectProps
|
|
89
|
-
*/
|
|
90
|
-
components?: Partial<SelectComponents<SelectOption, boolean, GroupBase<SelectOption>>>;
|
|
91
|
-
/**
|
|
92
|
-
* A single or multi value selection
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* @memberof SelectProps
|
|
96
|
-
*/
|
|
97
|
-
value?: SingleValue<SelectOption> | MultiValue<SelectOption>;
|
|
98
|
-
/**
|
|
99
|
-
* An array of options to select from
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* @memberof SelectProps
|
|
103
|
-
*/
|
|
104
|
-
options: SelectOption[];
|
|
105
|
-
/**
|
|
106
|
-
* Handle change events on the select
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* @memberof SelectProps
|
|
110
|
-
*/
|
|
111
|
-
onChange: (newValue: MultiValue<SelectOption> | SingleValue<SelectOption>) => void;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Selects are input components used to choose a value from a set.
|
|
115
|
-
*
|
|
116
|
-
* @param {SelectProps} props - The props for the Select component
|
|
117
|
-
* @returns {JSX.Element} Select component
|
|
118
|
-
*/
|
|
119
|
-
export declare const Select: {
|
|
120
|
-
({ id, className, dataTestId, prefix, isAsync, dropdownIcon, maxMenuHeight, label, hasError, disabled, multiple, components, value, options, onChange, }: SelectProps): JSX.Element;
|
|
121
|
-
displayName: string;
|
|
122
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { GroupBase } from "react-select";
|
|
3
|
-
import { SelectComponents } from "react-select/dist/declarations/src/components";
|
|
4
|
-
export interface SelectOption {
|
|
5
|
-
id: string;
|
|
6
|
-
value: string;
|
|
7
|
-
label: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A hook to retrieve components override object.
|
|
11
|
-
* This complex object includes all the compositional components that are used in react-select. If you wish to overwrite a component, pass in an object with the appropriate namespace.
|
|
12
|
-
*
|
|
13
|
-
* @param {Partial<SelectComponents<SelectOption, boolean, GroupBase<SelectOption>>> | undefined} componentsProps a custom component prop that you can to override defaults
|
|
14
|
-
* @param {boolean} disabled decide to override disabled variant
|
|
15
|
-
* @param {boolean} menuIsClosing a flag to trigger fade out animation for the menu
|
|
16
|
-
* @param {React.MutableRefObject<boolean>} refMenuIsEnabled a flag to block menu from open
|
|
17
|
-
* @param {JSX.Element} dropdownIcon an custom dropdown icon
|
|
18
|
-
* @returns {Partial<SelectComponents<SelectOption, boolean, GroupBase<SelectOption>>> | undefined} components object to override react-select default components
|
|
19
|
-
*/
|
|
20
|
-
export declare const useCustomComponents: (componentsProps: Partial<SelectComponents<SelectOption, boolean, GroupBase<SelectOption>>> | undefined, disabled: boolean, menuIsClosing: boolean, refMenuIsEnabled: React.MutableRefObject<boolean>, dropdownIcon?: JSX.Element) => Partial<SelectComponents<SelectOption, boolean, GroupBase<SelectOption>>>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { StylesConfig } from "react-select";
|
|
3
|
-
/**
|
|
4
|
-
* @param {React.RefObject<HTMLDivElement>} refContainer react ref to container element
|
|
5
|
-
* @param {React.RefObject<HTMLDivElement>} refPrefix react ref to prefix element
|
|
6
|
-
* @returns {StylesConfig<Option, boolean>} styles to override in select
|
|
7
|
-
*/
|
|
8
|
-
export declare const useCustomStyles: <Option, IsMulti extends boolean = false>(refContainer: React.RefObject<HTMLDivElement>, refPrefix: React.RefObject<HTMLDivElement>) => {
|
|
9
|
-
customStyles: StylesConfig<Option, IsMulti, import("react-select").GroupBase<Option>>;
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionMeta, MultiValue } from "react-select";
|
|
2
|
-
import { SelectOption } from "./useCustomComponents";
|
|
3
|
-
/**
|
|
4
|
-
* A basic reducer for managing selected items state in storybook
|
|
5
|
-
*
|
|
6
|
-
* @param {MultiValue<SelectOption>} state current selected state
|
|
7
|
-
* @param {ActionMeta<SelectOption>} action action performed by user
|
|
8
|
-
* @returns {MultiValue<SelectOption>} New selected state
|
|
9
|
-
*/
|
|
10
|
-
export declare const reducer: (state: MultiValue<SelectOption>, action: ActionMeta<SelectOption>) => MultiValue<SelectOption>;
|