@commercetools-uikit/creatable-select-input 0.0.0-canary-20230127130607 → 0.0.0-canary-20230130113601

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.
@@ -19,6 +19,7 @@ var CreatableSelect = require('react-select/creatable');
19
19
  var Constraints = require('@commercetools-uikit/constraints');
20
20
  var utils = require('@commercetools-uikit/utils');
21
21
  var selectUtils = require('@commercetools-uikit/select-utils');
22
+ var designSystem = require('@commercetools-uikit/design-system');
22
23
  var jsxRuntime = require('@emotion/react/jsx-runtime');
23
24
 
24
25
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -61,6 +62,9 @@ var defaultProps = {
61
62
  var CreatableSelectInput = function CreatableSelectInput(props) {
62
63
  var intl = reactIntl.useIntl();
63
64
 
65
+ var _useTheme = designSystem.useTheme(),
66
+ isNewTheme = _useTheme.isNewTheme;
67
+
64
68
  if (!props.isReadOnly) {
65
69
  process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'CreatableSelectInput: `onChange` is required when input is not read only.') : void 0;
66
70
  }
@@ -93,7 +97,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
93
97
  isReadOnly: props.isReadOnly,
94
98
  iconLeft: props.iconLeft,
95
99
  isMulti: props.isMulti,
96
- hasValue: !isEmpty__default["default"](props.value)
100
+ hasValue: !isEmpty__default["default"](props.value),
101
+ isNewTheme: isNewTheme
97
102
  }),
98
103
  filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
99
104
  // but we use "id" (for the input) and "containerId" (for the container)
@@ -19,6 +19,7 @@ var CreatableSelect = require('react-select/creatable');
19
19
  var Constraints = require('@commercetools-uikit/constraints');
20
20
  var utils = require('@commercetools-uikit/utils');
21
21
  var selectUtils = require('@commercetools-uikit/select-utils');
22
+ var designSystem = require('@commercetools-uikit/design-system');
22
23
  var jsxRuntime = require('@emotion/react/jsx-runtime');
23
24
 
24
25
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -60,6 +61,9 @@ var defaultProps = {
60
61
  var CreatableSelectInput = function CreatableSelectInput(props) {
61
62
  var intl = reactIntl.useIntl();
62
63
 
64
+ var _useTheme = designSystem.useTheme(),
65
+ isNewTheme = _useTheme.isNewTheme;
66
+
63
67
  if (!props.isReadOnly) ;
64
68
 
65
69
  var placeholder = props.placeholder || intl.formatMessage(selectUtils.messages.placeholder);
@@ -90,7 +94,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
90
94
  isReadOnly: props.isReadOnly,
91
95
  iconLeft: props.iconLeft,
92
96
  isMulti: props.isMulti,
93
- hasValue: !isEmpty__default["default"](props.value)
97
+ hasValue: !isEmpty__default["default"](props.value),
98
+ isNewTheme: isNewTheme
94
99
  }),
95
100
  filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
96
101
  // but we use "id" (for the input) and "containerId" (for the container)
@@ -15,6 +15,7 @@ import CreatableSelect from 'react-select/creatable';
15
15
  import Constraints from '@commercetools-uikit/constraints';
16
16
  import { warning, filterDataAttributes } from '@commercetools-uikit/utils';
17
17
  import { messages, customComponentsWithIcons, createSelectStyles, DropdownIndicator, ClearIndicator, TagRemove } from '@commercetools-uikit/select-utils';
18
+ import { useTheme } from '@commercetools-uikit/design-system';
18
19
  import { jsx } from '@emotion/react/jsx-runtime';
19
20
 
20
21
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -42,6 +43,9 @@ var defaultProps = {
42
43
  var CreatableSelectInput = function CreatableSelectInput(props) {
43
44
  var intl = useIntl();
44
45
 
46
+ var _useTheme = useTheme(),
47
+ isNewTheme = _useTheme.isNewTheme;
48
+
45
49
  if (!props.isReadOnly) {
46
50
  process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'CreatableSelectInput: `onChange` is required when input is not read only.') : void 0;
47
51
  }
@@ -74,7 +78,8 @@ var CreatableSelectInput = function CreatableSelectInput(props) {
74
78
  isReadOnly: props.isReadOnly,
75
79
  iconLeft: props.iconLeft,
76
80
  isMulti: props.isMulti,
77
- hasValue: !isEmpty(props.value)
81
+ hasValue: !isEmpty(props.value),
82
+ isNewTheme: isNewTheme
78
83
  }),
79
84
  filterOption: props.filterOption // react-select uses "id" (for the container) and "inputId" (for the input),
80
85
  // but we use "id" (for the input) and "containerId" (for the container)
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": "0.0.0-canary-20230127130607",
4
+ "version": "0.0.0-canary-20230130113601",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,13 +29,13 @@
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.19.0",
31
31
  "@babel/runtime-corejs3": "^7.19.1",
32
- "@commercetools-uikit/constraints": "0.0.0-canary-20230127130607",
33
- "@commercetools-uikit/design-system": "0.0.0-canary-20230127130607",
34
- "@commercetools-uikit/icons": "0.0.0-canary-20230127130607",
35
- "@commercetools-uikit/select-utils": "0.0.0-canary-20230127130607",
36
- "@commercetools-uikit/spacings": "0.0.0-canary-20230127130607",
37
- "@commercetools-uikit/text": "0.0.0-canary-20230127130607",
38
- "@commercetools-uikit/utils": "0.0.0-canary-20230127130607",
32
+ "@commercetools-uikit/constraints": "0.0.0-canary-20230130113601",
33
+ "@commercetools-uikit/design-system": "0.0.0-canary-20230130113601",
34
+ "@commercetools-uikit/icons": "0.0.0-canary-20230130113601",
35
+ "@commercetools-uikit/select-utils": "0.0.0-canary-20230130113601",
36
+ "@commercetools-uikit/spacings": "0.0.0-canary-20230130113601",
37
+ "@commercetools-uikit/text": "0.0.0-canary-20230130113601",
38
+ "@commercetools-uikit/utils": "0.0.0-canary-20230130113601",
39
39
  "@emotion/react": "^11.4.0",
40
40
  "@emotion/styled": "^11.3.0",
41
41
  "lodash": "4.17.21",