@commercetools-uikit/async-select-input 0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339

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.
@@ -0,0 +1,326 @@
1
+ import type { ReactNode, ComponentType } from 'react';
2
+ import { type ActionMeta, type GroupBase, type OptionsOrGroups, type CommonPropsAndClassName, type MenuPlacement, type MenuPosition } from 'react-select';
3
+ import { type AsyncProps } from 'react-select/async';
4
+ type TCustomEvent = {
5
+ target: {
6
+ id?: ReactSelectAsyncProps['inputId'];
7
+ name?: ReactSelectAsyncProps['name'];
8
+ value?: unknown;
9
+ };
10
+ persist: () => void;
11
+ };
12
+ type ReactSelectAsyncProps = AsyncProps<unknown, boolean, GroupBase<unknown>>;
13
+ export type TAsyncSelectInputProps = {
14
+ /**
15
+ * Horizontal size limit of the input fields.
16
+ */
17
+ horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
18
+ /**
19
+ * Indicates the input field has an error
20
+ */
21
+ hasError?: boolean;
22
+ /**
23
+ * Indicates the input field has a warning
24
+ */
25
+ hasWarning?: boolean;
26
+ /**
27
+ * Indicates that the field is displaying read-only content
28
+ */
29
+ isReadOnly?: boolean;
30
+ /**
31
+ * Aria label (for assistive tech)
32
+ * <br>
33
+ * [Props from React select was used](https://react-select.com/props)
34
+ */
35
+ 'aria-label'?: ReactSelectAsyncProps['aria-label'];
36
+ /**
37
+ * HTML ID of an element that should be used as the label (for assistive tech)
38
+ * <br>
39
+ * [Props from React select was used](https://react-select.com/props)
40
+ */
41
+ 'aria-labelledby'?: ReactSelectAsyncProps['aria-labelledby'];
42
+ /**
43
+ * Indicate if the value entered in the input is invalid.
44
+ * <br>
45
+ * [Props from React select was used](https://react-select.com/props)
46
+ */
47
+ 'aria-invalid'?: ReactSelectAsyncProps['aria-invalid'];
48
+ /**
49
+ * HTML ID of an element containing an error message related to the input.
50
+ * <br>
51
+ * [Props from React select was used](https://react-select.com/props)
52
+ */
53
+ 'aria-errormessage'?: ReactSelectAsyncProps['aria-errormessage'];
54
+ /**
55
+ * Focus the control when it is mounted
56
+ */
57
+ isAutofocussed?: boolean;
58
+ /**
59
+ * Remove the currently focused option when the user presses backspace
60
+ * <br>
61
+ * [Props from React select was used](https://react-select.com/props)
62
+ */
63
+ backspaceRemovesValue?: ReactSelectAsyncProps['backspaceRemovesValue'];
64
+ /**
65
+ * Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)
66
+ * <br>
67
+ * [Props from React select was used](https://react-select.com/props)
68
+ */
69
+ components?: ReactSelectAsyncProps['components'];
70
+ /**
71
+ * Control whether the selected values should be rendered in the control
72
+ * <br>
73
+ * [Props from React select was used](https://react-select.com/props)
74
+ */
75
+ controlShouldRenderValue?: ReactSelectAsyncProps['controlShouldRenderValue'];
76
+ /**
77
+ * Custom method to filter whether an option should be displayed in the menu
78
+ * <br>
79
+ * [Props from React select was used](https://react-select.com/props)
80
+ */
81
+ filterOption?: ReactSelectAsyncProps['filterOption'];
82
+ /**
83
+ * Custom method to determine whether selected options should be displayed in the menu
84
+ * <br>
85
+ * [Props from React select was used](https://react-select.com/props)
86
+ */
87
+ hideSelectedOptions?: ReactSelectAsyncProps['hideSelectedOptions'];
88
+ /**
89
+ * The id of the search input
90
+ * <br>
91
+ * [Props from React select was used](https://react-select.com/props)
92
+ */
93
+ id?: ReactSelectAsyncProps['inputId'];
94
+ /**
95
+ * The value of the search input
96
+ * <br>
97
+ * [Props from React select was used](https://react-select.com/props)
98
+ */
99
+ inputValue?: ReactSelectAsyncProps['inputValue'];
100
+ /**
101
+ * The id to set on the SelectContainer component
102
+ * <br>
103
+ * [Props from React select was used](https://react-select.com/props)
104
+ */
105
+ containerId?: ReactSelectAsyncProps['id'];
106
+ /**
107
+ * Is the select value clearable
108
+ * <br>
109
+ * [Props from React select was used](https://react-select.com/props)
110
+ */
111
+ isClearable?: ReactSelectAsyncProps['isClearable'];
112
+ /**
113
+ * Use this property to reduce the paddings of the component for a ui compact variant
114
+ */
115
+ isCondensed?: boolean;
116
+ /**
117
+ * Is the select disabled
118
+ * <br>
119
+ * [Props from React select was used](https://react-select.com/props)
120
+ */
121
+ isDisabled?: ReactSelectAsyncProps['isDisabled'];
122
+ /**
123
+ * Override the built-in logic to detect whether an option is disabled
124
+ * <br>
125
+ * [Props from React select was used](https://react-select.com/props)
126
+ */
127
+ isOptionDisabled?: ReactSelectAsyncProps['isOptionDisabled'];
128
+ /**
129
+ * Support multiple selected options
130
+ * <br>
131
+ * [Props from React select was used](https://react-select.com/props)
132
+ */
133
+ isMulti?: ReactSelectAsyncProps['isMulti'];
134
+ /**
135
+ * Whether to enable search functionality
136
+ * <br>
137
+ * [Props from React select was used](https://react-select.com/props)
138
+ */
139
+ isSearchable?: ReactSelectAsyncProps['isSearchable'];
140
+ /**
141
+ * Can be used to enforce the select input to be opened
142
+ * <br>
143
+ * [Props from React select was used](https://react-select.com/props)
144
+ */
145
+ menuIsOpen?: ReactSelectAsyncProps['menuIsOpen'];
146
+ /**
147
+ * Maximum height of the menu before scrolling
148
+ * <br>
149
+ * [Props from React select was used](https://react-select.com/props)
150
+ */
151
+ maxMenuHeight?: ReactSelectAsyncProps['maxMenuHeight'];
152
+ /**
153
+ * Dom element to portal the select menu to
154
+ * <br>
155
+ * [Props from React select was used](https://react-select.com/props)
156
+ */
157
+ menuPortalTarget?: ReactSelectAsyncProps['menuPortalTarget'];
158
+ /**
159
+ * z-index value for the menu portal
160
+ * <br>
161
+ * Use in conjunction with `menuPortalTarget`
162
+ */
163
+ menuPortalZIndex?: number;
164
+ /**
165
+ * whether the menu should block scroll while open
166
+ * <br>
167
+ * [Props from React select was used](https://react-select.com/props)
168
+ */
169
+ menuShouldBlockScroll?: ReactSelectAsyncProps['menuShouldBlockScroll'];
170
+ /**
171
+ * Whether the menu should close after a value is selected. Defaults to `true`.
172
+ * <br>
173
+ * [Props from React select was used](https://react-select.com/props)
174
+ */
175
+ closeMenuOnSelect?: ReactSelectAsyncProps['closeMenuOnSelect'];
176
+ /**
177
+ * Name of the HTML Input (optional - without this, no input will be rendered)
178
+ * <br>
179
+ * [Props from React select was used](https://react-select.com/props)
180
+ */
181
+ name?: ReactSelectAsyncProps['name'];
182
+ /**
183
+ * Can be used to render a custom value when there are no options (either because of no search results, or all options have been used, or there were none in the first place). Gets called with `{ inputValue: String }`. `inputValue` will be an empty string when no search text is present.
184
+ * <br>
185
+ * [Props from React select was used](https://react-select.com/props)
186
+ */
187
+ noOptionsMessage?: ReactSelectAsyncProps['noOptionsMessage'];
188
+ /**
189
+ * Handle blur events on the control
190
+ */
191
+ onBlur?: (event: TCustomEvent) => void;
192
+ /**
193
+ * Called with a fake event when value changes. The event's `target.name` will be the `name` supplied in props. The event's `target.value` will hold the value. The value will be the selected option, or an array of options in case `isMulti` is `true`.
194
+ */
195
+ onChange?: (event: TCustomEvent, info: ActionMeta<unknown>) => void;
196
+ /**
197
+ * Handle focus events on the control
198
+ * <br>
199
+ * [Props from React select was used](https://react-select.com/props)
200
+ */
201
+ onFocus?: ReactSelectAsyncProps['onFocus'];
202
+ /**
203
+ * Handle change events on the input
204
+ * <br>
205
+ * [Props from React select was used](https://react-select.com/props)
206
+ */
207
+ onInputChange?: ReactSelectAsyncProps['onInputChange'];
208
+ /**
209
+ * Placeholder text for the select value
210
+ * <br>
211
+ * [Props from React select was used](https://react-select.com/props)
212
+ */
213
+ placeholder?: ReactSelectAsyncProps['placeholder'];
214
+ /**
215
+ * loading message shown while the options are being loaded
216
+ */
217
+ loadingMessage?: string | (() => string);
218
+ /**
219
+ * Sets the tabIndex attribute on the input
220
+ * <br>
221
+ * [Props from React select was used](https://react-select.com/props)
222
+ */
223
+ tabIndex?: ReactSelectAsyncProps['tabIndex'];
224
+ /**
225
+ * Select the currently focused option when the user presses tab
226
+ * <br>
227
+ * [Props from React select was used](https://react-select.com/props)
228
+ */
229
+ tabSelectsValue?: ReactSelectAsyncProps['tabSelectsValue'];
230
+ /**
231
+ * The value of the select; reflected by the selected option
232
+ * <br>
233
+ * [Props from React select was used](https://react-select.com/props)
234
+ */
235
+ value?: ReactSelectAsyncProps['value'];
236
+ /**
237
+ * The default set of options to show before the user starts searching. When set to true, the results for loadOptions('') will be autoloaded.
238
+ * <br>
239
+ * [Props from React select was used](https://react-select.com/props)
240
+ */
241
+ defaultOptions?: OptionsOrGroups<unknown, GroupBase<unknown>> | boolean;
242
+ /**
243
+ * Function that returns a promise, which is the set of options to be used once the promise resolves.
244
+ */
245
+ loadOptions: ReactSelectAsyncProps['loadOptions'];
246
+ /**
247
+ * If cacheOptions is truthy, then the loaded data will be cached. The cache will remain until cacheOptions changes value.
248
+ */
249
+ cacheOptions?: ReactSelectAsyncProps['cacheOptions'];
250
+ /**
251
+ * Determines if option groups will be separated by a divider
252
+ */
253
+ showOptionGroupDivider?: boolean;
254
+ /**
255
+ * Icon to display on the left of the placeholder text and selected value. Has no effect when `isMulti` is enabled.
256
+ */
257
+ iconLeft?: ReactNode;
258
+ /** defines how options are rendered */
259
+ optionStyle?: 'list' | 'checkbox';
260
+ /**
261
+ * Indicates the appearance of the input.
262
+ * Filter appearance is meant to be used when the async-select is used as a filter.
263
+ */
264
+ appearance?: 'default' | 'filter';
265
+ /**
266
+ * An additional value displayed on the select options menu. This value is only available in the checkbox option style when appearance is set to filter.
267
+ */
268
+ count?: number;
269
+ };
270
+ declare const AsyncSelectInput: {
271
+ ({ value, isSearchable, menuPortalZIndex, controlShouldRenderValue, appearance, optionStyle, ...props }: TAsyncSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
272
+ displayName: string;
273
+ isTouched(touched: unknown): boolean;
274
+ /**
275
+ * Expose react-select components for customization purposes.
276
+ */
277
+ ClearIndicator: {
278
+ (props: import("@commercetools-uikit/select-utils").TClearIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
279
+ displayName: string;
280
+ };
281
+ Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: import("react-select").ControlProps<Option_1, IsMulti_1, Group_1>) => import("@emotion/react").jsx.JSX.Element;
282
+ CrossIcon: ComponentType<import("react").SVGProps<SVGSVGElement> & {
283
+ size?: number;
284
+ }>;
285
+ DownChevron: ComponentType<import("react").SVGProps<SVGSVGElement> & {
286
+ size?: number;
287
+ }>;
288
+ DropdownIndicator: {
289
+ (props: import("react-select").DropdownIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
290
+ displayName: string;
291
+ };
292
+ Group: <Option_3, IsMulti_3 extends boolean, Group_3 extends GroupBase<Option_3>>(props: import("react-select").GroupProps<Option_3, IsMulti_3, Group_3>) => import("@emotion/react").jsx.JSX.Element;
293
+ GroupHeading: <Option_4, IsMulti_4 extends boolean, Group_4 extends GroupBase<Option_4>>(props: import("react-select").GroupHeadingProps<Option_4, IsMulti_4, Group_4>) => import("@emotion/react").jsx.JSX.Element;
294
+ IndicatorSeparator: <Option_6, IsMulti_6 extends boolean, Group_6 extends GroupBase<Option_6>>(props: import("react-select").IndicatorSeparatorProps<Option_6, IsMulti_6, Group_6>) => import("@emotion/react").jsx.JSX.Element;
295
+ IndicatorsContainer: <Option_5, IsMulti_5 extends boolean, Group_5 extends GroupBase<Option_5>>(props: import("react-select").IndicatorsContainerProps<Option_5, IsMulti_5, Group_5>) => import("@emotion/react").jsx.JSX.Element;
296
+ Input: <Option_7, IsMulti_7 extends boolean, Group_7 extends GroupBase<Option_7>>(props: import("react-select").InputProps<Option_7, IsMulti_7, Group_7>) => import("@emotion/react").jsx.JSX.Element;
297
+ LoadingIndicator: {
298
+ (): import("@emotion/react/jsx-runtime").JSX.Element;
299
+ displayName: string;
300
+ };
301
+ LoadingMessage: <Option_12, IsMulti_12 extends boolean, Group_12 extends GroupBase<Option_12>>({ children, innerProps, ...restProps }: import("react-select").NoticeProps<Option_12, IsMulti_12, Group_12>) => import("@emotion/react").jsx.JSX.Element;
302
+ Menu: <Option_9, IsMulti_9 extends boolean, Group_9 extends GroupBase<Option_9>>(props: import("react-select").MenuProps<Option_9, IsMulti_9, Group_9>) => import("@emotion/react").jsx.JSX.Element;
303
+ MenuList: <Option_10, IsMulti_10 extends boolean, Group_10 extends GroupBase<Option_10>>(props: import("react-select").MenuListProps<Option_10, IsMulti_10, Group_10>) => import("@emotion/react").jsx.JSX.Element;
304
+ MenuPortal: ComponentType<CommonPropsAndClassName<unknown, false, GroupBase<unknown>> & {
305
+ appendTo: HTMLElement | undefined;
306
+ children: ReactNode;
307
+ controlElement: HTMLDivElement | null;
308
+ innerProps: JSX.IntrinsicElements["div"];
309
+ menuPlacement: MenuPlacement;
310
+ menuPosition: MenuPosition;
311
+ }>;
312
+ MultiValue: <Option_14, IsMulti_14 extends boolean, Group_14 extends GroupBase<Option_14>>(props: import("react-select").MultiValueProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
313
+ MultiValueContainer: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
314
+ MultiValueLabel: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
315
+ MultiValueRemove: {
316
+ (props: import("@commercetools-uikit/select-utils").TTagRemoveProps): import("@emotion/react/jsx-runtime").JSX.Element;
317
+ displayName: string;
318
+ };
319
+ NoOptionsMessage: <Option_13, IsMulti_13 extends boolean, Group_13 extends GroupBase<Option_13>>({ children, innerProps, ...restProps }: import("react-select").NoticeProps<Option_13, IsMulti_13, Group_13>) => import("@emotion/react").jsx.JSX.Element;
320
+ Option: <Option_16, IsMulti_16 extends boolean, Group_16 extends GroupBase<Option_16>>(props: import("react-select").OptionProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
321
+ Placeholder: <Option_17, IsMulti_17 extends boolean, Group_17 extends GroupBase<Option_17>>(props: import("react-select").PlaceholderProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react").jsx.JSX.Element;
322
+ SelectContainer: <Option_18, IsMulti_18 extends boolean, Group_18 extends GroupBase<Option_18>>(props: import("react-select").ContainerProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
323
+ SingleValue: <Option_19, IsMulti_19 extends boolean, Group_19 extends GroupBase<Option_19>>(props: import("react-select").SingleValueProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
324
+ ValueContainer: <Option_20, IsMulti_20 extends boolean, Group_20 extends GroupBase<Option_20>>(props: import("react-select").ValueContainerProps<Option_20, IsMulti_20, Group_20>) => import("@emotion/react").jsx.JSX.Element;
325
+ };
326
+ export default AsyncSelectInput;
@@ -0,0 +1 @@
1
+ export type { TAsyncSelectInputProps } from "./async-select-input.js";
@@ -0,0 +1,3 @@
1
+ export { default } from "./async-select-input.js";
2
+ export { default as version } from "./version.js";
3
+ export * from "./export-types.js";
@@ -0,0 +1,2 @@
1
+ declare const _default: "__@UI_KIT_PACKAGE/VERSION_OF_RELEASE__";
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@commercetools-uikit/async-select-input",
3
+ "description": "An input component getting a selection from an asynchronously loaded list from the user.",
4
+ "version": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
5
+ "bugs": "https://github.com/commercetools/ui-kit/issues",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/commercetools/ui-kit.git",
9
+ "directory": "packages/components/inputs/async-select-input"
10
+ },
11
+ "homepage": "https://uikit.commercetools.com",
12
+ "keywords": [
13
+ "javascript",
14
+ "typescript",
15
+ "design-system",
16
+ "react",
17
+ "uikit"
18
+ ],
19
+ "license": "MIT",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "sideEffects": false,
24
+ "main": "dist/commercetools-uikit-async-select-input.cjs.js",
25
+ "module": "dist/commercetools-uikit-async-select-input.esm.js",
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "dependencies": {
30
+ "@babel/runtime": "^7.20.13",
31
+ "@babel/runtime-corejs3": "^7.20.13",
32
+ "@commercetools-uikit/constraints": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
33
+ "@commercetools-uikit/design-system": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
34
+ "@commercetools-uikit/icons": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
35
+ "@commercetools-uikit/loading-spinner": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
36
+ "@commercetools-uikit/select-utils": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
37
+ "@commercetools-uikit/spacings": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
38
+ "@commercetools-uikit/text": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
39
+ "@commercetools-uikit/utils": "0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339",
40
+ "@emotion/react": "^11.10.5",
41
+ "@emotion/styled": "^11.10.5",
42
+ "lodash": "4.17.21",
43
+ "prop-types": "15.8.1",
44
+ "react-select": "5.10.1"
45
+ },
46
+ "devDependencies": {
47
+ "react": "17.0.2",
48
+ "react-dom": "17.0.2",
49
+ "react-intl": "^6.3.2"
50
+ },
51
+ "peerDependencies": {
52
+ "react": "17.x",
53
+ "react-dom": "17.x",
54
+ "react-intl": "6.x"
55
+ }
56
+ }