@commercetools-uikit/selectable-search-input 15.13.0 → 15.13.2
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/dist/commercetools-uikit-selectable-search-input.cjs.dev.js +27 -25
- package/dist/commercetools-uikit-selectable-search-input.cjs.prod.js +24 -22
- package/dist/commercetools-uikit-selectable-search-input.esm.js +27 -25
- package/dist/declarations/src/selectable-search-input.styles.d.ts +1 -1
- package/package.json +9 -9
|
@@ -59,14 +59,6 @@ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
59
59
|
var getInputContainerBorderColor = function getInputContainerBorderColor(props) {
|
|
60
60
|
var defaultColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : designSystem.designTokens.borderColorForInput;
|
|
61
61
|
|
|
62
|
-
if (props.hasError) {
|
|
63
|
-
return designSystem.designTokens.borderColorForInputWhenError;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (props.hasWarning) {
|
|
67
|
-
return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
62
|
if (props.isDisabled) {
|
|
71
63
|
return designSystem.designTokens.borderColorForInputWhenDisabled;
|
|
72
64
|
}
|
|
@@ -75,18 +67,18 @@ var getInputContainerBorderColor = function getInputContainerBorderColor(props)
|
|
|
75
67
|
return designSystem.designTokens.borderColorForInputWhenReadonly;
|
|
76
68
|
}
|
|
77
69
|
|
|
78
|
-
return defaultColor;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
var getInputFontColor = function getInputFontColor(props) {
|
|
82
70
|
if (props.hasError) {
|
|
83
|
-
return designSystem.designTokens.
|
|
71
|
+
return designSystem.designTokens.borderColorForInputWhenError;
|
|
84
72
|
}
|
|
85
73
|
|
|
86
74
|
if (props.hasWarning) {
|
|
87
|
-
return designSystem.designTokens.
|
|
75
|
+
return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
88
76
|
}
|
|
89
77
|
|
|
78
|
+
return defaultColor;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var getInputFontColor = function getInputFontColor(props) {
|
|
90
82
|
if (props.isDisabled) {
|
|
91
83
|
return designSystem.designTokens.fontColorForInputWhenDisabled;
|
|
92
84
|
}
|
|
@@ -95,6 +87,14 @@ var getInputFontColor = function getInputFontColor(props) {
|
|
|
95
87
|
return designSystem.designTokens.fontColorForInputWhenReadonly;
|
|
96
88
|
}
|
|
97
89
|
|
|
90
|
+
if (props.hasError) {
|
|
91
|
+
return designSystem.designTokens.fontColorForInputWhenError;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (props.hasWarning) {
|
|
95
|
+
return designSystem.designTokens.fontColorForInputWhenWarning;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
98
|
return designSystem.designTokens.fontColorForInput;
|
|
99
99
|
};
|
|
100
100
|
|
|
@@ -111,7 +111,7 @@ var getInputBoxShadow = function getInputBoxShadow(props) {
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
var getSelectableSearchInputStyles = function getSelectableSearchInputStyles(props) {
|
|
114
|
-
return [inputUtils.getInputStyles(props), /*#__PURE__*/react.css("border:none;background:none;&,&:focus{box-shadow:none;}&:focus,&:hover{background-color:transparent!important;}width:100%;color:", getInputFontColor(props), ";" + ("" ), "" )];
|
|
114
|
+
return [inputUtils.getInputStyles(props), /*#__PURE__*/react.css("border:none;box-shadow:none;background:none;&,&:focus,&:focus:not(:read-only){box-shadow:none;}&:focus,&:hover{background-color:transparent!important;}width:100%;color:", getInputFontColor(props), ";" + ("" ), "" )];
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
var getButtonStyles = function getButtonStyles() {
|
|
@@ -135,7 +135,7 @@ var getClearIconButtonStyles = function getClearIconButtonStyles(props) {
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
var getSearchIconButtonStyles = function getSearchIconButtonStyles(props) {
|
|
138
|
-
return [getButtonStyles(), /*#__PURE__*/react.css("margin-right:", designSystem.designTokens.marginRightForSearchInputIcon, ";fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIcon), ";&:hover{fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIconWhenHovered), ";}" + ("" ), "" )];
|
|
138
|
+
return [getButtonStyles(), /*#__PURE__*/react.css("margin-right:", designSystem.designTokens.marginRightForSearchInputIcon, ";fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIcon), ";cursor:", props.isReadOnly ? 'default' : 'pointer', ";&:hover{fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIconWhenHovered), ";}" + ("" ), "" )];
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
var getBackgroundColor = function getBackgroundColor(props, defaultColor) {
|
|
@@ -151,7 +151,7 @@ var getBackgroundColor = function getBackgroundColor(props, defaultColor) {
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
var getSelectableSearchInputContainerStyles = function getSelectableSearchInputContainerStyles(props) {
|
|
154
|
-
return [/*#__PURE__*/react.css("display:flex;align-items:center;background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInput), ";border:1px solid ", getInputContainerBorderColor(props), ";border-radius:", designSystem.designTokens.borderRadiusForInput, ";box-shadow:", getInputBoxShadow(props), ";height:", designSystem.designTokens.heightForInput, ";box-sizing:border-box;border-top-left-radius:0;border-bottom-left-radius:0;margin-left:0;width:100%;transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ";&::placeholder{color:", designSystem.designTokens.placeholderFontColorForInput, ";}&:hover{border-color:", getInputContainerBorderColor(props, designSystem.designTokens.borderColorForInputWhenHovered), ";background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInputWhenHovered), ";}&:focus
|
|
154
|
+
return [/*#__PURE__*/react.css("display:flex;align-items:center;background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInput), ";border:1px solid ", getInputContainerBorderColor(props), ";border-radius:", designSystem.designTokens.borderRadiusForInput, ";box-shadow:", getInputBoxShadow(props), ";height:", designSystem.designTokens.heightForInput, ";box-sizing:border-box;border-top-left-radius:0;border-bottom-left-radius:0;margin-left:0;width:100%;transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ";&::placeholder{color:", designSystem.designTokens.placeholderFontColorForInput, ";}&:hover{border-color:", getInputContainerBorderColor(props, designSystem.designTokens.borderColorForInputWhenHovered), ";background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInputWhenHovered), ";}&:focus{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), !props.isDisabled && !props.isReadOnly && /*#__PURE__*/react.css("&:focus-within{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";box-shadow:", designSystem.designTokens.boxShadowForDatetimeInputWhenHovered, " ", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" )];
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
var createSelectableSelectStyles = function createSelectableSelectStyles(_ref) {
|
|
@@ -167,7 +167,9 @@ var createSelectableSelectStyles = function createSelectableSelectStyles(_ref) {
|
|
|
167
167
|
hasWarning: hasWarning,
|
|
168
168
|
hasError: hasError,
|
|
169
169
|
menuPortalZIndex: menuPortalZIndex,
|
|
170
|
-
isNewTheme: isNewTheme
|
|
170
|
+
isNewTheme: isNewTheme,
|
|
171
|
+
isDisabled: isDisabled,
|
|
172
|
+
isReadOnly: isReadOnly
|
|
171
173
|
});
|
|
172
174
|
return _objectSpread$2(_objectSpread$2({}, selectStyles), {}, {
|
|
173
175
|
control: function control(base, state) {
|
|
@@ -178,9 +180,10 @@ var createSelectableSelectStyles = function createSelectableSelectStyles(_ref) {
|
|
|
178
180
|
borderRight: '0',
|
|
179
181
|
height: '100%',
|
|
180
182
|
borderColor: function () {
|
|
183
|
+
if (isDisabled) return "".concat(designSystem.designTokens.borderColorForInputWhenDisabled, " !important");
|
|
184
|
+
if (isReadOnly) return "".concat(designSystem.designTokens.borderColorForInputWhenReadonly, " !important");
|
|
181
185
|
if (hasError) return designSystem.designTokens.borderColorForInputWhenError;
|
|
182
186
|
if (hasWarning) return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
183
|
-
if (isDisabled) return "".concat(designSystem.designTokens.borderColorForInputWhenDisabled, " !important");
|
|
184
187
|
|
|
185
188
|
if (textInputHasFocus && !isNewTheme) {
|
|
186
189
|
return designSystem.designTokens.borderColorForInputWhenFocused;
|
|
@@ -190,7 +193,6 @@ var createSelectableSelectStyles = function createSelectableSelectStyles(_ref) {
|
|
|
190
193
|
return designSystem.designTokens.borderColorForInputWhenFocused;
|
|
191
194
|
}
|
|
192
195
|
|
|
193
|
-
if (isReadOnly) return "".concat(designSystem.designTokens.borderColorForInputWhenReadonly, " !important");
|
|
194
196
|
return designSystem.designTokens.borderColorForInput;
|
|
195
197
|
}(),
|
|
196
198
|
cursor: function () {
|
|
@@ -511,7 +513,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
|
|
|
511
513
|
selectedOption: selectedOption
|
|
512
514
|
}))
|
|
513
515
|
}), jsxRuntime.jsxs("div", {
|
|
514
|
-
css: [getSelectableSearchInputContainerStyles(props), dropdownHasFocus && isNewTheme && /*#__PURE__*/react.css("border-left-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";&:hover{border-left-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), "" , "" ],
|
|
516
|
+
css: [getSelectableSearchInputContainerStyles(props), dropdownHasFocus && isNewTheme && !props.isReadOnly && /*#__PURE__*/react.css("border-left-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";&:hover{border-left-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), "" , "" ],
|
|
515
517
|
children: [jsxRuntime.jsx("input", _objectSpread(_objectSpread({
|
|
516
518
|
ref: textInputRef,
|
|
517
519
|
id: SelectableSearchInput.getTextInputId(selectablSearchInputId),
|
|
@@ -573,7 +575,7 @@ SelectableSearchInput.getDropdownId = getDropdownName;
|
|
|
573
575
|
var SelectableSearchInput$1 = SelectableSearchInput;
|
|
574
576
|
|
|
575
577
|
// NOTE: This string will be replaced on build time with the package version.
|
|
576
|
-
var version = "15.13.
|
|
578
|
+
var version = "15.13.2";
|
|
577
579
|
|
|
578
580
|
exports["default"] = SelectableSearchInput$1;
|
|
579
581
|
exports.version = version;
|