@commercetools-uikit/creatable-select-input 0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 commercetools GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,165 @@
1
+ <!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -->
2
+ <!-- This file is created by the `yarn generate-readme` script. -->
3
+
4
+ # CreatableSelectInput
5
+
6
+ ## Description
7
+
8
+ An input component getting a selection from the user, and where options can also be created by the user.
9
+
10
+ ## Installation
11
+
12
+ ```
13
+ yarn add @commercetools-uikit/creatable-select-input
14
+ ```
15
+
16
+ ```
17
+ npm --save install @commercetools-uikit/creatable-select-input
18
+ ```
19
+
20
+ Additionally install the peer dependencies (if not present)
21
+
22
+ ```
23
+ yarn add react react-dom react-intl
24
+ ```
25
+
26
+ ```
27
+ npm --save install react react-dom react-intl
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```jsx
33
+ import PropTypes from 'prop-types';
34
+ import CreatableSelectInput from '@commercetools-uikit/creatable-select-input';
35
+
36
+ const Example = (props) => (
37
+ <CreatableSelectInput
38
+ name="form-field-name"
39
+ value={props.value}
40
+ onChange={() => {}}
41
+ options={[
42
+ { value: 'one', label: 'One' },
43
+ { value: 'two', label: 'Two' },
44
+ ]}
45
+ />
46
+ );
47
+ Example.propTypes = {
48
+ value: PropTypes.string,
49
+ };
50
+ export default Example;
51
+ ```
52
+
53
+ ## Properties
54
+
55
+ | Props | Type | Required | Default | Description |
56
+ | ------------------------- | ----------------------------------------------------------------------------------------------------- | :------: | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
57
+ | `horizontalConstraint` | `union`<br/>Possible values:<br/>`, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto'` | | | Horizontal size limit of the input fields. |
58
+ | `hasError` | `boolean` | | | Indicates the input field has an error |
59
+ | `hasWarning` | `boolean` | | | Indicates the input field has a warning |
60
+ | `isReadOnly` | `boolean` | | | Disables the select input as it is read-only |
61
+ | `iconLeft` | `ReactNode` | | | Icon to display on the left of the placeholder text and selected value. Has no effect when `isMulti` is enabled. |
62
+ | `aria-label` | `CreatableProps['aria-label']` | | | Aria label (for assistive tech)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
63
+ | `aria-labelledby` | `CreatableProps['aria-labelledby']` | | | HTML ID of an element that should be used as the label (for assistive tech)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
64
+ | `aria-invalid` | `CreatableProps['aria-invalid']` | | | Indicate if the value entered in the input is invalid.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
65
+ | `aria-errormessage` | `CreatableProps['aria-errormessage']` | | | HTML ID of an element containing an error message related to the input.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props) |
66
+ | `isAutofocussed` | `boolean` | | | Focus the control when it is mounted |
67
+ | `backspaceRemovesValue` | `CreatableProps['backspaceRemovesValue']` | | | Remove the currently focused option when the user presses backspace&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
68
+ | `components` | `CreatableProps['components']` | | | Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
69
+ | `filterOption` | `CreatableProps['filterOption']` | | | Custom method to filter whether an option should be displayed in the menu&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
70
+ | `id` | `CreatableProps['inputId']` | | | The id of the search input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
71
+ | `inputValue` | `CreatableProps['inputValue']` | | | The value of the search input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
72
+ | `containerId` | `CreatableProps['id']` | | | The id to set on the SelectContainer component&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
73
+ | `isClearable` | `CreatableProps['isClearable']` | | | Is the select value clearable&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
74
+ | `isDisabled` | `CreatableProps['isDisabled']` | | | Is the select disabled&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
75
+ | `isOptionDisabled` | `CreatableProps['isOptionDisabled']` | | | Override the built-in logic to detect whether an option is disabled&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
76
+ | `isMulti` | `CreatableProps['isMulti']` | | | Support multiple selected options&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
77
+ | `isSearchable` | `CreatableProps['isSearchable']` | | `true` | Whether to enable search functionality&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
78
+ | `maxMenuHeight` | `CreatableProps['maxMenuHeight']` | | | Maximum height of the menu before scrolling&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
79
+ | `menuPortalTarget` | `CreatableProps['menuPortalTarget']` | | | Dom element to portal the select menu to&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
80
+ | `menuPortalZIndex` | `number` | | `1` | z-index value for the menu portal&#xA;<br>&#xA;Use in conjunction with `menuPortalTarget` |
81
+ | `menuShouldBlockScroll` | `CreatableProps['menuShouldBlockScroll']` | | | whether the menu should block scroll while open&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
82
+ | `closeMenuOnSelect` | `CreatableProps['closeMenuOnSelect']` | | | Whether the menu should close after a value is selected. Defaults to `true`.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
83
+ | `name` | `CreatableProps['name']` | | | Name of the HTML Input (optional - without this, no input will be rendered)&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
84
+ | `noOptionsMessage` | `CreatableProps['noOptionsMessage']` | | | 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.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
85
+ | `onBlur` | `Function`<br/>[See signature.](#signature-onblur) | | | Handle blur events on the control |
86
+ | `onChange` | `Function`<br/>[See signature.](#signature-onchange) | | | 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`. |
87
+ | `onFocus` | `CreatableProps['onFocus']` | | | Handle focus events on the control&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
88
+ | `onInputChange` | `CreatableProps['onInputChange']` | | | Handle change events on the input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
89
+ | `options` | `union`<br/>Possible values:<br/>`TValue[] , { options: TValue[] }[]` | | | Array of options that populate the select menu |
90
+ | `showOptionGroupDivider` | `boolean` | | | Determines if option groups will be separated by a divider |
91
+ | `placeholder` | `CreatableProps['placeholder']` | | | Placeholder text for the select value&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
92
+ | `isCondensed` | `boolean` | | | Use this property to reduce the paddings of the component for a ui compact variant |
93
+ | `tabIndex` | `CreatableProps['tabIndex']` | | | Sets the tabIndex attribute on the input&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
94
+ | `tabSelectsValue` | `CreatableProps['tabSelectsValue']` | | | Select the currently focused option when the user presses tab&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
95
+ | `value` | `CreatableProps['value']` | | `null` | The value of the select; reflected by the selected option&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
96
+ | `allowCreateWhileLoading` | `CreatableProps['allowCreateWhileLoading']` | | | Allow options to be created while the isLoading prop is true. Useful to prevent the "create new ..." option being displayed while async results are still being loaded.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
97
+ | `formatCreateLabel` | `CreatableProps['formatCreateLabel']` | | | Gets the label for the "create new ..." option in the menu. Is given the current input value.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
98
+ | `isValidNewOption` | `CreatableProps['isValidNewOption']` | | | Determines whether the "create new ..." option should be displayed based on the current input value, select value and options array.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
99
+ | `getNewOptionData` | `CreatableProps['getNewOptionData']` | | | Returns the data for the new option when it is created. Used to display the value, and is passed to onChange.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
100
+ | `onCreateOption` | `CreatableProps['onCreateOption']` | | | If provided, this will be called with the input value when a new option is created, and onChange will not be called. Use this when you need more control over what happens when new options are created.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
101
+ | `createOptionPosition` | `CreatableProps['createOptionPosition']` | | | Sets the position of the createOption element in your options list.&#xA;<br>&#xA;[Props from React select was used](https://react-select.com/props#creatable-props) |
102
+
103
+ ## Signatures
104
+
105
+ ### Signature `onBlur`
106
+
107
+ ```ts
108
+ (event: TCustomEvent) => void
109
+ ```
110
+
111
+ ### Signature `onChange`
112
+
113
+ ```ts
114
+ (event: TCustomEvent, info: ActionMeta<unknown>) => void
115
+ ```
116
+
117
+ This input is built on top of [`react-select`](https://github.com/JedWatson/react-select) v2.
118
+ It supports mostly same properties as `react-select`. Behaviour for some props was changed, and support for others was dropped.
119
+
120
+ In case you need one of the currently excluded props, feel free to open a PR adding them.
121
+
122
+ ### `options`
123
+
124
+ The options support a `isDisabled` property which will render the option with a disabled style and will prevent users from selecting it.
125
+
126
+ ## Static Properties
127
+
128
+ ### `isTouched(touched)`
129
+
130
+ Returns truthy value for the Formik `touched` value of this input field.
131
+
132
+ ## Components
133
+
134
+ It is possible to customize `CreatableSelectInput` by passing the `components` property.
135
+ `CreatableSelectInput` exports the default underlying components as static exports.
136
+
137
+ Components available as static exports are:
138
+
139
+ - `ClearIndicator`
140
+ - `Control`
141
+ - `CrossIcon`
142
+ - `DownChevron`
143
+ - `DropdownIndicator`
144
+ - `Group`
145
+ - `GroupHeading`
146
+ - `IndicatorsContainer`
147
+ - `IndicatorSeparator`
148
+ - `Input`
149
+ - `LoadingIndicator`
150
+ - `LoadingMessage`
151
+ - `Menu`
152
+ - `MenuList`
153
+ - `MenuPortal`
154
+ - `MultiValue`
155
+ - `MultiValueContainer`
156
+ - `MultiValueLabel`
157
+ - `MultiValueRemove`
158
+ - `NoOptionsMessage`
159
+ - `Option`
160
+ - `Placeholder`
161
+ - `SelectContainer`
162
+ - `SingleValue`
163
+ - `ValueContainer`
164
+
165
+ See the [official documentation](https://react-select.com/components) for more information about the props they receive.
@@ -0,0 +1,3 @@
1
+ export * from "./declarations/src/index.js";
2
+ export { default } from "./declarations/src/index.js";
3
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy11aWtpdC1jcmVhdGFibGUtc2VsZWN0LWlucHV0LmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
@@ -0,0 +1,228 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
6
+ var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
7
+ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
8
+ var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
9
+ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
10
+ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
11
+ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
12
+ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
13
+ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
14
+ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
15
+ var reactIntl = require('react-intl');
16
+ var isEmpty = require('lodash/isEmpty');
17
+ var reactSelect = require('react-select');
18
+ var CreatableSelect = require('react-select/creatable');
19
+ var Constraints = require('@commercetools-uikit/constraints');
20
+ var utils = require('@commercetools-uikit/utils');
21
+ var selectUtils = require('@commercetools-uikit/select-utils');
22
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
23
+
24
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
25
+
26
+ var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
27
+ var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
28
+ var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
29
+ var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
30
+ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
31
+ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
32
+ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
33
+ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
34
+ var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty);
35
+ var CreatableSelect__default = /*#__PURE__*/_interopDefault(CreatableSelect);
36
+ var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
37
+
38
+ const _excluded = ["value", "isSearchable", "menuPortalZIndex"];
39
+ function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
40
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
41
+ const customizedComponents = {
42
+ DropdownIndicator: selectUtils.DropdownIndicator,
43
+ ClearIndicator: selectUtils.ClearIndicator,
44
+ MultiValueRemove: selectUtils.TagRemove
45
+ };
46
+ const CreatableSelectInput = _ref => {
47
+ let _ref$value = _ref.value,
48
+ value = _ref$value === void 0 ? null : _ref$value,
49
+ _ref$isSearchable = _ref.isSearchable,
50
+ isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable,
51
+ _ref$menuPortalZIndex = _ref.menuPortalZIndex,
52
+ menuPortalZIndex = _ref$menuPortalZIndex === void 0 ? 1 : _ref$menuPortalZIndex,
53
+ props = _objectWithoutProperties(_ref, _excluded);
54
+ const intl = reactIntl.useIntl();
55
+ if (!props.isReadOnly) {
56
+ process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'CreatableSelectInput: `onChange` is required when input is not read only.') : void 0;
57
+ }
58
+ const placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder);
59
+ return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
60
+ max: props.horizontalConstraint,
61
+ children: jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, utils.filterDataAttributes(_objectSpread({
62
+ value,
63
+ isSearchable,
64
+ menuPortalZIndex
65
+ }, props))), {}, {
66
+ children: jsxRuntime.jsx(CreatableSelect__default["default"], {
67
+ "aria-label": props['aria-label'],
68
+ "aria-labelledby": props['aria-labelledby'],
69
+ "aria-invalid": props['aria-invalid'],
70
+ "aria-errormessage": props['aria-errormessage'],
71
+ autoFocus: props.isAutofocussed,
72
+ backspaceRemovesValue: props.isReadOnly ? false : props.backspaceRemovesValue,
73
+ components: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, customizedComponents), props.components), props.iconLeft && !props.isMulti ? selectUtils.customComponentsWithIcons : {}), props.isReadOnly ? {
74
+ Input: ownProps => jsxRuntime.jsx(reactSelect.components.Input, _objectSpread(_objectSpread({}, ownProps), {}, {
75
+ readOnly: true
76
+ }))
77
+ } : {}), props.components),
78
+ menuIsOpen: props.isReadOnly ? false : undefined,
79
+ styles: selectUtils.createSelectStyles({
80
+ hasWarning: props.hasWarning,
81
+ hasError: props.hasError,
82
+ showOptionGroupDivider: props.showOptionGroupDivider,
83
+ menuPortalZIndex: menuPortalZIndex,
84
+ isCondensed: props.isCondensed,
85
+ isDisabled: props.isDisabled,
86
+ isReadOnly: props.isReadOnly,
87
+ iconLeft: props.iconLeft,
88
+ isMulti: props.isMulti,
89
+ hasValue: !isEmpty__default["default"](value),
90
+ horizontalConstraint: props.horizontalConstraint
91
+ }),
92
+ filterOption: props.filterOption
93
+ // react-select uses "id" (for the container) and "inputId" (for the input),
94
+ // but we use "id" (for the input) and "containerId" (for the container)
95
+ // instead.
96
+ // This makes it easier to less confusing to use with <label />s.
97
+ ,
98
+ id: props.containerId,
99
+ inputId: props.id,
100
+ inputValue: props.inputValue,
101
+ isClearable: props.isReadOnly ? false : props.isClearable,
102
+ isDisabled: props.isDisabled,
103
+ isOptionDisabled: props.isOptionDisabled,
104
+ isMulti: props.isMulti,
105
+ isSearchable: isSearchable,
106
+ maxMenuHeight: props.maxMenuHeight,
107
+ menuPortalTarget: props.menuPortalTarget,
108
+ menuShouldBlockScroll: props.menuShouldBlockScroll,
109
+ closeMenuOnSelect: props.closeMenuOnSelect,
110
+ name: props.name,
111
+ noOptionsMessage: props.noOptionsMessage || (_ref2 => {
112
+ let inputValue = _ref2.inputValue;
113
+ return inputValue === '' ? intl.formatMessage(selectUtils.messages.noOptionsMessageWithoutInputValue) : intl.formatMessage(selectUtils.messages.noOptionsMessageWithInputValue, {
114
+ inputValue
115
+ });
116
+ }),
117
+ onBlur: typeof props.onBlur === 'function' ? () => {
118
+ const event = {
119
+ target: {
120
+ id: props.id,
121
+ name: (() => {
122
+ if (!props.isMulti) return props.name;
123
+ // We append the ".0" to make Formik set the touched
124
+ // state as an array instead of a boolean only.
125
+ // Otherwise the shapes would clash on submission, as
126
+ // Formik will create an array on submission anyways.
127
+ return props.name ? "".concat(props.name, ".0") : undefined;
128
+ })()
129
+ },
130
+ persist: () => {}
131
+ };
132
+ props.onBlur && props.onBlur(event);
133
+ } : undefined,
134
+ onChange: (value, info) => {
135
+ var _props$onChange;
136
+ // selectedOptions is either an array, or a single option, or null
137
+ // depending on whether we're in multi-mode or not (isMulti)
138
+
139
+ let newValue = value;
140
+ if (props.isMulti && !newValue) {
141
+ newValue = [];
142
+ }
143
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, {
144
+ target: {
145
+ id: props.id,
146
+ name: props.name,
147
+ value: newValue
148
+ },
149
+ persist: () => {}
150
+ }, info);
151
+ },
152
+ onFocus: props.onFocus,
153
+ onInputChange: props.onInputChange,
154
+ options: props.options,
155
+ placeholder: placeholder,
156
+ tabIndex: props.tabIndex,
157
+ tabSelectsValue: props.tabSelectsValue,
158
+ value: value
159
+ // Creatable props
160
+ ,
161
+ allowCreateWhileLoading: props.allowCreateWhileLoading,
162
+ formatCreateLabel: props.formatCreateLabel || (inputValue => intl.formatMessage(selectUtils.messages.createLabel, {
163
+ inputValue
164
+ })),
165
+ isValidNewOption: props.isValidNewOption,
166
+ getNewOptionData: props.getNewOptionData,
167
+ onCreateOption: props.onCreateOption,
168
+ createOptionPosition: props.createOptionPosition
169
+ //@ts-ignore
170
+ ,
171
+ iconLeft: props.iconLeft,
172
+ isCondensed: props.isCondensed
173
+ })
174
+ }))
175
+ });
176
+ };
177
+ CreatableSelectInput.displayName = 'CreatableSelectInput';
178
+
179
+ /**
180
+ * Expose static helper methods.
181
+ */
182
+
183
+ // Both "true" and an empty array [] represent a touched state. The Boolean
184
+ // conveniently handles both cases
185
+ CreatableSelectInput.isTouched = touched => Boolean(touched);
186
+
187
+ /**
188
+ * Expose react-select components for customization purposes.
189
+ */
190
+
191
+ // custom
192
+ CreatableSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
193
+ CreatableSelectInput.Control = reactSelect.components.Control;
194
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
195
+ CreatableSelectInput.CrossIcon = reactSelect.components.CrossIcon;
196
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
197
+ CreatableSelectInput.DownChevron = reactSelect.components.DownChevron;
198
+ // custom
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
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
210
+ CreatableSelectInput.MenuPortal = reactSelect.components.MenuPortal;
211
+ CreatableSelectInput.MultiValue = reactSelect.components.MultiValue;
212
+ CreatableSelectInput.MultiValueContainer = reactSelect.components.MultiValueContainer;
213
+ CreatableSelectInput.MultiValueLabel = reactSelect.components.MultiValueLabel;
214
+ // custom
215
+ CreatableSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
216
+ CreatableSelectInput.NoOptionsMessage = reactSelect.components.NoOptionsMessage;
217
+ CreatableSelectInput.Option = reactSelect.components.Option;
218
+ CreatableSelectInput.Placeholder = reactSelect.components.Placeholder;
219
+ CreatableSelectInput.SelectContainer = reactSelect.components.SelectContainer;
220
+ CreatableSelectInput.SingleValue = reactSelect.components.SingleValue;
221
+ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
222
+ var CreatableSelectInput$1 = CreatableSelectInput;
223
+
224
+ // NOTE: This string will be replaced on build time with the package version.
225
+ var version = "20.3.1";
226
+
227
+ exports["default"] = CreatableSelectInput$1;
228
+ exports.version = version;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === "production") {
4
+ module.exports = require("./commercetools-uikit-creatable-select-input.cjs.prod.js");
5
+ } else {
6
+ module.exports = require("./commercetools-uikit-creatable-select-input.cjs.dev.js");
7
+ }
@@ -0,0 +1,226 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
6
+ var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
7
+ var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
8
+ var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
9
+ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
10
+ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
11
+ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
12
+ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
13
+ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
14
+ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
15
+ var reactIntl = require('react-intl');
16
+ var isEmpty = require('lodash/isEmpty');
17
+ var reactSelect = require('react-select');
18
+ var CreatableSelect = require('react-select/creatable');
19
+ var Constraints = require('@commercetools-uikit/constraints');
20
+ var utils = require('@commercetools-uikit/utils');
21
+ var selectUtils = require('@commercetools-uikit/select-utils');
22
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
23
+
24
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
25
+
26
+ var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
27
+ var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
28
+ var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
29
+ var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
30
+ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
31
+ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
32
+ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
33
+ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
34
+ var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty);
35
+ var CreatableSelect__default = /*#__PURE__*/_interopDefault(CreatableSelect);
36
+ var Constraints__default = /*#__PURE__*/_interopDefault(Constraints);
37
+
38
+ const _excluded = ["value", "isSearchable", "menuPortalZIndex"];
39
+ function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
40
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
41
+ const customizedComponents = {
42
+ DropdownIndicator: selectUtils.DropdownIndicator,
43
+ ClearIndicator: selectUtils.ClearIndicator,
44
+ MultiValueRemove: selectUtils.TagRemove
45
+ };
46
+ const CreatableSelectInput = _ref => {
47
+ let _ref$value = _ref.value,
48
+ value = _ref$value === void 0 ? null : _ref$value,
49
+ _ref$isSearchable = _ref.isSearchable,
50
+ isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable,
51
+ _ref$menuPortalZIndex = _ref.menuPortalZIndex,
52
+ menuPortalZIndex = _ref$menuPortalZIndex === void 0 ? 1 : _ref$menuPortalZIndex,
53
+ props = _objectWithoutProperties(_ref, _excluded);
54
+ const intl = reactIntl.useIntl();
55
+ if (!props.isReadOnly) ;
56
+ const placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder);
57
+ return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
58
+ max: props.horizontalConstraint,
59
+ children: jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, utils.filterDataAttributes(_objectSpread({
60
+ value,
61
+ isSearchable,
62
+ menuPortalZIndex
63
+ }, props))), {}, {
64
+ children: jsxRuntime.jsx(CreatableSelect__default["default"], {
65
+ "aria-label": props['aria-label'],
66
+ "aria-labelledby": props['aria-labelledby'],
67
+ "aria-invalid": props['aria-invalid'],
68
+ "aria-errormessage": props['aria-errormessage'],
69
+ autoFocus: props.isAutofocussed,
70
+ backspaceRemovesValue: props.isReadOnly ? false : props.backspaceRemovesValue,
71
+ components: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, customizedComponents), props.components), props.iconLeft && !props.isMulti ? selectUtils.customComponentsWithIcons : {}), props.isReadOnly ? {
72
+ Input: ownProps => jsxRuntime.jsx(reactSelect.components.Input, _objectSpread(_objectSpread({}, ownProps), {}, {
73
+ readOnly: true
74
+ }))
75
+ } : {}), props.components),
76
+ menuIsOpen: props.isReadOnly ? false : undefined,
77
+ styles: selectUtils.createSelectStyles({
78
+ hasWarning: props.hasWarning,
79
+ hasError: props.hasError,
80
+ showOptionGroupDivider: props.showOptionGroupDivider,
81
+ menuPortalZIndex: menuPortalZIndex,
82
+ isCondensed: props.isCondensed,
83
+ isDisabled: props.isDisabled,
84
+ isReadOnly: props.isReadOnly,
85
+ iconLeft: props.iconLeft,
86
+ isMulti: props.isMulti,
87
+ hasValue: !isEmpty__default["default"](value),
88
+ horizontalConstraint: props.horizontalConstraint
89
+ }),
90
+ filterOption: props.filterOption
91
+ // react-select uses "id" (for the container) and "inputId" (for the input),
92
+ // but we use "id" (for the input) and "containerId" (for the container)
93
+ // instead.
94
+ // This makes it easier to less confusing to use with <label />s.
95
+ ,
96
+ id: props.containerId,
97
+ inputId: props.id,
98
+ inputValue: props.inputValue,
99
+ isClearable: props.isReadOnly ? false : props.isClearable,
100
+ isDisabled: props.isDisabled,
101
+ isOptionDisabled: props.isOptionDisabled,
102
+ isMulti: props.isMulti,
103
+ isSearchable: isSearchable,
104
+ maxMenuHeight: props.maxMenuHeight,
105
+ menuPortalTarget: props.menuPortalTarget,
106
+ menuShouldBlockScroll: props.menuShouldBlockScroll,
107
+ closeMenuOnSelect: props.closeMenuOnSelect,
108
+ name: props.name,
109
+ noOptionsMessage: props.noOptionsMessage || (_ref2 => {
110
+ let inputValue = _ref2.inputValue;
111
+ return inputValue === '' ? intl.formatMessage(selectUtils.messages.noOptionsMessageWithoutInputValue) : intl.formatMessage(selectUtils.messages.noOptionsMessageWithInputValue, {
112
+ inputValue
113
+ });
114
+ }),
115
+ onBlur: typeof props.onBlur === 'function' ? () => {
116
+ const event = {
117
+ target: {
118
+ id: props.id,
119
+ name: (() => {
120
+ if (!props.isMulti) return props.name;
121
+ // We append the ".0" to make Formik set the touched
122
+ // state as an array instead of a boolean only.
123
+ // Otherwise the shapes would clash on submission, as
124
+ // Formik will create an array on submission anyways.
125
+ return props.name ? "".concat(props.name, ".0") : undefined;
126
+ })()
127
+ },
128
+ persist: () => {}
129
+ };
130
+ props.onBlur && props.onBlur(event);
131
+ } : undefined,
132
+ onChange: (value, info) => {
133
+ var _props$onChange;
134
+ // selectedOptions is either an array, or a single option, or null
135
+ // depending on whether we're in multi-mode or not (isMulti)
136
+
137
+ let newValue = value;
138
+ if (props.isMulti && !newValue) {
139
+ newValue = [];
140
+ }
141
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, {
142
+ target: {
143
+ id: props.id,
144
+ name: props.name,
145
+ value: newValue
146
+ },
147
+ persist: () => {}
148
+ }, info);
149
+ },
150
+ onFocus: props.onFocus,
151
+ onInputChange: props.onInputChange,
152
+ options: props.options,
153
+ placeholder: placeholder,
154
+ tabIndex: props.tabIndex,
155
+ tabSelectsValue: props.tabSelectsValue,
156
+ value: value
157
+ // Creatable props
158
+ ,
159
+ allowCreateWhileLoading: props.allowCreateWhileLoading,
160
+ formatCreateLabel: props.formatCreateLabel || (inputValue => intl.formatMessage(selectUtils.messages.createLabel, {
161
+ inputValue
162
+ })),
163
+ isValidNewOption: props.isValidNewOption,
164
+ getNewOptionData: props.getNewOptionData,
165
+ onCreateOption: props.onCreateOption,
166
+ createOptionPosition: props.createOptionPosition
167
+ //@ts-ignore
168
+ ,
169
+ iconLeft: props.iconLeft,
170
+ isCondensed: props.isCondensed
171
+ })
172
+ }))
173
+ });
174
+ };
175
+ CreatableSelectInput.displayName = 'CreatableSelectInput';
176
+
177
+ /**
178
+ * Expose static helper methods.
179
+ */
180
+
181
+ // Both "true" and an empty array [] represent a touched state. The Boolean
182
+ // conveniently handles both cases
183
+ CreatableSelectInput.isTouched = touched => Boolean(touched);
184
+
185
+ /**
186
+ * Expose react-select components for customization purposes.
187
+ */
188
+
189
+ // custom
190
+ CreatableSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
191
+ CreatableSelectInput.Control = reactSelect.components.Control;
192
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
193
+ CreatableSelectInput.CrossIcon = reactSelect.components.CrossIcon;
194
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
195
+ CreatableSelectInput.DownChevron = reactSelect.components.DownChevron;
196
+ // custom
197
+ CreatableSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
198
+ CreatableSelectInput.Group = reactSelect.components.Group;
199
+ CreatableSelectInput.GroupHeading = reactSelect.components.GroupHeading;
200
+ CreatableSelectInput.IndicatorSeparator = reactSelect.components.IndicatorSeparator;
201
+ CreatableSelectInput.IndicatorsContainer = reactSelect.components.IndicatorsContainer;
202
+ CreatableSelectInput.Input = reactSelect.components.Input;
203
+ CreatableSelectInput.LoadingIndicator = reactSelect.components.LoadingIndicator;
204
+ CreatableSelectInput.LoadingMessage = reactSelect.components.LoadingMessage;
205
+ CreatableSelectInput.Menu = reactSelect.components.Menu;
206
+ CreatableSelectInput.MenuList = reactSelect.components.MenuList;
207
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
208
+ CreatableSelectInput.MenuPortal = reactSelect.components.MenuPortal;
209
+ CreatableSelectInput.MultiValue = reactSelect.components.MultiValue;
210
+ CreatableSelectInput.MultiValueContainer = reactSelect.components.MultiValueContainer;
211
+ CreatableSelectInput.MultiValueLabel = reactSelect.components.MultiValueLabel;
212
+ // custom
213
+ CreatableSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
214
+ CreatableSelectInput.NoOptionsMessage = reactSelect.components.NoOptionsMessage;
215
+ CreatableSelectInput.Option = reactSelect.components.Option;
216
+ CreatableSelectInput.Placeholder = reactSelect.components.Placeholder;
217
+ CreatableSelectInput.SelectContainer = reactSelect.components.SelectContainer;
218
+ CreatableSelectInput.SingleValue = reactSelect.components.SingleValue;
219
+ CreatableSelectInput.ValueContainer = reactSelect.components.ValueContainer;
220
+ var CreatableSelectInput$1 = CreatableSelectInput;
221
+
222
+ // NOTE: This string will be replaced on build time with the package version.
223
+ var version = "20.3.1";
224
+
225
+ exports["default"] = CreatableSelectInput$1;
226
+ exports.version = version;
@@ -0,0 +1,209 @@
1
+ import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
2
+ import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
3
+ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
4
+ import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
5
+ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
6
+ import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
7
+ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
8
+ import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
9
+ import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
10
+ import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
11
+ import { useIntl } from 'react-intl';
12
+ import isEmpty from 'lodash/isEmpty';
13
+ import { components } from 'react-select';
14
+ import CreatableSelect from 'react-select/creatable';
15
+ import Constraints from '@commercetools-uikit/constraints';
16
+ import { warning, filterDataAttributes } from '@commercetools-uikit/utils';
17
+ import { messages, customComponentsWithIcons, createSelectStyles, DropdownIndicator, ClearIndicator, TagRemove } from '@commercetools-uikit/select-utils';
18
+ import { jsx } from '@emotion/react/jsx-runtime';
19
+
20
+ const _excluded = ["value", "isSearchable", "menuPortalZIndex"];
21
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
23
+ const customizedComponents = {
24
+ DropdownIndicator,
25
+ ClearIndicator,
26
+ MultiValueRemove: TagRemove
27
+ };
28
+ const CreatableSelectInput = _ref => {
29
+ let _ref$value = _ref.value,
30
+ value = _ref$value === void 0 ? null : _ref$value,
31
+ _ref$isSearchable = _ref.isSearchable,
32
+ isSearchable = _ref$isSearchable === void 0 ? true : _ref$isSearchable,
33
+ _ref$menuPortalZIndex = _ref.menuPortalZIndex,
34
+ menuPortalZIndex = _ref$menuPortalZIndex === void 0 ? 1 : _ref$menuPortalZIndex,
35
+ props = _objectWithoutProperties(_ref, _excluded);
36
+ const intl = useIntl();
37
+ if (!props.isReadOnly) {
38
+ process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'CreatableSelectInput: `onChange` is required when input is not read only.') : void 0;
39
+ }
40
+ const placeholder = props.placeholder || intl.formatMessage(messages.placeholder);
41
+ return jsx(Constraints.Horizontal, {
42
+ max: props.horizontalConstraint,
43
+ children: jsx("div", _objectSpread(_objectSpread({}, filterDataAttributes(_objectSpread({
44
+ value,
45
+ isSearchable,
46
+ menuPortalZIndex
47
+ }, props))), {}, {
48
+ children: jsx(CreatableSelect, {
49
+ "aria-label": props['aria-label'],
50
+ "aria-labelledby": props['aria-labelledby'],
51
+ "aria-invalid": props['aria-invalid'],
52
+ "aria-errormessage": props['aria-errormessage'],
53
+ autoFocus: props.isAutofocussed,
54
+ backspaceRemovesValue: props.isReadOnly ? false : props.backspaceRemovesValue,
55
+ components: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, customizedComponents), props.components), props.iconLeft && !props.isMulti ? customComponentsWithIcons : {}), props.isReadOnly ? {
56
+ Input: ownProps => jsx(components.Input, _objectSpread(_objectSpread({}, ownProps), {}, {
57
+ readOnly: true
58
+ }))
59
+ } : {}), props.components),
60
+ menuIsOpen: props.isReadOnly ? false : undefined,
61
+ styles: createSelectStyles({
62
+ hasWarning: props.hasWarning,
63
+ hasError: props.hasError,
64
+ showOptionGroupDivider: props.showOptionGroupDivider,
65
+ menuPortalZIndex: menuPortalZIndex,
66
+ isCondensed: props.isCondensed,
67
+ isDisabled: props.isDisabled,
68
+ isReadOnly: props.isReadOnly,
69
+ iconLeft: props.iconLeft,
70
+ isMulti: props.isMulti,
71
+ hasValue: !isEmpty(value),
72
+ horizontalConstraint: props.horizontalConstraint
73
+ }),
74
+ filterOption: props.filterOption
75
+ // react-select uses "id" (for the container) and "inputId" (for the input),
76
+ // but we use "id" (for the input) and "containerId" (for the container)
77
+ // instead.
78
+ // This makes it easier to less confusing to use with <label />s.
79
+ ,
80
+ id: props.containerId,
81
+ inputId: props.id,
82
+ inputValue: props.inputValue,
83
+ isClearable: props.isReadOnly ? false : props.isClearable,
84
+ isDisabled: props.isDisabled,
85
+ isOptionDisabled: props.isOptionDisabled,
86
+ isMulti: props.isMulti,
87
+ isSearchable: isSearchable,
88
+ maxMenuHeight: props.maxMenuHeight,
89
+ menuPortalTarget: props.menuPortalTarget,
90
+ menuShouldBlockScroll: props.menuShouldBlockScroll,
91
+ closeMenuOnSelect: props.closeMenuOnSelect,
92
+ name: props.name,
93
+ noOptionsMessage: props.noOptionsMessage || (_ref2 => {
94
+ let inputValue = _ref2.inputValue;
95
+ return inputValue === '' ? intl.formatMessage(messages.noOptionsMessageWithoutInputValue) : intl.formatMessage(messages.noOptionsMessageWithInputValue, {
96
+ inputValue
97
+ });
98
+ }),
99
+ onBlur: typeof props.onBlur === 'function' ? () => {
100
+ const event = {
101
+ target: {
102
+ id: props.id,
103
+ name: (() => {
104
+ if (!props.isMulti) return props.name;
105
+ // We append the ".0" to make Formik set the touched
106
+ // state as an array instead of a boolean only.
107
+ // Otherwise the shapes would clash on submission, as
108
+ // Formik will create an array on submission anyways.
109
+ return props.name ? "".concat(props.name, ".0") : undefined;
110
+ })()
111
+ },
112
+ persist: () => {}
113
+ };
114
+ props.onBlur && props.onBlur(event);
115
+ } : undefined,
116
+ onChange: (value, info) => {
117
+ var _props$onChange;
118
+ // selectedOptions is either an array, or a single option, or null
119
+ // depending on whether we're in multi-mode or not (isMulti)
120
+
121
+ let newValue = value;
122
+ if (props.isMulti && !newValue) {
123
+ newValue = [];
124
+ }
125
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, {
126
+ target: {
127
+ id: props.id,
128
+ name: props.name,
129
+ value: newValue
130
+ },
131
+ persist: () => {}
132
+ }, info);
133
+ },
134
+ onFocus: props.onFocus,
135
+ onInputChange: props.onInputChange,
136
+ options: props.options,
137
+ placeholder: placeholder,
138
+ tabIndex: props.tabIndex,
139
+ tabSelectsValue: props.tabSelectsValue,
140
+ value: value
141
+ // Creatable props
142
+ ,
143
+ allowCreateWhileLoading: props.allowCreateWhileLoading,
144
+ formatCreateLabel: props.formatCreateLabel || (inputValue => intl.formatMessage(messages.createLabel, {
145
+ inputValue
146
+ })),
147
+ isValidNewOption: props.isValidNewOption,
148
+ getNewOptionData: props.getNewOptionData,
149
+ onCreateOption: props.onCreateOption,
150
+ createOptionPosition: props.createOptionPosition
151
+ //@ts-ignore
152
+ ,
153
+ iconLeft: props.iconLeft,
154
+ isCondensed: props.isCondensed
155
+ })
156
+ }))
157
+ });
158
+ };
159
+ CreatableSelectInput.displayName = 'CreatableSelectInput';
160
+
161
+ /**
162
+ * Expose static helper methods.
163
+ */
164
+
165
+ // Both "true" and an empty array [] represent a touched state. The Boolean
166
+ // conveniently handles both cases
167
+ CreatableSelectInput.isTouched = touched => Boolean(touched);
168
+
169
+ /**
170
+ * Expose react-select components for customization purposes.
171
+ */
172
+
173
+ // custom
174
+ CreatableSelectInput.ClearIndicator = customizedComponents.ClearIndicator;
175
+ CreatableSelectInput.Control = components.Control;
176
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
177
+ CreatableSelectInput.CrossIcon = components.CrossIcon;
178
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
179
+ CreatableSelectInput.DownChevron = components.DownChevron;
180
+ // custom
181
+ CreatableSelectInput.DropdownIndicator = customizedComponents.DropdownIndicator;
182
+ CreatableSelectInput.Group = components.Group;
183
+ CreatableSelectInput.GroupHeading = components.GroupHeading;
184
+ CreatableSelectInput.IndicatorSeparator = components.IndicatorSeparator;
185
+ CreatableSelectInput.IndicatorsContainer = components.IndicatorsContainer;
186
+ CreatableSelectInput.Input = components.Input;
187
+ CreatableSelectInput.LoadingIndicator = components.LoadingIndicator;
188
+ CreatableSelectInput.LoadingMessage = components.LoadingMessage;
189
+ CreatableSelectInput.Menu = components.Menu;
190
+ CreatableSelectInput.MenuList = components.MenuList;
191
+ //https://github.com/commercetools/ui-kit/pull/3054/files#r1943026570
192
+ CreatableSelectInput.MenuPortal = components.MenuPortal;
193
+ CreatableSelectInput.MultiValue = components.MultiValue;
194
+ CreatableSelectInput.MultiValueContainer = components.MultiValueContainer;
195
+ CreatableSelectInput.MultiValueLabel = components.MultiValueLabel;
196
+ // custom
197
+ CreatableSelectInput.MultiValueRemove = customizedComponents.MultiValueRemove;
198
+ CreatableSelectInput.NoOptionsMessage = components.NoOptionsMessage;
199
+ CreatableSelectInput.Option = components.Option;
200
+ CreatableSelectInput.Placeholder = components.Placeholder;
201
+ CreatableSelectInput.SelectContainer = components.SelectContainer;
202
+ CreatableSelectInput.SingleValue = components.SingleValue;
203
+ CreatableSelectInput.ValueContainer = components.ValueContainer;
204
+ var CreatableSelectInput$1 = CreatableSelectInput;
205
+
206
+ // NOTE: This string will be replaced on build time with the package version.
207
+ var version = "20.3.1";
208
+
209
+ export { CreatableSelectInput$1 as default, version };
@@ -0,0 +1,323 @@
1
+ import type { ComponentType, ReactNode, JSX } from 'react';
2
+ import { type ActionMeta, type GroupBase, type CommonPropsAndClassName, type MenuPlacement, type MenuPosition } from 'react-select';
3
+ import { type CreatableProps } from 'react-select/creatable';
4
+ type TValue = {
5
+ value: string;
6
+ label?: ReactNode;
7
+ };
8
+ type TOptions = TValue[] | {
9
+ options: TValue[];
10
+ }[];
11
+ type TCustomEvent = {
12
+ target: {
13
+ id?: string;
14
+ name?: string;
15
+ value?: unknown;
16
+ };
17
+ persist?: () => void;
18
+ };
19
+ type ReactSelectCreatableProps = CreatableProps<unknown, boolean, GroupBase<unknown>>;
20
+ export type TCreatableSelectInputProps = {
21
+ /**
22
+ * Horizontal size limit of the input fields.
23
+ */
24
+ horizontalConstraint?: 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto';
25
+ /**
26
+ * Indicates the input field has an error
27
+ */
28
+ hasError?: boolean;
29
+ /**
30
+ * Indicates the input field has a warning
31
+ */
32
+ hasWarning?: boolean;
33
+ /**
34
+ * Disables the select input as it is read-only
35
+ */
36
+ isReadOnly?: boolean;
37
+ /**
38
+ * Icon to display on the left of the placeholder text and selected value. Has no effect when `isMulti` is enabled.
39
+ */
40
+ iconLeft?: ReactNode;
41
+ /**
42
+ * Aria label (for assistive tech)
43
+ * <br>
44
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
45
+ */
46
+ 'aria-label'?: ReactSelectCreatableProps['aria-label'];
47
+ /**
48
+ * HTML ID of an element that should be used as the label (for assistive tech)
49
+ * <br>
50
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
51
+ */
52
+ 'aria-labelledby'?: ReactSelectCreatableProps['aria-labelledby'];
53
+ /**
54
+ * Indicate if the value entered in the input is invalid.
55
+ * <br>
56
+ * [Props from React select was used](https://react-select.com/props)
57
+ */
58
+ 'aria-invalid'?: ReactSelectCreatableProps['aria-invalid'];
59
+ /**
60
+ * HTML ID of an element containing an error message related to the input.
61
+ * <br>
62
+ * [Props from React select was used](https://react-select.com/props)
63
+ */
64
+ 'aria-errormessage'?: ReactSelectCreatableProps['aria-errormessage'];
65
+ /**
66
+ * Focus the control when it is mounted
67
+ */
68
+ isAutofocussed?: boolean;
69
+ /**
70
+ * Remove the currently focused option when the user presses backspace
71
+ * <br>
72
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
73
+ */
74
+ backspaceRemovesValue?: ReactSelectCreatableProps['backspaceRemovesValue'];
75
+ /**
76
+ * Map of components to overwrite the default ones, see [what components you can override](https://react-select.com/components)
77
+ * <br>
78
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
79
+ */
80
+ components?: ReactSelectCreatableProps['components'];
81
+ /**
82
+ * Custom method to filter whether an option should be displayed in the menu
83
+ * <br>
84
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
85
+ */
86
+ filterOption?: ReactSelectCreatableProps['filterOption'];
87
+ /**
88
+ * The id of the search input
89
+ * <br>
90
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
91
+ */
92
+ id?: ReactSelectCreatableProps['inputId'];
93
+ /**
94
+ * The value of the search input
95
+ * <br>
96
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
97
+ */
98
+ inputValue?: ReactSelectCreatableProps['inputValue'];
99
+ /**
100
+ * The id to set on the SelectContainer component
101
+ * <br>
102
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
103
+ */
104
+ containerId?: ReactSelectCreatableProps['id'];
105
+ /**
106
+ * Is the select value clearable
107
+ * <br>
108
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
109
+ */
110
+ isClearable?: ReactSelectCreatableProps['isClearable'];
111
+ /**
112
+ * Is the select disabled
113
+ * <br>
114
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
115
+ */
116
+ isDisabled?: ReactSelectCreatableProps['isDisabled'];
117
+ /**
118
+ * Override the built-in logic to detect whether an option is disabled
119
+ * <br>
120
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
121
+ */
122
+ isOptionDisabled?: ReactSelectCreatableProps['isOptionDisabled'];
123
+ /**
124
+ * Support multiple selected options
125
+ * <br>
126
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
127
+ */
128
+ isMulti?: ReactSelectCreatableProps['isMulti'];
129
+ /**
130
+ * Whether to enable search functionality
131
+ * <br>
132
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
133
+ */
134
+ isSearchable?: ReactSelectCreatableProps['isSearchable'];
135
+ /**
136
+ * Maximum height of the menu before scrolling
137
+ * <br>
138
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
139
+ */
140
+ maxMenuHeight?: ReactSelectCreatableProps['maxMenuHeight'];
141
+ /**
142
+ * Dom element to portal the select menu to
143
+ * <br>
144
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
145
+ */
146
+ menuPortalTarget?: ReactSelectCreatableProps['menuPortalTarget'];
147
+ /**
148
+ * z-index value for the menu portal
149
+ * <br>
150
+ * Use in conjunction with `menuPortalTarget`
151
+ */
152
+ menuPortalZIndex?: number;
153
+ /**
154
+ * whether the menu should block scroll while open
155
+ * <br>
156
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
157
+ */
158
+ menuShouldBlockScroll?: ReactSelectCreatableProps['menuShouldBlockScroll'];
159
+ /**
160
+ * Whether the menu should close after a value is selected. Defaults to `true`.
161
+ * <br>
162
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
163
+ */
164
+ closeMenuOnSelect?: ReactSelectCreatableProps['closeMenuOnSelect'];
165
+ /**
166
+ * Name of the HTML Input (optional - without this, no input will be rendered)
167
+ * <br>
168
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
169
+ */
170
+ name?: ReactSelectCreatableProps['name'];
171
+ /**
172
+ * 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.
173
+ * <br>
174
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
175
+ */
176
+ noOptionsMessage?: ReactSelectCreatableProps['noOptionsMessage'];
177
+ /**
178
+ * Handle blur events on the control
179
+ */
180
+ onBlur?: (event: TCustomEvent) => void;
181
+ /**
182
+ * 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`.
183
+ */
184
+ onChange?: (event: TCustomEvent, info: ActionMeta<unknown>) => void;
185
+ /**
186
+ * Handle focus events on the control
187
+ * <br>
188
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
189
+ */
190
+ onFocus?: ReactSelectCreatableProps['onFocus'];
191
+ /**
192
+ * Handle change events on the input
193
+ * <br>
194
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
195
+ */
196
+ onInputChange?: ReactSelectCreatableProps['onInputChange'];
197
+ /**
198
+ * Array of options that populate the select menu
199
+ */
200
+ options?: TOptions;
201
+ /**
202
+ * Determines if option groups will be separated by a divider
203
+ */
204
+ showOptionGroupDivider?: boolean;
205
+ /**
206
+ * Placeholder text for the select value
207
+ * <br>
208
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
209
+ */
210
+ placeholder?: ReactSelectCreatableProps['placeholder'];
211
+ /**
212
+ * Use this property to reduce the paddings of the component for a ui compact variant
213
+ */
214
+ isCondensed?: boolean;
215
+ /**
216
+ * Sets the tabIndex attribute on the input
217
+ * <br>
218
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
219
+ */
220
+ tabIndex?: ReactSelectCreatableProps['tabIndex'];
221
+ /**
222
+ * Select the currently focused option when the user presses tab
223
+ * <br>
224
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
225
+ */
226
+ tabSelectsValue?: ReactSelectCreatableProps['tabSelectsValue'];
227
+ /**
228
+ * The value of the select; reflected by the selected option
229
+ * <br>
230
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
231
+ */
232
+ value?: ReactSelectCreatableProps['value'];
233
+ /**
234
+ * Allow options to be created while the isLoading prop is true. Useful to prevent the "create new ..." option being displayed while async results are still being loaded.
235
+ * <br>
236
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
237
+ */
238
+ allowCreateWhileLoading?: ReactSelectCreatableProps['allowCreateWhileLoading'];
239
+ /**
240
+ * Gets the label for the "create new ..." option in the menu. Is given the current input value.
241
+ * <br>
242
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
243
+ */
244
+ formatCreateLabel?: ReactSelectCreatableProps['formatCreateLabel'];
245
+ /**
246
+ * Determines whether the "create new ..." option should be displayed based on the current input value, select value and options array.
247
+ * <br>
248
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
249
+ */
250
+ isValidNewOption?: ReactSelectCreatableProps['isValidNewOption'];
251
+ /**
252
+ * Returns the data for the new option when it is created. Used to display the value, and is passed to onChange.
253
+ * <br>
254
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
255
+ */
256
+ getNewOptionData?: ReactSelectCreatableProps['getNewOptionData'];
257
+ /**
258
+ * If provided, this will be called with the input value when a new option is created, and onChange will not be called. Use this when you need more control over what happens when new options are created.
259
+ * <br>
260
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
261
+ */
262
+ onCreateOption?: ReactSelectCreatableProps['onCreateOption'];
263
+ /**
264
+ * Sets the position of the createOption element in your options list.
265
+ * <br>
266
+ * [Props from React select was used](https://react-select.com/props#creatable-props)
267
+ */
268
+ createOptionPosition?: ReactSelectCreatableProps['createOptionPosition'];
269
+ };
270
+ declare const CreatableSelectInput: {
271
+ ({ value, isSearchable, menuPortalZIndex, ...props }: TCreatableSelectInputProps): 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: <Option_8, IsMulti_8 extends boolean, Group_8 extends GroupBase<Option_8>>({ innerProps, isRtl, size, ...restProps }: import("react-select").LoadingIndicatorProps<Option_8, IsMulti_8, Group_8>) => import("@emotion/react").jsx.JSX.Element;
298
+ 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;
299
+ 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;
300
+ 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;
301
+ MenuPortal: ComponentType<CommonPropsAndClassName<unknown, false, GroupBase<unknown>> & {
302
+ appendTo: HTMLElement | undefined;
303
+ children: ReactNode;
304
+ controlElement: HTMLDivElement | null;
305
+ innerProps: JSX.IntrinsicElements["div"];
306
+ menuPlacement: MenuPlacement;
307
+ menuPosition: MenuPosition;
308
+ }>;
309
+ 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;
310
+ 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;
311
+ 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;
312
+ MultiValueRemove: {
313
+ (props: import("@commercetools-uikit/select-utils").TTagRemoveProps): import("@emotion/react/jsx-runtime").JSX.Element;
314
+ displayName: string;
315
+ };
316
+ 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;
317
+ 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;
318
+ 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;
319
+ 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;
320
+ 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;
321
+ 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;
322
+ };
323
+ export default CreatableSelectInput;
@@ -0,0 +1 @@
1
+ export type { TCreatableSelectInputProps } from "./creatable-select-input.js";
@@ -0,0 +1,3 @@
1
+ export { default } from "./creatable-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,54 @@
1
+ {
2
+ "name": "@commercetools-uikit/creatable-select-input",
3
+ "description": "An input component getting a selection from the user, and where options can also be created by the user.",
4
+ "version": "0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
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/creatable-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-creatable-select-input.cjs.js",
25
+ "module": "dist/commercetools-uikit-creatable-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-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
33
+ "@commercetools-uikit/design-system": "0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
34
+ "@commercetools-uikit/icons": "0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
35
+ "@commercetools-uikit/select-utils": "0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
36
+ "@commercetools-uikit/spacings": "0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
37
+ "@commercetools-uikit/text": "0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
38
+ "@commercetools-uikit/utils": "0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637",
39
+ "@emotion/react": "^11.10.5",
40
+ "@emotion/styled": "^11.10.5",
41
+ "lodash": "4.17.23",
42
+ "react-select": "5.10.2"
43
+ },
44
+ "devDependencies": {
45
+ "react": "19.2.0",
46
+ "react-dom": "19.2.0",
47
+ "react-intl": "^7.1.4"
48
+ },
49
+ "peerDependencies": {
50
+ "react": "19.x",
51
+ "react-dom": "19.x",
52
+ "react-intl": "7.x"
53
+ }
54
+ }