carbon-react 111.12.7 → 111.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/esm/__internal__/input/input-presentation.component.d.ts +6 -1
  2. package/esm/__internal__/input/input-presentation.component.js +4 -1
  3. package/esm/__internal__/input/input-presentation.style.d.ts +1 -1
  4. package/esm/__internal__/input/input-presentation.style.js +3 -0
  5. package/esm/components/decimal/decimal.component.js +1 -0
  6. package/esm/components/grouped-character/grouped-character.component.js +1 -0
  7. package/esm/components/pager/pager.style.js +5 -0
  8. package/esm/components/search/search.component.d.ts +6 -1
  9. package/esm/components/search/search.component.js +3 -0
  10. package/esm/components/search/search.style.d.ts +1 -0
  11. package/esm/components/search/search.style.js +2 -0
  12. package/esm/components/select/select-textbox/select-textbox.component.js +6 -0
  13. package/esm/components/textarea/textarea.component.d.ts +6 -1
  14. package/esm/components/textarea/textarea.component.js +3 -0
  15. package/esm/components/textbox/textbox.component.d.ts +6 -1
  16. package/esm/components/textbox/textbox.component.js +3 -0
  17. package/lib/__internal__/input/input-presentation.component.d.ts +6 -1
  18. package/lib/__internal__/input/input-presentation.component.js +4 -1
  19. package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
  20. package/lib/__internal__/input/input-presentation.style.js +3 -0
  21. package/lib/components/decimal/decimal.component.js +1 -0
  22. package/lib/components/grouped-character/grouped-character.component.js +1 -0
  23. package/lib/components/pager/pager.style.js +6 -0
  24. package/lib/components/search/search.component.d.ts +6 -1
  25. package/lib/components/search/search.component.js +3 -0
  26. package/lib/components/search/search.style.d.ts +1 -0
  27. package/lib/components/search/search.style.js +2 -0
  28. package/lib/components/select/select-textbox/select-textbox.component.js +6 -0
  29. package/lib/components/textarea/textarea.component.d.ts +6 -1
  30. package/lib/components/textarea/textarea.component.js +3 -0
  31. package/lib/components/textbox/textbox.component.d.ts +6 -1
  32. package/lib/components/textbox/textbox.component.js +3 -0
  33. package/package.json +1 -1
@@ -9,6 +9,11 @@ export interface CommonInputPresentationProps extends ValidationProps {
9
9
  align?: string;
10
10
  /** The width of the input as a percentage */
11
11
  inputWidth?: number;
12
+ /**
13
+ * Prop for specifying the max-width of the input.
14
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
15
+ */
16
+ maxWidth?: string;
12
17
  /** If true, the component will be read-only */
13
18
  readOnly?: boolean;
14
19
  /** Size of an input */
@@ -20,5 +25,5 @@ export interface InputPresentationProps extends CommonInputPresentationProps {
20
25
  /** Content to be rendered before the input */
21
26
  positionedChildren?: React.ReactNode;
22
27
  }
23
- declare const InputPresentation: ({ children, positionedChildren, inputWidth, align, disabled, readOnly, size, error, warning, info, hasIcon, }: InputPresentationProps) => JSX.Element;
28
+ declare const InputPresentation: ({ children, positionedChildren, inputWidth, maxWidth, align, disabled, readOnly, size, error, warning, info, hasIcon, }: InputPresentationProps) => JSX.Element;
24
29
  export default InputPresentation;
@@ -8,6 +8,7 @@ const InputPresentation = ({
8
8
  children,
9
9
  positionedChildren,
10
10
  inputWidth,
11
+ maxWidth,
11
12
  align,
12
13
  disabled,
13
14
  readOnly,
@@ -42,7 +43,8 @@ const InputPresentation = ({
42
43
  };
43
44
 
44
45
  return /*#__PURE__*/React.createElement(StyledInputPresentationContainer, {
45
- inputWidth: inputWidth
46
+ inputWidth: inputWidth,
47
+ maxWidth: maxWidth
46
48
  }, positionedChildren, /*#__PURE__*/React.createElement(InputPresentationStyle, {
47
49
  hasFocus: hasFocus,
48
50
  role: "presentation",
@@ -69,6 +71,7 @@ InputPresentation.propTypes = {
69
71
  "hasIcon": PropTypes.bool,
70
72
  "info": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
71
73
  "inputWidth": PropTypes.number,
74
+ "maxWidth": PropTypes.string,
72
75
  "positionedChildren": PropTypes.node,
73
76
  "readOnly": PropTypes.bool,
74
77
  "size": PropTypes.oneOf(["large", "medium", "small"]),
@@ -1,6 +1,6 @@
1
1
  import { CommonInputPresentationProps } from "./input-presentation.component";
2
2
  import { InputContextProps } from "../input-behaviour";
3
3
  import { CarbonProviderProps } from "../../components/carbon-provider";
4
- export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "inputWidth">, never>;
4
+ export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "maxWidth" | "inputWidth">, never>;
5
5
  declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "align" | "readOnly" | "size" | "hasIcon"> & Pick<CarbonProviderProps, "validationRedesignOptIn">, never>;
6
6
  export default InputPresentationStyle;
@@ -7,6 +7,9 @@ export const StyledInputPresentationContainer = styled.div`
7
7
  }) => inputWidth}%;
8
8
  display: flex;
9
9
  position: relative;
10
+ max-width: ${({
11
+ maxWidth
12
+ }) => maxWidth ? `${maxWidth}` : "100%"};
10
13
  `;
11
14
 
12
15
  function stylingForValidations({
@@ -418,6 +418,7 @@ Decimal.propTypes = {
418
418
  }), PropTypes.string]),
419
419
  "max": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
420
420
  "maxLength": PropTypes.number,
421
+ "maxWidth": PropTypes.string,
421
422
  "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
422
423
  "__@toStringTag": PropTypes.string.isRequired,
423
424
  "description": PropTypes.string,
@@ -337,6 +337,7 @@ GroupedCharacter.propTypes = {
337
337
  }), PropTypes.string]),
338
338
  "max": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
339
339
  "maxLength": PropTypes.number,
340
+ "maxWidth": PropTypes.string,
340
341
  "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
341
342
  "__@toStringTag": PropTypes.string.isRequired,
342
343
  "description": PropTypes.string,
@@ -1,6 +1,7 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import StyledInput from "../../__internal__/input/input.style";
3
3
  import StyledInputPresentation from "../../__internal__/input/input-presentation.style";
4
+ import StyledFormField from "../../__internal__/form-field/form-field.style";
4
5
  import InputIconToggleStyle from "../../__internal__/input-icon-toggle/input-icon-toggle.style";
5
6
  import StyledSelectText from "../select/__internal__/select-text/select-text.style";
6
7
  import Link from "../link";
@@ -88,6 +89,10 @@ const StyledPagerNavInner = styled.div`
88
89
  display: flex;
89
90
  align-items: center;
90
91
  padding: 0 12px;
92
+
93
+ & ${StyledFormField} {
94
+ margin-bottom: 0;
95
+ }
91
96
  `;
92
97
  const StyledPagerLinkStyles = styled(Link)`
93
98
  padding: 0 10px;
@@ -40,6 +40,11 @@ export interface SearchProps extends ValidationProps, MarginProps {
40
40
  * Leaving the `searchWidth` prop with no value will default the width to '100%'
41
41
  */
42
42
  searchWidth?: string;
43
+ /**
44
+ * Prop for specifying the max-width of the input.
45
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
46
+ */
47
+ maxWidth?: string;
43
48
  /** Prop for active search threshold. This must be a positive number */
44
49
  threshold?: number;
45
50
  /** Prop for `controlled` use */
@@ -51,5 +56,5 @@ export interface SearchProps extends ValidationProps, MarginProps {
51
56
  /** Overrides the default tooltip position */
52
57
  tooltipPosition?: "top" | "bottom" | "left" | "right";
53
58
  }
54
- export declare const Search: ({ defaultValue, onChange, onClick, onFocus, onBlur, onKeyDown, value, id, name, threshold, searchWidth, searchButton, placeholder, variant, "aria-label": ariaLabel, inputRef, tabIndex, error, warning, info, tooltipPosition, ...rest }: SearchProps) => JSX.Element;
59
+ export declare const Search: ({ defaultValue, onChange, onClick, onFocus, onBlur, onKeyDown, value, id, name, threshold, searchWidth, maxWidth, searchButton, placeholder, variant, "aria-label": ariaLabel, inputRef, tabIndex, error, warning, info, tooltipPosition, ...rest }: SearchProps) => JSX.Element;
55
60
  export default Search;
@@ -23,6 +23,7 @@ const Search = ({
23
23
  name,
24
24
  threshold = 3,
25
25
  searchWidth,
26
+ maxWidth,
26
27
  searchButton,
27
28
  placeholder,
28
29
  variant = "default",
@@ -142,6 +143,7 @@ const Search = ({
142
143
  return /*#__PURE__*/React.createElement(StyledSearch, _extends({
143
144
  isFocused: isFocused,
144
145
  searchWidth: searchWidth,
146
+ maxWidth: maxWidth,
145
147
  searchIsActive: searchIsActive,
146
148
  searchHasValue: !isControlled ? !!(searchValue !== null && searchValue !== void 0 && searchValue.length) : !!(value !== null && value !== void 0 && value.length),
147
149
  showSearchButton: searchButton,
@@ -273,6 +275,7 @@ Search.propTypes = {
273
275
  "toString": PropTypes.func.isRequired,
274
276
  "valueOf": PropTypes.func.isRequired
275
277
  }), PropTypes.string]),
278
+ "maxWidth": PropTypes.string,
276
279
  "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
277
280
  "__@toStringTag": PropTypes.string.isRequired,
278
281
  "description": PropTypes.string,
@@ -4,6 +4,7 @@ interface StyledSearchProps {
4
4
  searchHasValue?: boolean;
5
5
  searchIsActive?: boolean;
6
6
  searchWidth?: string;
7
+ maxWidth?: string;
7
8
  showSearchButton?: boolean;
8
9
  variant?: string;
9
10
  }
@@ -10,6 +10,7 @@ const StyledSearch = styled.div`
10
10
  ${({
11
11
  isFocused,
12
12
  searchWidth,
13
+ maxWidth,
13
14
  searchIsActive,
14
15
  searchHasValue,
15
16
  showSearchButton,
@@ -22,6 +23,7 @@ const StyledSearch = styled.div`
22
23
  return css`
23
24
  ${margin}
24
25
  width: ${searchWidth ? `${searchWidth}` : "100%"};
26
+ max-width: ${maxWidth ? `${maxWidth}` : "100%"};
25
27
  padding-bottom: 2px;
26
28
  background-color: transparent;
27
29
  border-bottom: 2px solid ${variantColor};
@@ -195,6 +195,12 @@ const formInputPropTypes = {
195
195
  /** Width of an input in percentage. Works only when labelInline is true */
196
196
  inputWidth: PropTypes.number,
197
197
 
198
+ /**
199
+ * Prop for specifying the max-width of the input.
200
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
201
+ */
202
+ maxWidth: PropTypes.string,
203
+
198
204
  /**
199
205
  * @ignore
200
206
  * @private
@@ -48,6 +48,11 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
48
48
  inputIcon?: IconType;
49
49
  /** Width of an input in percentage. Works only when labelInline is true */
50
50
  inputWidth?: number;
51
+ /**
52
+ * Prop for specifying the max width of the input.
53
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
54
+ */
55
+ maxWidth?: string;
51
56
  /** The content of the label for the input */
52
57
  label?: string;
53
58
  /** Inline label alignment */
@@ -89,6 +94,6 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
89
94
  Pass true boolean to only display orange border */
90
95
  warning?: boolean | string;
91
96
  }
92
- export declare const Textarea: ({ autoFocus, fieldHelp, label, size, children, characterLimit, enforceCharacterLimit, warnOverLimit, onChange, disabled, labelInline, labelAlign, labelHelp, labelSpacing, inputIcon, id: idProp, error, warning, info, name, readOnly, placeholder, expandable, rows, cols, validationOnLabel, adaptiveLabelBreakpoint, inputWidth, labelWidth, tooltipPosition, value, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, helpAriaLabel, ...props }: TextareaProps) => JSX.Element;
97
+ export declare const Textarea: ({ autoFocus, fieldHelp, label, size, children, characterLimit, enforceCharacterLimit, warnOverLimit, onChange, disabled, labelInline, labelAlign, labelHelp, labelSpacing, inputIcon, id: idProp, error, warning, info, name, readOnly, placeholder, expandable, rows, cols, validationOnLabel, adaptiveLabelBreakpoint, inputWidth, maxWidth, labelWidth, tooltipPosition, value, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, helpAriaLabel, ...props }: TextareaProps) => JSX.Element;
93
98
  export { Textarea as OriginalTextarea };
94
99
  export default Textarea;
@@ -47,6 +47,7 @@ const Textarea = ({
47
47
  validationOnLabel = false,
48
48
  adaptiveLabelBreakpoint,
49
49
  inputWidth,
50
+ maxWidth,
50
51
  labelWidth = 30,
51
52
  tooltipPosition,
52
53
  value,
@@ -126,6 +127,7 @@ const Textarea = ({
126
127
  disabled: disabled,
127
128
  readOnly: readOnly,
128
129
  inputWidth: typeof inputWidth === "number" ? inputWidth : 100 - labelWidth,
130
+ maxWidth: maxWidth,
129
131
  error: error,
130
132
  warning: warning,
131
133
  info: info
@@ -406,6 +408,7 @@ Textarea.propTypes = {
406
408
  }), PropTypes.string]),
407
409
  "max": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
408
410
  "maxLength": PropTypes.number,
411
+ "maxWidth": PropTypes.string,
409
412
  "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
410
413
  "__@toStringTag": PropTypes.string.isRequired,
411
414
  "description": PropTypes.string,
@@ -33,6 +33,11 @@ export interface CommonTextboxProps extends ValidationProps, MarginProps, Omit<C
33
33
  iconTabIndex?: number;
34
34
  /** The width of the input as a percentage */
35
35
  inputWidth?: number;
36
+ /**
37
+ * Prop for specifying the max width of the input.
38
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
39
+ */
40
+ maxWidth?: string;
36
41
  /** Additional child elements to display before the input */
37
42
  leftChildren?: React.ReactNode;
38
43
  /** Label content */
@@ -88,5 +93,5 @@ export interface TextboxProps extends CommonTextboxProps {
88
93
  /** Whether to display the character count message in red */
89
94
  warnOverLimit?: boolean;
90
95
  }
91
- export declare const Textbox: ({ align, autoFocus, children, disabled, inputIcon, leftChildren, labelId: externalLabelId, label, labelAlign, labelHelp, labelInline, labelSpacing, id, formattedValue, fieldHelp, error, warning, info, name, reverse, size, value, readOnly, placeholder, inputRef, onBlur, onClick, onFocus, onChange, onMouseDown, onChangeDeferred, deferTimeout, isOptional, iconOnClick, iconOnMouseDown, iconTabIndex, validationOnLabel, labelWidth, inputWidth, prefix, adaptiveLabelBreakpoint, required, positionedChildren, tooltipPosition, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, enforceCharacterLimit, characterLimit, warnOverLimit, helpAriaLabel, ...props }: TextboxProps) => JSX.Element;
96
+ export declare const Textbox: ({ align, autoFocus, children, disabled, inputIcon, leftChildren, labelId: externalLabelId, label, labelAlign, labelHelp, labelInline, labelSpacing, id, formattedValue, fieldHelp, error, warning, info, name, reverse, size, value, readOnly, placeholder, inputRef, onBlur, onClick, onFocus, onChange, onMouseDown, onChangeDeferred, deferTimeout, isOptional, iconOnClick, iconOnMouseDown, iconTabIndex, validationOnLabel, labelWidth, inputWidth, maxWidth, prefix, adaptiveLabelBreakpoint, required, positionedChildren, tooltipPosition, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, enforceCharacterLimit, characterLimit, warnOverLimit, helpAriaLabel, ...props }: TextboxProps) => JSX.Element;
92
97
  export default Textbox;
@@ -58,6 +58,7 @@ const Textbox = ({
58
58
  validationOnLabel = false,
59
59
  labelWidth = 30,
60
60
  inputWidth,
61
+ maxWidth,
61
62
  prefix,
62
63
  adaptiveLabelBreakpoint,
63
64
  required,
@@ -109,6 +110,7 @@ const Textbox = ({
109
110
  warning: warning,
110
111
  info: info,
111
112
  inputWidth: inputWidth || 100 - labelWidth,
113
+ maxWidth: maxWidth,
112
114
  positionedChildren: positionedChildren,
113
115
  hasIcon: hasIconInside
114
116
  }, leftChildren, prefix && /*#__PURE__*/React.createElement(StyledPrefix, {
@@ -406,6 +408,7 @@ Textbox.propTypes = {
406
408
  }), PropTypes.string]),
407
409
  "max": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
408
410
  "maxLength": PropTypes.number,
411
+ "maxWidth": PropTypes.string,
409
412
  "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
410
413
  "__@toStringTag": PropTypes.string.isRequired,
411
414
  "description": PropTypes.string,
@@ -9,6 +9,11 @@ export interface CommonInputPresentationProps extends ValidationProps {
9
9
  align?: string;
10
10
  /** The width of the input as a percentage */
11
11
  inputWidth?: number;
12
+ /**
13
+ * Prop for specifying the max-width of the input.
14
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
15
+ */
16
+ maxWidth?: string;
12
17
  /** If true, the component will be read-only */
13
18
  readOnly?: boolean;
14
19
  /** Size of an input */
@@ -20,5 +25,5 @@ export interface InputPresentationProps extends CommonInputPresentationProps {
20
25
  /** Content to be rendered before the input */
21
26
  positionedChildren?: React.ReactNode;
22
27
  }
23
- declare const InputPresentation: ({ children, positionedChildren, inputWidth, align, disabled, readOnly, size, error, warning, info, hasIcon, }: InputPresentationProps) => JSX.Element;
28
+ declare const InputPresentation: ({ children, positionedChildren, inputWidth, maxWidth, align, disabled, readOnly, size, error, warning, info, hasIcon, }: InputPresentationProps) => JSX.Element;
24
29
  export default InputPresentation;
@@ -25,6 +25,7 @@ const InputPresentation = ({
25
25
  children,
26
26
  positionedChildren,
27
27
  inputWidth,
28
+ maxWidth,
28
29
  align,
29
30
  disabled,
30
31
  readOnly,
@@ -59,7 +60,8 @@ const InputPresentation = ({
59
60
  };
60
61
 
61
62
  return /*#__PURE__*/_react.default.createElement(_inputPresentation.StyledInputPresentationContainer, {
62
- inputWidth: inputWidth
63
+ inputWidth: inputWidth,
64
+ maxWidth: maxWidth
63
65
  }, positionedChildren, /*#__PURE__*/_react.default.createElement(_inputPresentation.default, {
64
66
  hasFocus: hasFocus,
65
67
  role: "presentation",
@@ -86,6 +88,7 @@ InputPresentation.propTypes = {
86
88
  "hasIcon": _propTypes.default.bool,
87
89
  "info": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool]),
88
90
  "inputWidth": _propTypes.default.number,
91
+ "maxWidth": _propTypes.default.string,
89
92
  "positionedChildren": _propTypes.default.node,
90
93
  "readOnly": _propTypes.default.bool,
91
94
  "size": _propTypes.default.oneOf(["large", "medium", "small"]),
@@ -1,6 +1,6 @@
1
1
  import { CommonInputPresentationProps } from "./input-presentation.component";
2
2
  import { InputContextProps } from "../input-behaviour";
3
3
  import { CarbonProviderProps } from "../../components/carbon-provider";
4
- export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "inputWidth">, never>;
4
+ export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "maxWidth" | "inputWidth">, never>;
5
5
  declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "align" | "readOnly" | "size" | "hasIcon"> & Pick<CarbonProviderProps, "validationRedesignOptIn">, never>;
6
6
  export default InputPresentationStyle;
@@ -23,6 +23,9 @@ const StyledInputPresentationContainer = _styledComponents.default.div`
23
23
  }) => inputWidth}%;
24
24
  display: flex;
25
25
  position: relative;
26
+ max-width: ${({
27
+ maxWidth
28
+ }) => maxWidth ? `${maxWidth}` : "100%"};
26
29
  `;
27
30
  exports.StyledInputPresentationContainer = StyledInputPresentationContainer;
28
31
 
@@ -437,6 +437,7 @@ Decimal.propTypes = {
437
437
  }), _propTypes.default.string]),
438
438
  "max": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
439
439
  "maxLength": _propTypes.default.number,
440
+ "maxWidth": _propTypes.default.string,
440
441
  "mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
441
442
  "__@toStringTag": _propTypes.default.string.isRequired,
442
443
  "description": _propTypes.default.string,
@@ -354,6 +354,7 @@ GroupedCharacter.propTypes = {
354
354
  }), _propTypes.default.string]),
355
355
  "max": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
356
356
  "maxLength": _propTypes.default.number,
357
+ "maxWidth": _propTypes.default.string,
357
358
  "mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
358
359
  "__@toStringTag": _propTypes.default.string.isRequired,
359
360
  "description": _propTypes.default.string,
@@ -11,6 +11,8 @@ var _input = _interopRequireDefault(require("../../__internal__/input/input.styl
11
11
 
12
12
  var _inputPresentation = _interopRequireDefault(require("../../__internal__/input/input-presentation.style"));
13
13
 
14
+ var _formField = _interopRequireDefault(require("../../__internal__/form-field/form-field.style"));
15
+
14
16
  var _inputIconToggle = _interopRequireDefault(require("../../__internal__/input-icon-toggle/input-icon-toggle.style"));
15
17
 
16
18
  var _selectText = _interopRequireDefault(require("../select/__internal__/select-text/select-text.style"));
@@ -112,6 +114,10 @@ const StyledPagerNavInner = _styledComponents.default.div`
112
114
  display: flex;
113
115
  align-items: center;
114
116
  padding: 0 12px;
117
+
118
+ & ${_formField.default} {
119
+ margin-bottom: 0;
120
+ }
115
121
  `;
116
122
  exports.StyledPagerNavInner = StyledPagerNavInner;
117
123
  const StyledPagerLinkStyles = (0, _styledComponents.default)(_link.default)`
@@ -40,6 +40,11 @@ export interface SearchProps extends ValidationProps, MarginProps {
40
40
  * Leaving the `searchWidth` prop with no value will default the width to '100%'
41
41
  */
42
42
  searchWidth?: string;
43
+ /**
44
+ * Prop for specifying the max-width of the input.
45
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
46
+ */
47
+ maxWidth?: string;
43
48
  /** Prop for active search threshold. This must be a positive number */
44
49
  threshold?: number;
45
50
  /** Prop for `controlled` use */
@@ -51,5 +56,5 @@ export interface SearchProps extends ValidationProps, MarginProps {
51
56
  /** Overrides the default tooltip position */
52
57
  tooltipPosition?: "top" | "bottom" | "left" | "right";
53
58
  }
54
- export declare const Search: ({ defaultValue, onChange, onClick, onFocus, onBlur, onKeyDown, value, id, name, threshold, searchWidth, searchButton, placeholder, variant, "aria-label": ariaLabel, inputRef, tabIndex, error, warning, info, tooltipPosition, ...rest }: SearchProps) => JSX.Element;
59
+ export declare const Search: ({ defaultValue, onChange, onClick, onFocus, onBlur, onKeyDown, value, id, name, threshold, searchWidth, maxWidth, searchButton, placeholder, variant, "aria-label": ariaLabel, inputRef, tabIndex, error, warning, info, tooltipPosition, ...rest }: SearchProps) => JSX.Element;
55
60
  export default Search;
@@ -45,6 +45,7 @@ const Search = ({
45
45
  name,
46
46
  threshold = 3,
47
47
  searchWidth,
48
+ maxWidth,
48
49
  searchButton,
49
50
  placeholder,
50
51
  variant = "default",
@@ -164,6 +165,7 @@ const Search = ({
164
165
  return /*#__PURE__*/_react.default.createElement(_search.default, _extends({
165
166
  isFocused: isFocused,
166
167
  searchWidth: searchWidth,
168
+ maxWidth: maxWidth,
167
169
  searchIsActive: searchIsActive,
168
170
  searchHasValue: !isControlled ? !!(searchValue !== null && searchValue !== void 0 && searchValue.length) : !!(value !== null && value !== void 0 && value.length),
169
171
  showSearchButton: searchButton,
@@ -296,6 +298,7 @@ Search.propTypes = {
296
298
  "toString": _propTypes.default.func.isRequired,
297
299
  "valueOf": _propTypes.default.func.isRequired
298
300
  }), _propTypes.default.string]),
301
+ "maxWidth": _propTypes.default.string,
299
302
  "mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
300
303
  "__@toStringTag": _propTypes.default.string.isRequired,
301
304
  "description": _propTypes.default.string,
@@ -4,6 +4,7 @@ interface StyledSearchProps {
4
4
  searchHasValue?: boolean;
5
5
  searchIsActive?: boolean;
6
6
  searchWidth?: string;
7
+ maxWidth?: string;
7
8
  showSearchButton?: boolean;
8
9
  variant?: string;
9
10
  }
@@ -31,6 +31,7 @@ const StyledSearch = _styledComponents.default.div`
31
31
  ${({
32
32
  isFocused,
33
33
  searchWidth,
34
+ maxWidth,
34
35
  searchIsActive,
35
36
  searchHasValue,
36
37
  showSearchButton,
@@ -43,6 +44,7 @@ const StyledSearch = _styledComponents.default.div`
43
44
  return (0, _styledComponents.css)`
44
45
  ${_styledSystem.margin}
45
46
  width: ${searchWidth ? `${searchWidth}` : "100%"};
47
+ max-width: ${maxWidth ? `${maxWidth}` : "100%"};
46
48
  padding-bottom: 2px;
47
49
  background-color: transparent;
48
50
  border-bottom: 2px solid ${variantColor};
@@ -216,6 +216,12 @@ const formInputPropTypes = {
216
216
  /** Width of an input in percentage. Works only when labelInline is true */
217
217
  inputWidth: _propTypes.default.number,
218
218
 
219
+ /**
220
+ * Prop for specifying the max-width of the input.
221
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
222
+ */
223
+ maxWidth: _propTypes.default.string,
224
+
219
225
  /**
220
226
  * @ignore
221
227
  * @private
@@ -48,6 +48,11 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
48
48
  inputIcon?: IconType;
49
49
  /** Width of an input in percentage. Works only when labelInline is true */
50
50
  inputWidth?: number;
51
+ /**
52
+ * Prop for specifying the max width of the input.
53
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
54
+ */
55
+ maxWidth?: string;
51
56
  /** The content of the label for the input */
52
57
  label?: string;
53
58
  /** Inline label alignment */
@@ -89,6 +94,6 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
89
94
  Pass true boolean to only display orange border */
90
95
  warning?: boolean | string;
91
96
  }
92
- export declare const Textarea: ({ autoFocus, fieldHelp, label, size, children, characterLimit, enforceCharacterLimit, warnOverLimit, onChange, disabled, labelInline, labelAlign, labelHelp, labelSpacing, inputIcon, id: idProp, error, warning, info, name, readOnly, placeholder, expandable, rows, cols, validationOnLabel, adaptiveLabelBreakpoint, inputWidth, labelWidth, tooltipPosition, value, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, helpAriaLabel, ...props }: TextareaProps) => JSX.Element;
97
+ export declare const Textarea: ({ autoFocus, fieldHelp, label, size, children, characterLimit, enforceCharacterLimit, warnOverLimit, onChange, disabled, labelInline, labelAlign, labelHelp, labelSpacing, inputIcon, id: idProp, error, warning, info, name, readOnly, placeholder, expandable, rows, cols, validationOnLabel, adaptiveLabelBreakpoint, inputWidth, maxWidth, labelWidth, tooltipPosition, value, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, helpAriaLabel, ...props }: TextareaProps) => JSX.Element;
93
98
  export { Textarea as OriginalTextarea };
94
99
  export default Textarea;
@@ -76,6 +76,7 @@ const Textarea = ({
76
76
  validationOnLabel = false,
77
77
  adaptiveLabelBreakpoint,
78
78
  inputWidth,
79
+ maxWidth,
79
80
  labelWidth = 30,
80
81
  tooltipPosition,
81
82
  value,
@@ -156,6 +157,7 @@ const Textarea = ({
156
157
  disabled: disabled,
157
158
  readOnly: readOnly,
158
159
  inputWidth: typeof inputWidth === "number" ? inputWidth : 100 - labelWidth,
160
+ maxWidth: maxWidth,
159
161
  error: error,
160
162
  warning: warning,
161
163
  info: info
@@ -438,6 +440,7 @@ Textarea.propTypes = {
438
440
  }), _propTypes.default.string]),
439
441
  "max": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
440
442
  "maxLength": _propTypes.default.number,
443
+ "maxWidth": _propTypes.default.string,
441
444
  "mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
442
445
  "__@toStringTag": _propTypes.default.string.isRequired,
443
446
  "description": _propTypes.default.string,
@@ -33,6 +33,11 @@ export interface CommonTextboxProps extends ValidationProps, MarginProps, Omit<C
33
33
  iconTabIndex?: number;
34
34
  /** The width of the input as a percentage */
35
35
  inputWidth?: number;
36
+ /**
37
+ * Prop for specifying the max width of the input.
38
+ * Leaving the `maxWidth` prop with no value will default the width to '100%'
39
+ */
40
+ maxWidth?: string;
36
41
  /** Additional child elements to display before the input */
37
42
  leftChildren?: React.ReactNode;
38
43
  /** Label content */
@@ -88,5 +93,5 @@ export interface TextboxProps extends CommonTextboxProps {
88
93
  /** Whether to display the character count message in red */
89
94
  warnOverLimit?: boolean;
90
95
  }
91
- export declare const Textbox: ({ align, autoFocus, children, disabled, inputIcon, leftChildren, labelId: externalLabelId, label, labelAlign, labelHelp, labelInline, labelSpacing, id, formattedValue, fieldHelp, error, warning, info, name, reverse, size, value, readOnly, placeholder, inputRef, onBlur, onClick, onFocus, onChange, onMouseDown, onChangeDeferred, deferTimeout, isOptional, iconOnClick, iconOnMouseDown, iconTabIndex, validationOnLabel, labelWidth, inputWidth, prefix, adaptiveLabelBreakpoint, required, positionedChildren, tooltipPosition, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, enforceCharacterLimit, characterLimit, warnOverLimit, helpAriaLabel, ...props }: TextboxProps) => JSX.Element;
96
+ export declare const Textbox: ({ align, autoFocus, children, disabled, inputIcon, leftChildren, labelId: externalLabelId, label, labelAlign, labelHelp, labelInline, labelSpacing, id, formattedValue, fieldHelp, error, warning, info, name, reverse, size, value, readOnly, placeholder, inputRef, onBlur, onClick, onFocus, onChange, onMouseDown, onChangeDeferred, deferTimeout, isOptional, iconOnClick, iconOnMouseDown, iconTabIndex, validationOnLabel, labelWidth, inputWidth, maxWidth, prefix, adaptiveLabelBreakpoint, required, positionedChildren, tooltipPosition, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, enforceCharacterLimit, characterLimit, warnOverLimit, helpAriaLabel, ...props }: TextboxProps) => JSX.Element;
92
97
  export default Textbox;
@@ -87,6 +87,7 @@ const Textbox = ({
87
87
  validationOnLabel = false,
88
88
  labelWidth = 30,
89
89
  inputWidth,
90
+ maxWidth,
90
91
  prefix,
91
92
  adaptiveLabelBreakpoint,
92
93
  required,
@@ -139,6 +140,7 @@ const Textbox = ({
139
140
  warning: warning,
140
141
  info: info,
141
142
  inputWidth: inputWidth || 100 - labelWidth,
143
+ maxWidth: maxWidth,
142
144
  positionedChildren: positionedChildren,
143
145
  hasIcon: hasIconInside
144
146
  }, leftChildren, prefix && /*#__PURE__*/_react.default.createElement(_prefix.default, {
@@ -438,6 +440,7 @@ Textbox.propTypes = {
438
440
  }), _propTypes.default.string]),
439
441
  "max": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
440
442
  "maxLength": _propTypes.default.number,
443
+ "maxWidth": _propTypes.default.string,
441
444
  "mb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
442
445
  "__@toStringTag": _propTypes.default.string.isRequired,
443
446
  "description": _propTypes.default.string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "111.12.7",
3
+ "version": "111.13.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",