@commercetools-uikit/select-input 19.8.0 → 19.10.0

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.
@@ -267,7 +267,7 @@ SelectInput.ValueContainer = Select.components.ValueContainer;
267
267
  var SelectInput$1 = SelectInput;
268
268
 
269
269
  // NOTE: This string will be replaced on build time with the package version.
270
- var version = "19.8.0";
270
+ var version = "19.10.0";
271
271
 
272
272
  exports["default"] = SelectInput$1;
273
273
  exports.version = version;
@@ -242,7 +242,7 @@ SelectInput.ValueContainer = Select.components.ValueContainer;
242
242
  var SelectInput$1 = SelectInput;
243
243
 
244
244
  // NOTE: This string will be replaced on build time with the package version.
245
- var version = "19.8.0";
245
+ var version = "19.10.0";
246
246
 
247
247
  exports["default"] = SelectInput$1;
248
248
  exports.version = version;
@@ -244,6 +244,6 @@ SelectInput.ValueContainer = components.ValueContainer;
244
244
  var SelectInput$1 = SelectInput;
245
245
 
246
246
  // NOTE: This string will be replaced on build time with the package version.
247
- var version = "19.8.0";
247
+ var version = "19.10.0";
248
248
 
249
249
  export { SelectInput$1 as default, version };
@@ -17,56 +17,257 @@ export type TCustomEvent = {
17
17
  persist: () => void;
18
18
  };
19
19
  export type TSelectInputProps = {
20
+ /**
21
+ * Indicates the appearance of the input.
22
+ * Quiet appearance is meant to be used with the `horizontalConstraint="auto"`.
23
+ */
20
24
  appearance?: 'default' | 'quiet';
21
25
  horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
26
+ /**
27
+ * Indicates that input has errors
28
+ */
22
29
  hasError?: boolean;
30
+ /**
31
+ * Is the select read-only
32
+ */
23
33
  isReadOnly?: boolean;
34
+ /**
35
+ * Control to indicate on the input if there are selected values that are potentially invalid
36
+ */
24
37
  hasWarning?: boolean;
38
+ /**
39
+ * Icon to display on the left of the placeholder text and selected value. Has no effect when isMulti is enabled.
40
+ */
25
41
  iconLeft?: ReactNode;
42
+ /**
43
+ * Aria label (for assistive tech)
44
+ * <br>
45
+ * [Props from React select was used](https://react-select.com/props)
46
+ */
26
47
  'aria-label'?: ReactSelectProps['aria-label'];
48
+ /**
49
+ * HTML ID of an element that should be used as the label (for assistive tech)
50
+ * <br>
51
+ * [Props from React select was used](https://react-select.com/props)
52
+ */
27
53
  'aria-labelledby'?: ReactSelectProps['aria-labelledby'];
54
+ /**
55
+ * Indicate if the value entered in the input is invalid.
56
+ * <br>
57
+ * [Props from React select was used](https://react-select.com/props)
58
+ */
28
59
  'aria-invalid'?: ReactSelectProps['aria-invalid'];
60
+ /**
61
+ * HTML ID of an element containing an error message related to the input.
62
+ * <br>
63
+ * [Props from React select was used](https://react-select.com/props)
64
+ */
29
65
  'aria-errormessage'?: ReactSelectProps['aria-errormessage'];
66
+ /**
67
+ * Focus the control when it is mounted
68
+ */
30
69
  isAutofocussed?: boolean;
70
+ /**
71
+ * Remove the currently focused option when the user presses backspace
72
+ * <br>
73
+ * [Props from React select was used](https://react-select.com/props)
74
+ */
31
75
  backspaceRemovesValue?: ReactSelectProps['backspaceRemovesValue'];
76
+ /**
77
+ * Map of components to overwrite the default ones, see what components you can override
78
+ * <br>
79
+ * [Props from React select was used](https://react-select.com/props)
80
+ */
32
81
  components?: ReactSelectProps['components'];
82
+ /**
83
+ * Whether the input and options are rendered with condensed paddings
84
+ */
33
85
  isCondensed?: boolean;
86
+ /**
87
+ * Control whether the selected values should be rendered in the control
88
+ * <br>
89
+ * [Props from React select was used](https://react-select.com/props)
90
+ */
34
91
  controlShouldRenderValue?: ReactSelectProps['controlShouldRenderValue'];
92
+ /**
93
+ * Custom method to filter whether an option should be displayed in the menu
94
+ * <br>
95
+ * [Props from React select was used](https://react-select.com/props)
96
+ */
35
97
  filterOption?: ReactSelectProps['filterOption'];
98
+ /**
99
+ * Used as HTML id property. An id is generated automatically when not provided.
100
+ * This forwarded as react-select's "inputId"
101
+ * <br>
102
+ * [Props from React select was used](https://react-select.com/props)
103
+ */
36
104
  id?: ReactSelectProps['inputId'];
105
+ /**
106
+ * The value of the search input
107
+ * <br>
108
+ * [Props from React select was used](https://react-select.com/props)
109
+ */
37
110
  inputValue?: ReactSelectProps['inputValue'];
111
+ /**
112
+ * The id to set on the SelectContainer component
113
+ * This is forwarded as react-select's "id"
114
+ * <br>
115
+ * [Props from React select was used](https://react-select.com/props)
116
+ */
38
117
  containerId?: ReactSelectProps['id'];
118
+ /**
119
+ * Is the select value clearable
120
+ * <br>
121
+ * [Props from React select was used](https://react-select.com/props)
122
+ */
39
123
  isClearable?: ReactSelectProps['isClearable'];
124
+ /**
125
+ * Is the select disabled
126
+ * <br>
127
+ * [Props from React select was used](https://react-select.com/props)
128
+ */
40
129
  isDisabled?: ReactSelectProps['isDisabled'];
130
+ /**
131
+ * Override the built-in logic to detect whether an option is disabled
132
+ * <br>
133
+ * [Props from React select was used](https://react-select.com/props)
134
+ */
41
135
  isOptionDisabled?: ReactSelectProps['isOptionDisabled'];
136
+ /**
137
+ * Support multiple selected options
138
+ * <br>
139
+ * [Props from React select was used](https://react-select.com/props)
140
+ */
42
141
  isMulti?: ReactSelectProps['isMulti'];
142
+ /**
143
+ * Whether to enable search functionality
144
+ * <br>
145
+ * [Props from React select was used](https://react-select.com/props)
146
+ */
43
147
  isSearchable?: ReactSelectProps['isSearchable'];
148
+ /**
149
+ * Can be used to enforce the select input to be opened
150
+ * <br>
151
+ * [Props from React select was used](https://react-select.com/props)
152
+ */
44
153
  menuIsOpen?: ReactSelectProps['menuIsOpen'];
154
+ /**
155
+ * Maximum height of the menu before scrolling
156
+ * <br>
157
+ * [Props from React select was used](https://react-select.com/props)
158
+ */
45
159
  maxMenuHeight?: ReactSelectProps['maxMenuHeight'];
160
+ /**
161
+ * Dom element to portal the select menu to
162
+ * <br>
163
+ * [Props from React select was used](https://react-select.com/props)
164
+ */
46
165
  menuPortalTarget?: ReactSelectProps['menuPortalTarget'];
166
+ /**
167
+ * z-index value for the menu portal
168
+ * <br>
169
+ * Use in conjunction with `menuPortalTarget`
170
+ */
47
171
  menuPortalZIndex?: number;
172
+ /**
173
+ * whether the menu should block scroll while open
174
+ * <br>
175
+ * [Props from React select was used](https://react-select.com/props)
176
+ */
48
177
  menuShouldBlockScroll?: ReactSelectProps['menuShouldBlockScroll'];
178
+ /**
179
+ * Whether the menu should close after a value is selected. Defaults to `true`.
180
+ * <br>
181
+ * [Props from React select was used](https://react-select.com/props)
182
+ */
49
183
  closeMenuOnSelect?: ReactSelectProps['closeMenuOnSelect'];
184
+ /**
185
+ * Name of the HTML Input (optional - without this, no input will be rendered)
186
+ * <br>
187
+ * [Props from React select was used](https://react-select.com/props)
188
+ */
50
189
  name?: ReactSelectProps['name'];
190
+ /**
191
+ * 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 }.
192
+ * <br />
193
+ * `inputValue` will be an empty string when no search text is present.
194
+ * <br>
195
+ * [Props from React select was used](https://react-select.com/props)
196
+ */
51
197
  noOptionsMessage?: ReactSelectProps['noOptionsMessage'];
198
+ /**
199
+ * Handle blur events on the control
200
+ */
52
201
  onBlur?: (event: TCustomEvent) => void;
202
+ /**
203
+ * 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.
204
+ * <br/>
205
+ * The value will be the selected option, or an array of options in case isMulti is true.
206
+ */
53
207
  onChange?: (event: TCustomEvent) => void;
208
+ /**
209
+ * Handle focus events on the control
210
+ * <br>
211
+ * [Props from React select was used](https://react-select.com/props)
212
+ */
54
213
  onFocus?: ReactSelectProps['onFocus'];
214
+ /**
215
+ * Handle change events on the input
216
+ * <br>
217
+ * [Props from React select was used](https://react-select.com/props)
218
+ */
55
219
  onInputChange?: ReactSelectProps['onInputChange'];
220
+ /**
221
+ * Array of options that populate the select menu
222
+ */
56
223
  options: TOptions;
57
224
  showOptionGroupDivider?: boolean;
225
+ /**
226
+ * Placeholder text for the select value
227
+ * <br>
228
+ * [Props from React select was used](https://react-select.com/props)
229
+ */
58
230
  placeholder?: ReactSelectProps['placeholder'];
231
+ /**
232
+ * Sets the tabIndex attribute on the input
233
+ * <br>
234
+ * [Props from React select was used](https://react-select.com/props)
235
+ */
59
236
  tabIndex?: ReactSelectProps['tabIndex'];
237
+ /**
238
+ * Select the currently focused option when the user presses tab
239
+ * <br>
240
+ * [Props from React select was used](https://react-select.com/props)
241
+ */
60
242
  tabSelectsValue?: ReactSelectProps['tabSelectsValue'];
243
+ /**
244
+ * The value of the select; reflected by the selected option
245
+ * <br>
246
+ * [Props from React select was used](https://react-select.com/props)
247
+ */
61
248
  value?: ReactSelectProps['value'];
249
+ /**
250
+ * The min width (a range of values from the horizontalConrtaint set of values) for which the select-input menu
251
+ * is allowed to shrink. If unset, the menu will shrink to a default value.
252
+ */
62
253
  minMenuWidth?: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
254
+ /**
255
+ * The max width (a range of values from the horizontalConrtaint set of values) for which the select-input menu
256
+ * is allowed to grow. If unset, the menu will grow horrizontally to fill its parent.
257
+ */
63
258
  maxMenuWidth?: 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
64
259
  };
65
260
  declare const SelectInput: {
66
261
  (props: TSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
67
262
  displayName: string;
68
263
  defaultProps: Pick<TSelectInputProps, "appearance" | "maxMenuHeight" | "options" | "menuPortalZIndex">;
264
+ /**
265
+ * Expose static helper methods.
266
+ */
69
267
  isTouched(touched: boolean | unknown[]): boolean;
268
+ /**
269
+ * Expose react-select components for customization purposes.
270
+ */
70
271
  ClearIndicator: {
71
272
  (props: import("@commercetools-uikit/select-utils").TClearIndicatorProps): import("@emotion/react/jsx-runtime").JSX.Element;
72
273
  displayName: string;
@@ -97,7 +298,13 @@ declare const SelectInput: {
97
298
  };
98
299
  NoOptionsMessage: <Option_13, IsMulti_13 extends boolean, Group_13 extends import("react-select").GroupBase<Option_13>>({ children, innerProps, ...restProps }: import("react-select").NoticeProps<Option_13, IsMulti_13, Group_13>) => import("@emotion/react").jsx.JSX.Element;
99
300
  Option: <Option_16, IsMulti_16 extends boolean, Group_16 extends import("react-select").GroupBase<Option_16>>(props: import("react-select").OptionProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
100
- Placeholder: <Option_17, IsMulti_17 extends boolean, Group_17 extends import("react-select").GroupBase<Option_17>>(props: import("react-select").PlaceholderProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react").jsx.JSX.Element;
301
+ Placeholder: <Option_17, IsMulti_17 extends boolean, Group_17 extends import("react-select").GroupBase<Option_17>>(props: import("react-select").PlaceholderProps<Option_17, IsMulti_17, Group_17>) => import(
302
+ /**
303
+ * Dom element to portal the select menu to
304
+ * <br>
305
+ * [Props from React select was used](https://react-select.com/props)
306
+ */
307
+ "@emotion/react").jsx.JSX.Element;
101
308
  SelectContainer: <Option_18, IsMulti_18 extends boolean, Group_18 extends import("react-select").GroupBase<Option_18>>(props: import("react-select").ContainerProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
102
309
  SingleValue: <Option_19, IsMulti_19 extends boolean, Group_19 extends import("react-select").GroupBase<Option_19>>(props: import("react-select").SingleValueProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
103
310
  ValueContainer: <Option_20, IsMulti_20 extends boolean, Group_20 extends import("react-select").GroupBase<Option_20>>(props: import("react-select").ValueContainerProps<Option_20, IsMulti_20, Group_20>) => import("@emotion/react").jsx.JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/select-input",
3
3
  "description": "An input component getting a selection from the user.",
4
- "version": "19.8.0",
4
+ "version": "19.10.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,11 +21,11 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "19.8.0",
25
- "@commercetools-uikit/design-system": "19.8.0",
26
- "@commercetools-uikit/icons": "19.8.0",
27
- "@commercetools-uikit/select-utils": "19.8.0",
28
- "@commercetools-uikit/utils": "19.8.0",
24
+ "@commercetools-uikit/constraints": "19.10.0",
25
+ "@commercetools-uikit/design-system": "19.10.0",
26
+ "@commercetools-uikit/icons": "19.10.0",
27
+ "@commercetools-uikit/select-utils": "19.10.0",
28
+ "@commercetools-uikit/utils": "19.10.0",
29
29
  "@emotion/is-prop-valid": "1.2.2",
30
30
  "@emotion/react": "^11.10.5",
31
31
  "@emotion/styled": "^11.10.5",