carbon-react 110.4.1 → 110.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,6 +30,10 @@ const Search = ({
|
|
|
30
30
|
"aria-label": ariaLabel = "search",
|
|
31
31
|
inputRef,
|
|
32
32
|
tabIndex,
|
|
33
|
+
error,
|
|
34
|
+
warning,
|
|
35
|
+
info,
|
|
36
|
+
tooltipPosition,
|
|
33
37
|
...rest
|
|
34
38
|
}) => {
|
|
35
39
|
const isControlled = value !== undefined;
|
|
@@ -159,7 +163,11 @@ const Search = ({
|
|
|
159
163
|
onChange: handleChange,
|
|
160
164
|
onKeyDown: handleKeyDown,
|
|
161
165
|
inputRef: assignInput,
|
|
162
|
-
tabIndex: tabIndex
|
|
166
|
+
tabIndex: tabIndex,
|
|
167
|
+
error: error,
|
|
168
|
+
warning: warning,
|
|
169
|
+
info: info,
|
|
170
|
+
tooltipPosition: tooltipPosition
|
|
163
171
|
}), searchButton && /*#__PURE__*/React.createElement(StyledSearchButton, null, Boolean(isFocused || (!isControlled ? searchValue.length : value.length)) && /*#__PURE__*/React.createElement(Button, _extends({
|
|
164
172
|
tabIndex: iconTabIndex,
|
|
165
173
|
size: "medium",
|
|
@@ -238,6 +246,24 @@ Search.propTypes = {
|
|
|
238
246
|
}),
|
|
239
247
|
|
|
240
248
|
/** Input tabindex */
|
|
241
|
-
tabIndex: PropTypes.number
|
|
249
|
+
tabIndex: PropTypes.number,
|
|
250
|
+
|
|
251
|
+
/** Indicate that error has occurred
|
|
252
|
+
Pass string to display icon, tooltip and red border
|
|
253
|
+
Pass true boolean to only display red border */
|
|
254
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
255
|
+
|
|
256
|
+
/** Indicate that warning has occurred
|
|
257
|
+
Pass string to display icon, tooltip and orange border
|
|
258
|
+
Pass true boolean to only display orange border */
|
|
259
|
+
warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
260
|
+
|
|
261
|
+
/** Indicate additional information
|
|
262
|
+
Pass string to display icon, tooltip and blue border
|
|
263
|
+
Pass true boolean to only display blue border */
|
|
264
|
+
info: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
265
|
+
|
|
266
|
+
/** Overrides the default tooltip position */
|
|
267
|
+
tooltipPosition: PropTypes.oneOf(["top", "bottom", "left", "right"])
|
|
242
268
|
};
|
|
243
269
|
export default Search;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
3
|
|
|
4
|
-
export interface SearchProps extends MarginProps {
|
|
4
|
+
export interface SearchProps extends ValidationProps, MarginProps {
|
|
5
5
|
/** Prop to specify the aria-label of the search component */
|
|
6
6
|
"aria-label"?: string;
|
|
7
7
|
/** Prop for `uncontrolled` use */
|
|
@@ -42,6 +42,8 @@ export interface SearchProps extends MarginProps {
|
|
|
42
42
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
43
43
|
/** Input tabindex */
|
|
44
44
|
tabIndex?: number;
|
|
45
|
+
/** Overrides the default tooltip position */
|
|
46
|
+
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
declare function Search(props: SearchProps): JSX.Element;
|
|
@@ -53,6 +53,10 @@ const Search = ({
|
|
|
53
53
|
"aria-label": ariaLabel = "search",
|
|
54
54
|
inputRef,
|
|
55
55
|
tabIndex,
|
|
56
|
+
error,
|
|
57
|
+
warning,
|
|
58
|
+
info,
|
|
59
|
+
tooltipPosition,
|
|
56
60
|
...rest
|
|
57
61
|
}) => {
|
|
58
62
|
const isControlled = value !== undefined;
|
|
@@ -182,7 +186,11 @@ const Search = ({
|
|
|
182
186
|
onChange: handleChange,
|
|
183
187
|
onKeyDown: handleKeyDown,
|
|
184
188
|
inputRef: assignInput,
|
|
185
|
-
tabIndex: tabIndex
|
|
189
|
+
tabIndex: tabIndex,
|
|
190
|
+
error: error,
|
|
191
|
+
warning: warning,
|
|
192
|
+
info: info,
|
|
193
|
+
tooltipPosition: tooltipPosition
|
|
186
194
|
}), searchButton && /*#__PURE__*/_react.default.createElement(_search.StyledSearchButton, null, Boolean(isFocused || (!isControlled ? searchValue.length : value.length)) && /*#__PURE__*/_react.default.createElement(_button.default, _extends({
|
|
187
195
|
tabIndex: iconTabIndex,
|
|
188
196
|
size: "medium",
|
|
@@ -261,7 +269,25 @@ Search.propTypes = {
|
|
|
261
269
|
}),
|
|
262
270
|
|
|
263
271
|
/** Input tabindex */
|
|
264
|
-
tabIndex: _propTypes.default.number
|
|
272
|
+
tabIndex: _propTypes.default.number,
|
|
273
|
+
|
|
274
|
+
/** Indicate that error has occurred
|
|
275
|
+
Pass string to display icon, tooltip and red border
|
|
276
|
+
Pass true boolean to only display red border */
|
|
277
|
+
error: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
|
|
278
|
+
|
|
279
|
+
/** Indicate that warning has occurred
|
|
280
|
+
Pass string to display icon, tooltip and orange border
|
|
281
|
+
Pass true boolean to only display orange border */
|
|
282
|
+
warning: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
|
|
283
|
+
|
|
284
|
+
/** Indicate additional information
|
|
285
|
+
Pass string to display icon, tooltip and blue border
|
|
286
|
+
Pass true boolean to only display blue border */
|
|
287
|
+
info: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
|
|
288
|
+
|
|
289
|
+
/** Overrides the default tooltip position */
|
|
290
|
+
tooltipPosition: _propTypes.default.oneOf(["top", "bottom", "left", "right"])
|
|
265
291
|
};
|
|
266
292
|
var _default = Search;
|
|
267
293
|
exports.default = _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
3
|
|
|
4
|
-
export interface SearchProps extends MarginProps {
|
|
4
|
+
export interface SearchProps extends ValidationProps, MarginProps {
|
|
5
5
|
/** Prop to specify the aria-label of the search component */
|
|
6
6
|
"aria-label"?: string;
|
|
7
7
|
/** Prop for `uncontrolled` use */
|
|
@@ -42,6 +42,8 @@ export interface SearchProps extends MarginProps {
|
|
|
42
42
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
43
43
|
/** Input tabindex */
|
|
44
44
|
tabIndex?: number;
|
|
45
|
+
/** Overrides the default tooltip position */
|
|
46
|
+
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
declare function Search(props: SearchProps): JSX.Element;
|