@commercetools-uikit/creatable-select-input 14.0.0 → 14.0.1

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/README.md CHANGED
@@ -126,36 +126,35 @@ The options support a `isDisabled` property which will render the option with a
126
126
 
127
127
  ### `isTouched(touched)`
128
128
 
129
- Expects to be called with an array or boolean.
130
- Returns `true` when truthy.
129
+ Returns truthy value for the Formik `touched` value of this input field.
131
130
 
132
- ### Components
131
+ ## Components
133
132
 
134
- It is possible to customize `SelectInput` by passing the `components` property.
135
- `SelectInput` exports the default underlying components as static exports.
133
+ It is possible to customize `CreatableSelectInput` by passing the `components` property.
134
+ `CreatableSelectInput` exports the default underlying components as static exports.
136
135
 
137
136
  Components available as static exports are:
138
137
 
139
138
  - `ClearIndicator`
140
139
  - `Control`
141
- - `DropdownIndicator`
142
- - `DownChevron`
143
140
  - `CrossIcon`
141
+ - `DownChevron`
142
+ - `DropdownIndicator`
144
143
  - `Group`
145
144
  - `GroupHeading`
146
145
  - `IndicatorsContainer`
147
146
  - `IndicatorSeparator`
148
147
  - `Input`
149
148
  - `LoadingIndicator`
149
+ - `LoadingMessage`
150
150
  - `Menu`
151
151
  - `MenuList`
152
152
  - `MenuPortal`
153
- - `LoadingMessage`
154
- - `NoOptionsMessage`
155
153
  - `MultiValue`
156
154
  - `MultiValueContainer`
157
155
  - `MultiValueLabel`
158
156
  - `MultiValueRemove`
157
+ - `NoOptionsMessage`
159
158
  - `Option`
160
159
  - `Placeholder`
161
160
  - `SelectContainer`
@@ -193,21 +193,54 @@ CreatableSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
193
193
  }))]),
194
194
  showOptionGroupDivider: _pt__default["default"].bool
195
195
  } : {};
196
- CreatableSelectInput.displayName = 'CreatableSelectInput'; // Both "true" and an empty array [] represent a touched state. The Boolean
196
+ CreatableSelectInput.displayName = 'CreatableSelectInput';
197
+ CreatableSelectInput.defaultProps = defaultProps;
198
+ /**
199
+ * Expose static helper methods.
200
+ */
201
+ // Both "true" and an empty array [] represent a touched state. The Boolean
197
202
  // conveniently handles both cases
198
203
 
199
204
  CreatableSelectInput.isTouched = function (touched) {
200
205
  return Boolean(touched);
201
206
  };
207
+ /**
208
+ * Expose react-select components for customization purposes.
209
+ */
210
+ // custom
202
211
 
203
- CreatableSelectInput.defaultProps = defaultProps;
204
- utils.addStaticFields(CreatableSelectInput, _objectSpread(_objectSpread(_objectSpread({}, reactSelect.components), customizedComponents), {}, {
205
- isTouched: CreatableSelectInput.isTouched
206
- }));
212
+
213
+ CreatableSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
214
+ CreatableSelectInput.Control = reactSelect.components.Control;
215
+ CreatableSelectInput.CrossIcon = reactSelect.components.CrossIcon;
216
+ CreatableSelectInput.DownChevron = reactSelect.components.DownChevron; // custom
217
+
218
+ CreatableSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
219
+ CreatableSelectInput.Group = reactSelect.components.Group;
220
+ CreatableSelectInput.GroupHeading = reactSelect.components.GroupHeading;
221
+ CreatableSelectInput.IndicatorSeparator = reactSelect.components.IndicatorSeparator;
222
+ CreatableSelectInput.IndicatorsContainer = reactSelect.components.IndicatorsContainer;
223
+ CreatableSelectInput.Input = reactSelect.components.Input;
224
+ CreatableSelectInput.LoadingIndicator = reactSelect.components.LoadingIndicator;
225
+ CreatableSelectInput.LoadingMessage = reactSelect.components.LoadingMessage;
226
+ CreatableSelectInput.Menu = reactSelect.components.Menu;
227
+ CreatableSelectInput.MenuList = reactSelect.components.MenuList;
228
+ CreatableSelectInput.MenuPortal = reactSelect.components.MenuPortal;
229
+ CreatableSelectInput.MultiValue = reactSelect.components.MultiValue;
230
+ CreatableSelectInput.MultiValueContainer = reactSelect.components.MultiValueContainer;
231
+ CreatableSelectInput.MultiValueLabel = reactSelect.components.MultiValueLabel; // custom
232
+
233
+ CreatableSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
234
+ CreatableSelectInput.NoOptionsMessage = reactSelect.components.NoOptionsMessage;
235
+ CreatableSelectInput.Option = reactSelect.components.Option;
236
+ CreatableSelectInput.Placeholder = reactSelect.components.Placeholder;
237
+ CreatableSelectInput.SelectContainer = reactSelect.components.SelectContainer;
238
+ CreatableSelectInput.SingleValue = reactSelect.components.SingleValue;
239
+ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
207
240
  var CreatableSelectInput$1 = CreatableSelectInput;
208
241
 
209
242
  // NOTE: This string will be replaced on build time with the package version.
210
- var version = "14.0.0";
243
+ var version = "14.0.1";
211
244
 
212
245
  exports["default"] = CreatableSelectInput$1;
213
246
  exports.version = version;
@@ -174,21 +174,54 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
174
174
  };
175
175
 
176
176
  CreatableSelectInput.propTypes = {};
177
- CreatableSelectInput.displayName = 'CreatableSelectInput'; // Both "true" and an empty array [] represent a touched state. The Boolean
177
+ CreatableSelectInput.displayName = 'CreatableSelectInput';
178
+ CreatableSelectInput.defaultProps = defaultProps;
179
+ /**
180
+ * Expose static helper methods.
181
+ */
182
+ // Both "true" and an empty array [] represent a touched state. The Boolean
178
183
  // conveniently handles both cases
179
184
 
180
185
  CreatableSelectInput.isTouched = function (touched) {
181
186
  return Boolean(touched);
182
187
  };
188
+ /**
189
+ * Expose react-select components for customization purposes.
190
+ */
191
+ // custom
183
192
 
184
- CreatableSelectInput.defaultProps = defaultProps;
185
- utils.addStaticFields(CreatableSelectInput, _objectSpread(_objectSpread(_objectSpread({}, reactSelect.components), customizedComponents), {}, {
186
- isTouched: CreatableSelectInput.isTouched
187
- }));
193
+
194
+ CreatableSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
195
+ CreatableSelectInput.Control = reactSelect.components.Control;
196
+ CreatableSelectInput.CrossIcon = reactSelect.components.CrossIcon;
197
+ CreatableSelectInput.DownChevron = reactSelect.components.DownChevron; // custom
198
+
199
+ CreatableSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
200
+ CreatableSelectInput.Group = reactSelect.components.Group;
201
+ CreatableSelectInput.GroupHeading = reactSelect.components.GroupHeading;
202
+ CreatableSelectInput.IndicatorSeparator = reactSelect.components.IndicatorSeparator;
203
+ CreatableSelectInput.IndicatorsContainer = reactSelect.components.IndicatorsContainer;
204
+ CreatableSelectInput.Input = reactSelect.components.Input;
205
+ CreatableSelectInput.LoadingIndicator = reactSelect.components.LoadingIndicator;
206
+ CreatableSelectInput.LoadingMessage = reactSelect.components.LoadingMessage;
207
+ CreatableSelectInput.Menu = reactSelect.components.Menu;
208
+ CreatableSelectInput.MenuList = reactSelect.components.MenuList;
209
+ CreatableSelectInput.MenuPortal = reactSelect.components.MenuPortal;
210
+ CreatableSelectInput.MultiValue = reactSelect.components.MultiValue;
211
+ CreatableSelectInput.MultiValueContainer = reactSelect.components.MultiValueContainer;
212
+ CreatableSelectInput.MultiValueLabel = reactSelect.components.MultiValueLabel; // custom
213
+
214
+ CreatableSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
215
+ CreatableSelectInput.NoOptionsMessage = reactSelect.components.NoOptionsMessage;
216
+ CreatableSelectInput.Option = reactSelect.components.Option;
217
+ CreatableSelectInput.Placeholder = reactSelect.components.Placeholder;
218
+ CreatableSelectInput.SelectContainer = reactSelect.components.SelectContainer;
219
+ CreatableSelectInput.SingleValue = reactSelect.components.SingleValue;
220
+ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
188
221
  var CreatableSelectInput$1 = CreatableSelectInput;
189
222
 
190
223
  // NOTE: This string will be replaced on build time with the package version.
191
- var version = "14.0.0";
224
+ var version = "14.0.1";
192
225
 
193
226
  exports["default"] = CreatableSelectInput$1;
194
227
  exports.version = version;
@@ -14,7 +14,7 @@ import { useTheme } from '@emotion/react';
14
14
  import { components } from 'react-select';
15
15
  import CreatableSelect from 'react-select/creatable';
16
16
  import Constraints from '@commercetools-uikit/constraints';
17
- import { filterDataAttributes, addStaticFields } from '@commercetools-uikit/utils';
17
+ import { filterDataAttributes } from '@commercetools-uikit/utils';
18
18
  import { messages, customComponentsWithIcons, createSelectStyles, DropdownIndicator, ClearIndicator, TagRemove } from '@commercetools-uikit/select-utils';
19
19
  import { jsx } from '@emotion/react/jsx-runtime';
20
20
 
@@ -174,20 +174,53 @@ CreatableSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
174
174
  }))]),
175
175
  showOptionGroupDivider: _pt.bool
176
176
  } : {};
177
- CreatableSelectInput.displayName = 'CreatableSelectInput'; // Both "true" and an empty array [] represent a touched state. The Boolean
177
+ CreatableSelectInput.displayName = 'CreatableSelectInput';
178
+ CreatableSelectInput.defaultProps = defaultProps;
179
+ /**
180
+ * Expose static helper methods.
181
+ */
182
+ // Both "true" and an empty array [] represent a touched state. The Boolean
178
183
  // conveniently handles both cases
179
184
 
180
185
  CreatableSelectInput.isTouched = function (touched) {
181
186
  return Boolean(touched);
182
187
  };
188
+ /**
189
+ * Expose react-select components for customization purposes.
190
+ */
191
+ // custom
183
192
 
184
- CreatableSelectInput.defaultProps = defaultProps;
185
- addStaticFields(CreatableSelectInput, _objectSpread(_objectSpread(_objectSpread({}, components), customizedComponents), {}, {
186
- isTouched: CreatableSelectInput.isTouched
187
- }));
193
+
194
+ CreatableSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
195
+ CreatableSelectInput.Control = components.Control;
196
+ CreatableSelectInput.CrossIcon = components.CrossIcon;
197
+ CreatableSelectInput.DownChevron = components.DownChevron; // custom
198
+
199
+ CreatableSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
200
+ CreatableSelectInput.Group = components.Group;
201
+ CreatableSelectInput.GroupHeading = components.GroupHeading;
202
+ CreatableSelectInput.IndicatorSeparator = components.IndicatorSeparator;
203
+ CreatableSelectInput.IndicatorsContainer = components.IndicatorsContainer;
204
+ CreatableSelectInput.Input = components.Input;
205
+ CreatableSelectInput.LoadingIndicator = components.LoadingIndicator;
206
+ CreatableSelectInput.LoadingMessage = components.LoadingMessage;
207
+ CreatableSelectInput.Menu = components.Menu;
208
+ CreatableSelectInput.MenuList = components.MenuList;
209
+ CreatableSelectInput.MenuPortal = components.MenuPortal;
210
+ CreatableSelectInput.MultiValue = components.MultiValue;
211
+ CreatableSelectInput.MultiValueContainer = components.MultiValueContainer;
212
+ CreatableSelectInput.MultiValueLabel = components.MultiValueLabel; // custom
213
+
214
+ CreatableSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
215
+ CreatableSelectInput.NoOptionsMessage = components.NoOptionsMessage;
216
+ CreatableSelectInput.Option = components.Option;
217
+ CreatableSelectInput.Placeholder = components.Placeholder;
218
+ CreatableSelectInput.SelectContainer = components.SelectContainer;
219
+ CreatableSelectInput.SingleValue = components.SingleValue;
220
+ CreatableSelectInput.ValueContainer = components.ValueContainer;
188
221
  var CreatableSelectInput$1 = CreatableSelectInput;
189
222
 
190
223
  // NOTE: This string will be replaced on build time with the package version.
191
- var version = "14.0.0";
224
+ var version = "14.0.1";
192
225
 
193
226
  export { CreatableSelectInput$1 as default, version };
@@ -64,7 +64,64 @@ declare type TCreatableSelectInputProps = {
64
64
  declare const CreatableSelectInput: {
65
65
  (props: TCreatableSelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
66
66
  displayName: string;
67
- isTouched(touched: unknown): boolean;
68
67
  defaultProps: Pick<TCreatableSelectInputProps, "value" | "isSearchable" | "menuPortalZIndex">;
68
+ isTouched(touched: unknown): boolean;
69
+ ClearIndicator: {
70
+ (props: {
71
+ innerProps: {
72
+ ref: import("react").LegacyRef<HTMLButtonElement>;
73
+ } & import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>;
74
+ } & import("react-select").ClearIndicatorProps<unknown, boolean, GroupBase<unknown>>): import("@emotion/react/jsx-runtime").JSX.Element;
75
+ displayName: string;
76
+ };
77
+ 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;
78
+ CrossIcon: (props: import("react-select/dist/declarations/src/components/indicators").CrossIconProps) => import("@emotion/react").jsx.JSX.Element;
79
+ DownChevron: (props: import("react-select/dist/declarations/src/components/indicators").DownChevronProps) => import("@emotion/react").jsx.JSX.Element;
80
+ DropdownIndicator: {
81
+ (props: import("react-select").DropdownIndicatorProps<unknown, boolean, GroupBase<unknown>>): import("@emotion/react/jsx-runtime").JSX.Element;
82
+ displayName: string;
83
+ };
84
+ 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;
85
+ 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;
86
+ 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;
87
+ 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;
88
+ 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;
89
+ LoadingIndicator: {
90
+ <Option_8, IsMulti_8 extends boolean, Group_8 extends GroupBase<Option_8>>(props: import("react-select").LoadingIndicatorProps<Option_8, IsMulti_8, Group_8>): import("@emotion/react").jsx.JSX.Element;
91
+ defaultProps: {
92
+ size: number;
93
+ };
94
+ };
95
+ LoadingMessage: {
96
+ <Option_11, IsMulti_11 extends boolean, Group_11 extends GroupBase<Option_11>>(props: import("react-select").NoticeProps<Option_11, IsMulti_11, Group_11>): import("@emotion/react").jsx.JSX.Element;
97
+ defaultProps: {
98
+ children: string;
99
+ };
100
+ };
101
+ 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;
102
+ 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;
103
+ MenuPortal: typeof import("react-select/dist/declarations/src/components/Menu").MenuPortal;
104
+ MultiValue: <Option_13, IsMulti_13 extends boolean, Group_13 extends GroupBase<Option_13>>(props: import("react-select").MultiValueProps<Option_13, IsMulti_13, Group_13>) => import("@emotion/react").jsx.JSX.Element;
105
+ MultiValueContainer: <Option_14, IsMulti_14 extends boolean, Group_14 extends GroupBase<Option_14>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
106
+ MultiValueLabel: <Option_14_1, IsMulti_14_1 extends boolean, Group_14_1 extends GroupBase<Option_14_1>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_14_1, IsMulti_14_1, Group_14_1>) => import("@emotion/react").jsx.JSX.Element;
107
+ MultiValueRemove: {
108
+ (props: {
109
+ selectProps: {
110
+ isReadOnly: boolean;
111
+ } & import("react-select/dist/declarations/src/Select").Props<unknown, boolean, GroupBase<unknown>>;
112
+ } & import("react-select").MultiValueGenericProps<unknown, boolean, GroupBase<unknown>>): import("@emotion/react/jsx-runtime").JSX.Element;
113
+ displayName: string;
114
+ };
115
+ NoOptionsMessage: {
116
+ <Option_12, IsMulti_12 extends boolean, Group_12 extends GroupBase<Option_12>>(props: import("react-select").NoticeProps<Option_12, IsMulti_12, Group_12>): import("@emotion/react").jsx.JSX.Element;
117
+ defaultProps: {
118
+ children: string;
119
+ };
120
+ };
121
+ Option: <Option_15, IsMulti_15 extends boolean, Group_15 extends GroupBase<Option_15>>(props: import("react-select").OptionProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
122
+ Placeholder: <Option_16, IsMulti_16 extends boolean, Group_16 extends GroupBase<Option_16>>(props: import("react-select").PlaceholderProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
123
+ SelectContainer: <Option_17, IsMulti_17 extends boolean, Group_17 extends GroupBase<Option_17>>(props: import("react-select").ContainerProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react").jsx.JSX.Element;
124
+ SingleValue: <Option_18, IsMulti_18 extends boolean, Group_18 extends GroupBase<Option_18>>(props: import("react-select").SingleValueProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
125
+ ValueContainer: <Option_19, IsMulti_19 extends boolean, Group_19 extends GroupBase<Option_19>>(props: import("react-select").ValueContainerProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
69
126
  };
70
127
  export default CreatableSelectInput;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/creatable-select-input",
3
3
  "description": "An input component getting a selection from the user, and where options can also be created by the user.",
4
- "version": "14.0.0",
4
+ "version": "14.0.1",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,13 +21,13 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.17.2",
23
23
  "@babel/runtime-corejs3": "^7.17.2",
24
- "@commercetools-uikit/constraints": "14.0.0",
24
+ "@commercetools-uikit/constraints": "14.0.1",
25
25
  "@commercetools-uikit/design-system": "14.0.0",
26
- "@commercetools-uikit/icons": "14.0.0",
27
- "@commercetools-uikit/select-utils": "14.0.0",
28
- "@commercetools-uikit/spacings": "14.0.0",
29
- "@commercetools-uikit/text": "14.0.0",
30
- "@commercetools-uikit/utils": "14.0.0",
26
+ "@commercetools-uikit/icons": "14.0.1",
27
+ "@commercetools-uikit/select-utils": "14.0.1",
28
+ "@commercetools-uikit/spacings": "14.0.1",
29
+ "@commercetools-uikit/text": "14.0.1",
30
+ "@commercetools-uikit/utils": "14.0.1",
31
31
  "@emotion/react": "^11.4.0",
32
32
  "@emotion/styled": "^11.3.0",
33
33
  "lodash": "4.17.21",