carbon-react 111.12.4 → 111.12.6

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 (61) hide show
  1. package/esm/__internal__/input/input.component.d.ts +6 -0
  2. package/esm/__internal__/input/input.component.js +3 -0
  3. package/esm/__internal__/radio-button-mapper/index.d.ts +2 -2
  4. package/esm/__internal__/radio-button-mapper/radio-button-mapper.component.d.ts +29 -0
  5. package/esm/__internal__/radio-button-mapper/radio-button-mapper.component.js +20 -26
  6. package/esm/components/checkbox/checkbox.style.d.ts +1 -1
  7. package/esm/components/date/date.component.js +3 -1
  8. package/esm/components/date/date.style.js +18 -1
  9. package/esm/components/decimal/decimal.component.js +1 -0
  10. package/esm/components/grouped-character/grouped-character.component.js +1 -0
  11. package/esm/components/radio-button/index.d.ts +4 -6
  12. package/esm/components/radio-button/index.js +2 -2
  13. package/esm/components/radio-button/radio-button-group.component.d.ts +42 -0
  14. package/esm/components/radio-button/radio-button-group.component.js +181 -67
  15. package/esm/components/radio-button/radio-button-group.style.d.ts +5 -0
  16. package/esm/components/radio-button/radio-button-svg.component.d.ts +3 -0
  17. package/esm/components/radio-button/radio-button-svg.component.js +1 -0
  18. package/esm/components/radio-button/radio-button.component.d.ts +28 -0
  19. package/esm/components/radio-button/radio-button.component.js +529 -107
  20. package/esm/components/radio-button/radio-button.style.d.ts +5 -0
  21. package/esm/components/textarea/index.d.ts +2 -1
  22. package/esm/components/textarea/textarea.component.d.ts +94 -0
  23. package/esm/components/textarea/textarea.component.js +570 -162
  24. package/esm/components/textarea/textarea.style.d.ts +8 -2
  25. package/esm/components/textbox/textbox.component.js +41 -36
  26. package/esm/components/textbox/textbox.style.js +1 -1
  27. package/lib/__internal__/input/input.component.d.ts +6 -0
  28. package/lib/__internal__/input/input.component.js +3 -0
  29. package/lib/__internal__/radio-button-mapper/index.d.ts +2 -2
  30. package/lib/__internal__/radio-button-mapper/radio-button-mapper.component.d.ts +29 -0
  31. package/lib/__internal__/radio-button-mapper/radio-button-mapper.component.js +20 -26
  32. package/lib/components/checkbox/checkbox.style.d.ts +1 -1
  33. package/lib/components/date/date.component.js +3 -1
  34. package/lib/components/date/date.style.js +25 -1
  35. package/lib/components/decimal/decimal.component.js +1 -0
  36. package/lib/components/grouped-character/grouped-character.component.js +1 -0
  37. package/lib/components/radio-button/index.d.ts +4 -6
  38. package/lib/components/radio-button/index.js +1 -11
  39. package/lib/components/radio-button/radio-button-group.component.d.ts +42 -0
  40. package/lib/components/radio-button/radio-button-group.component.js +182 -70
  41. package/lib/components/radio-button/radio-button-group.style.d.ts +5 -0
  42. package/lib/components/radio-button/radio-button-svg.component.d.ts +3 -0
  43. package/lib/components/radio-button/radio-button-svg.component.js +2 -0
  44. package/lib/components/radio-button/radio-button.component.d.ts +28 -0
  45. package/lib/components/radio-button/radio-button.component.js +530 -109
  46. package/lib/components/radio-button/radio-button.style.d.ts +5 -0
  47. package/lib/components/textarea/index.d.ts +2 -1
  48. package/lib/components/textarea/textarea.component.d.ts +94 -0
  49. package/lib/components/textarea/textarea.component.js +574 -166
  50. package/lib/components/textarea/textarea.style.d.ts +8 -2
  51. package/lib/components/textbox/textbox.component.js +44 -36
  52. package/lib/components/textbox/textbox.style.js +1 -1
  53. package/package.json +1 -1
  54. package/esm/__internal__/radio-button-mapper/radio-button-mapper.d.ts +0 -20
  55. package/esm/components/radio-button/radio-button-group.d.ts +0 -42
  56. package/esm/components/radio-button/radio-button.d.ts +0 -30
  57. package/esm/components/textarea/textarea.d.ts +0 -81
  58. package/lib/__internal__/radio-button-mapper/radio-button-mapper.d.ts +0 -20
  59. package/lib/components/radio-button/radio-button-group.d.ts +0 -42
  60. package/lib/components/radio-button/radio-button.d.ts +0 -30
  61. package/lib/components/textarea/textarea.d.ts +0 -81
@@ -1,3 +1,9 @@
1
- export const MIN_HEIGHT: 64;
1
+ export declare const MIN_HEIGHT = 64;
2
+ export interface StyledTextAreaProps {
3
+ /** When true, label is placed in line an input */
4
+ labelInline?: boolean;
5
+ /** When true, adjusts padding for icon */
6
+ hasIcon?: boolean;
7
+ }
8
+ declare const StyledTextarea: import("styled-components").StyledComponent<"div", any, StyledTextAreaProps, never>;
2
9
  export default StyledTextarea;
3
- declare const StyledTextarea: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -37,6 +37,8 @@ var _carbonProvider = require("../carbon-provider/carbon-provider.component");
37
37
 
38
38
  var _numeralDateContext = _interopRequireDefault(require("../numeral-date/numeral-date-context"));
39
39
 
40
+ var _box = _interopRequireDefault(require("../box"));
41
+
40
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
43
 
42
44
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -127,38 +129,8 @@ const Textbox = ({
127
129
  });
128
130
  const labelId = label ? externalLabelId || internalLabelId : "";
129
131
  const hasIconInside = !!(inputIcon || validationIconId && !validationOnLabel);
130
- return /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
131
- helpAriaLabel: helpAriaLabel,
132
- tooltipPosition: tooltipPosition
133
- }, /*#__PURE__*/_react.default.createElement(_inputBehaviour.InputBehaviour, null, /*#__PURE__*/_react.default.createElement(_formField.default, _extends({
134
- disabled: disabled,
135
- fieldHelpId: fieldHelpId,
136
- fieldHelp: computeLabelPropValues(fieldHelp),
137
- error: error,
138
- warning: warning,
139
- info: info,
140
- label: label,
141
- labelId: labelId,
142
- labelAlign: computeLabelPropValues(labelAlign),
143
- labelHelp: computeLabelPropValues(labelHelp),
144
- labelInline: computeLabelPropValues(labelInline),
145
- labelSpacing: labelSpacing,
146
- labelWidth: computeLabelPropValues(labelWidth),
147
- id: uniqueId,
148
- reverse: computeLabelPropValues(reverse),
149
- isOptional: isOptional,
150
- useValidationIcon: computeLabelPropValues(validationOnLabel),
151
- adaptiveLabelBreakpoint: adaptiveLabelBreakpoint,
152
- isRequired: required,
153
- "data-component": dataComponent,
154
- "data-role": dataRole,
155
- "data-element": dataElement,
156
- validationIconId: validationRedesignOptIn ? undefined : validationIconId,
157
- validationRedesignOptIn: validationRedesignOptIn
158
- }, (0, _utils.filterStyledSystemMarginProps)(props)), validationRedesignOptIn && labelHelp && /*#__PURE__*/_react.default.createElement(_textbox.StyledHintText, null, labelHelp), validationRedesignOptIn && /*#__PURE__*/_react.default.createElement(_validationMessage.default, {
159
- error: error,
160
- warning: warning
161
- }), /*#__PURE__*/_react.default.createElement(_input.InputPresentation, {
132
+
133
+ const input = /*#__PURE__*/_react.default.createElement(_input.InputPresentation, {
162
134
  align: align,
163
135
  disabled: disabled,
164
136
  readOnly: readOnly,
@@ -171,9 +143,7 @@ const Textbox = ({
171
143
  hasIcon: hasIconInside
172
144
  }, leftChildren, prefix && /*#__PURE__*/_react.default.createElement(_prefix.default, {
173
145
  "data-element": "textbox-prefix"
174
- }, prefix), validationRedesignOptIn && !disableErrorBorder && (error || warning) && /*#__PURE__*/_react.default.createElement(_textbox.ErrorBorder, {
175
- warning: !!(!error && warning)
176
- }), /*#__PURE__*/_react.default.createElement(_input.Input, _extends({}, required && {
146
+ }, prefix), /*#__PURE__*/_react.default.createElement(_input.Input, _extends({}, required && {
177
147
  required
178
148
  }, {
179
149
  align: align,
@@ -210,7 +180,44 @@ const Textbox = ({
210
180
  useValidationIcon: !(validationRedesignOptIn || validationOnLabel),
211
181
  warning: warning,
212
182
  validationIconId: validationRedesignOptIn ? undefined : validationIconId
213
- }))), characterCount));
183
+ }));
184
+
185
+ return /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
186
+ helpAriaLabel: helpAriaLabel,
187
+ tooltipPosition: tooltipPosition
188
+ }, /*#__PURE__*/_react.default.createElement(_inputBehaviour.InputBehaviour, null, /*#__PURE__*/_react.default.createElement(_formField.default, _extends({
189
+ disabled: disabled,
190
+ fieldHelpId: fieldHelpId,
191
+ fieldHelp: computeLabelPropValues(fieldHelp),
192
+ error: error,
193
+ warning: warning,
194
+ info: info,
195
+ label: label,
196
+ labelId: labelId,
197
+ labelAlign: computeLabelPropValues(labelAlign),
198
+ labelHelp: computeLabelPropValues(labelHelp),
199
+ labelInline: computeLabelPropValues(labelInline),
200
+ labelSpacing: labelSpacing,
201
+ labelWidth: computeLabelPropValues(labelWidth),
202
+ id: uniqueId,
203
+ reverse: computeLabelPropValues(reverse),
204
+ isOptional: isOptional,
205
+ useValidationIcon: computeLabelPropValues(validationOnLabel),
206
+ adaptiveLabelBreakpoint: adaptiveLabelBreakpoint,
207
+ isRequired: required,
208
+ "data-component": dataComponent,
209
+ "data-role": dataRole,
210
+ "data-element": dataElement,
211
+ validationIconId: validationRedesignOptIn ? undefined : validationIconId,
212
+ validationRedesignOptIn: validationRedesignOptIn
213
+ }, (0, _utils.filterStyledSystemMarginProps)(props)), validationRedesignOptIn && labelHelp && /*#__PURE__*/_react.default.createElement(_textbox.StyledHintText, null, labelHelp), validationRedesignOptIn ? /*#__PURE__*/_react.default.createElement(_box.default, {
214
+ position: "relative"
215
+ }, /*#__PURE__*/_react.default.createElement(_validationMessage.default, {
216
+ error: error,
217
+ warning: warning
218
+ }), !disableErrorBorder && (error || warning) && /*#__PURE__*/_react.default.createElement(_textbox.ErrorBorder, {
219
+ warning: !!(!error && warning)
220
+ }), input) : input), characterCount));
214
221
  };
215
222
 
216
223
  exports.Textbox = Textbox;
@@ -269,6 +276,7 @@ Textbox.propTypes = {
269
276
  "aria-valuemin": _propTypes.default.number,
270
277
  "aria-valuenow": _propTypes.default.number,
271
278
  "aria-valuetext": _propTypes.default.string,
279
+ "as": _propTypes.default.elementType,
272
280
  "autoCapitalize": _propTypes.default.string,
273
281
  "autoComplete": _propTypes.default.string,
274
282
  "autoCorrect": _propTypes.default.string,
@@ -18,10 +18,10 @@ const ErrorBorder = _styledComponents.default.span`
18
18
  position: absolute;
19
19
  z-index: 6;
20
20
  width: 2px;
21
- height: calc(100% + var(--spacing300));
22
21
  background-color: ${warning ? "var(--colorsSemanticCaution500)" : "var(--colorsSemanticNegative500)"};
23
22
  left: -12px;
24
23
  bottom: 0px;
24
+ top: 0px;
25
25
  `}
26
26
  `;
27
27
  exports.ErrorBorder = ErrorBorder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "111.12.4",
3
+ "version": "111.12.6",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",
@@ -1,20 +0,0 @@
1
- import React from "react";
2
-
3
- export interface RadioButtonMapperProps {
4
- /** The RadioButton objects to be rendered in the group */
5
- children?: React.ReactNode;
6
- /** Specifies the name prop to be applied to each button in the group */
7
- name: string;
8
- /** Callback fired when each RadioButton is blurred */
9
- onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
10
- /** Callback fired when the user selects a RadioButton */
11
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
12
- /** Callback fired on key down */
13
- onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
14
- /** Value of the selected RadioButton */
15
- value?: string;
16
- }
17
-
18
- declare function RadioButtonMapper(props?: RadioButtonMapperProps): JSX.Element;
19
-
20
- export default RadioButtonMapper;
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
- import { ValidationProps } from "../../__internal__/validations";
4
-
5
- export interface RadioButtonGroupProps extends ValidationProps, MarginProps {
6
- /** Breakpoint for adaptive legend (inline labels change to top aligned). Enables the adaptive behaviour when set */
7
- adaptiveLegendBreakpoint?: number;
8
- /** Breakpoint for adaptive spacing (left margin changes to 0). Enables the adaptive behaviour when set */
9
- adaptiveSpacingBreakpoint?: number;
10
- /** The RadioButton objects to be rendered in the group */
11
- children: React.ReactNode;
12
- /** When true, RadioButtons are in line */
13
- inline?: boolean;
14
- /** Spacing between labels and radio buttons, given number will be multiplied by base spacing unit (8) */
15
- labelSpacing?: 1 | 2;
16
- /** The content for the RadioGroup Legend */
17
- legend?: string;
18
- /** Text alignment of legend when inline */
19
- legendAlign?: "left" | "right";
20
- /** When true, legend is placed in line with the radiobuttons */
21
- legendInline?: boolean;
22
- /** Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
23
- legendSpacing?: 1 | 2;
24
- /** Percentage width of legend (only when legend is inline) */
25
- legendWidth?: number;
26
- /** Specifies the name prop to be applied to each button in the group */
27
- name: string;
28
- /** Callback fired when each RadioButton is blurred */
29
- onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
30
- /** Callback fired when the user selects a RadioButton */
31
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
32
- /** Flag to configure component as mandatory */
33
- required?: boolean;
34
- /** value of the selected RadioButton */
35
- value?: string;
36
- /** Overrides the default tooltip position */
37
- tooltipPosition?: "top" | "bottom" | "left" | "right";
38
- }
39
-
40
- declare function RadioButtonGroup(props: RadioButtonGroupProps): JSX.Element;
41
-
42
- export default RadioButtonGroup;
@@ -1,30 +0,0 @@
1
- import { MarginProps } from "styled-system";
2
- import { CommonCheckableInputProps } from "../../__internal__/checkable-input";
3
-
4
- export interface RadioButtonProps
5
- extends CommonCheckableInputProps,
6
- MarginProps {
7
- /** Identifier used for testing purposes, applied to the root element of the component. */
8
- "data-component"?: string;
9
- /** Identifier used for testing purposes, applied to the root element of the component. */
10
- "data-element"?: string;
11
- /** Identifier used for testing purposes, applied to the root element of the component. */
12
- "data-role"?: string;
13
- /** When true, sets the component in line (for RadioButtonGroup) */
14
- inline?: boolean;
15
- /** Text alignment of the label */
16
- labelAlign?: "left" | "right";
17
- /** the value of the Radio Button, passed on form submit */
18
- value: string;
19
- /** Overrides the default tooltip position */
20
- tooltipPosition?: "top" | "bottom" | "left" | "right";
21
- /** Aria label for rendered help component */
22
- helpAriaLabel?: string;
23
- }
24
-
25
- declare function RadioButton(
26
- props: RadioButtonProps & React.RefAttributes<HTMLInputElement>
27
- ): JSX.Element;
28
-
29
- export { RadioButton as PrivateRadioButton };
30
- export default RadioButton;
@@ -1,81 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
-
4
- import { ValidationProps } from "../../__internal__/validations";
5
- import { CommonInputProps } from "../../__internal__/input";
6
-
7
- // TODO: Change characterLimit type to number - batch with other breaking changes
8
- export interface TextareaProps
9
- extends ValidationProps,
10
- MarginProps,
11
- Omit<CommonInputProps, "size"> {
12
- /** Automatically focus the input on component mount */
13
- autoFocus?: boolean;
14
- /** Identifier used for testing purposes, applied to the root element of the component. */
15
- "data-component"?: string;
16
- /** Identifier used for testing purposes, applied to the root element of the component. */
17
- "data-element"?: string;
18
- /** Identifier used for testing purposes, applied to the root element of the component. */
19
- "data-role"?: string;
20
- /** Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set */
21
- adaptiveLabelBreakpoint?: number;
22
- /** Character limit of the textarea */
23
- characterLimit?: string | number;
24
- /** Type of the icon that will be rendered next to the input */
25
- children?: React.ReactNode;
26
- /** The visible width of the text control, in average character widths */
27
- cols?: number;
28
- /** If true, the component will be disabled */
29
- disabled?: boolean;
30
- /** Stop the user typing over the characterLimit */
31
- enforceCharacterLimit?: boolean;
32
- /** Allows the Textareas Height to change based on user input */
33
- expandable?: boolean;
34
- /** id of the input */
35
- id?: string;
36
- /** Type of the icon that will be rendered next to the input */
37
- inputIcon?: string;
38
- /** Width of an input in percentage. Works only when labelInline is true */
39
- inputWidth?: number;
40
- /** Label */
41
- label?: string;
42
- /** Text applied to label help tooltip */
43
- labelHelp?: React.ReactNode;
44
- /** When true, label is placed in line an input */
45
- labelInline?: boolean;
46
- /** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
47
- labelSpacing?: 1 | 2;
48
- /** Width of a label in percentage. Works only when labelInline is true */
49
- labelWidth?: number;
50
- /** Name of the input */
51
- name?: string;
52
- /** Callback fired when the user types in the Textarea */
53
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
54
- /** Placeholder text for the component */
55
- placeholder?: string;
56
- /** Adds readOnly property */
57
- readOnly?: boolean;
58
- /** Flag to configure component as mandatory */
59
- required?: boolean;
60
- /** The number of visible text lines for the control */
61
- rows?: number;
62
- /** Size of an input */
63
- size?: "small" | "medium" | "large";
64
- /** Message to be displayed in a Tooltip when the user hovers over the help icon */
65
- tooltipMessage?: string;
66
- /** When true, validation icon will be placed on label instead of being placed on the input */
67
- validationOnLabel?: boolean;
68
- /** The value of the Textbox */
69
- value?: string;
70
- /** Whether to display the character count message in red */
71
- warnOverLimit?: boolean;
72
- /** Overrides the default tooltip position */
73
- tooltipPosition?: "top" | "bottom" | "left" | "right";
74
- /** Aria label for rendered help component */
75
- helpAriaLabel?: string;
76
- }
77
-
78
- declare function Textarea(props: TextareaProps): JSX.Element;
79
-
80
- export { Textarea as OriginalTextarea };
81
- export default Textarea;
@@ -1,20 +0,0 @@
1
- import React from "react";
2
-
3
- export interface RadioButtonMapperProps {
4
- /** The RadioButton objects to be rendered in the group */
5
- children?: React.ReactNode;
6
- /** Specifies the name prop to be applied to each button in the group */
7
- name: string;
8
- /** Callback fired when each RadioButton is blurred */
9
- onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
10
- /** Callback fired when the user selects a RadioButton */
11
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
12
- /** Callback fired on key down */
13
- onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
14
- /** Value of the selected RadioButton */
15
- value?: string;
16
- }
17
-
18
- declare function RadioButtonMapper(props?: RadioButtonMapperProps): JSX.Element;
19
-
20
- export default RadioButtonMapper;
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
- import { ValidationProps } from "../../__internal__/validations";
4
-
5
- export interface RadioButtonGroupProps extends ValidationProps, MarginProps {
6
- /** Breakpoint for adaptive legend (inline labels change to top aligned). Enables the adaptive behaviour when set */
7
- adaptiveLegendBreakpoint?: number;
8
- /** Breakpoint for adaptive spacing (left margin changes to 0). Enables the adaptive behaviour when set */
9
- adaptiveSpacingBreakpoint?: number;
10
- /** The RadioButton objects to be rendered in the group */
11
- children: React.ReactNode;
12
- /** When true, RadioButtons are in line */
13
- inline?: boolean;
14
- /** Spacing between labels and radio buttons, given number will be multiplied by base spacing unit (8) */
15
- labelSpacing?: 1 | 2;
16
- /** The content for the RadioGroup Legend */
17
- legend?: string;
18
- /** Text alignment of legend when inline */
19
- legendAlign?: "left" | "right";
20
- /** When true, legend is placed in line with the radiobuttons */
21
- legendInline?: boolean;
22
- /** Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
23
- legendSpacing?: 1 | 2;
24
- /** Percentage width of legend (only when legend is inline) */
25
- legendWidth?: number;
26
- /** Specifies the name prop to be applied to each button in the group */
27
- name: string;
28
- /** Callback fired when each RadioButton is blurred */
29
- onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
30
- /** Callback fired when the user selects a RadioButton */
31
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
32
- /** Flag to configure component as mandatory */
33
- required?: boolean;
34
- /** value of the selected RadioButton */
35
- value?: string;
36
- /** Overrides the default tooltip position */
37
- tooltipPosition?: "top" | "bottom" | "left" | "right";
38
- }
39
-
40
- declare function RadioButtonGroup(props: RadioButtonGroupProps): JSX.Element;
41
-
42
- export default RadioButtonGroup;
@@ -1,30 +0,0 @@
1
- import { MarginProps } from "styled-system";
2
- import { CommonCheckableInputProps } from "../../__internal__/checkable-input";
3
-
4
- export interface RadioButtonProps
5
- extends CommonCheckableInputProps,
6
- MarginProps {
7
- /** Identifier used for testing purposes, applied to the root element of the component. */
8
- "data-component"?: string;
9
- /** Identifier used for testing purposes, applied to the root element of the component. */
10
- "data-element"?: string;
11
- /** Identifier used for testing purposes, applied to the root element of the component. */
12
- "data-role"?: string;
13
- /** When true, sets the component in line (for RadioButtonGroup) */
14
- inline?: boolean;
15
- /** Text alignment of the label */
16
- labelAlign?: "left" | "right";
17
- /** the value of the Radio Button, passed on form submit */
18
- value: string;
19
- /** Overrides the default tooltip position */
20
- tooltipPosition?: "top" | "bottom" | "left" | "right";
21
- /** Aria label for rendered help component */
22
- helpAriaLabel?: string;
23
- }
24
-
25
- declare function RadioButton(
26
- props: RadioButtonProps & React.RefAttributes<HTMLInputElement>
27
- ): JSX.Element;
28
-
29
- export { RadioButton as PrivateRadioButton };
30
- export default RadioButton;
@@ -1,81 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
-
4
- import { ValidationProps } from "../../__internal__/validations";
5
- import { CommonInputProps } from "../../__internal__/input";
6
-
7
- // TODO: Change characterLimit type to number - batch with other breaking changes
8
- export interface TextareaProps
9
- extends ValidationProps,
10
- MarginProps,
11
- Omit<CommonInputProps, "size"> {
12
- /** Automatically focus the input on component mount */
13
- autoFocus?: boolean;
14
- /** Identifier used for testing purposes, applied to the root element of the component. */
15
- "data-component"?: string;
16
- /** Identifier used for testing purposes, applied to the root element of the component. */
17
- "data-element"?: string;
18
- /** Identifier used for testing purposes, applied to the root element of the component. */
19
- "data-role"?: string;
20
- /** Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set */
21
- adaptiveLabelBreakpoint?: number;
22
- /** Character limit of the textarea */
23
- characterLimit?: string | number;
24
- /** Type of the icon that will be rendered next to the input */
25
- children?: React.ReactNode;
26
- /** The visible width of the text control, in average character widths */
27
- cols?: number;
28
- /** If true, the component will be disabled */
29
- disabled?: boolean;
30
- /** Stop the user typing over the characterLimit */
31
- enforceCharacterLimit?: boolean;
32
- /** Allows the Textareas Height to change based on user input */
33
- expandable?: boolean;
34
- /** id of the input */
35
- id?: string;
36
- /** Type of the icon that will be rendered next to the input */
37
- inputIcon?: string;
38
- /** Width of an input in percentage. Works only when labelInline is true */
39
- inputWidth?: number;
40
- /** Label */
41
- label?: string;
42
- /** Text applied to label help tooltip */
43
- labelHelp?: React.ReactNode;
44
- /** When true, label is placed in line an input */
45
- labelInline?: boolean;
46
- /** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
47
- labelSpacing?: 1 | 2;
48
- /** Width of a label in percentage. Works only when labelInline is true */
49
- labelWidth?: number;
50
- /** Name of the input */
51
- name?: string;
52
- /** Callback fired when the user types in the Textarea */
53
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
54
- /** Placeholder text for the component */
55
- placeholder?: string;
56
- /** Adds readOnly property */
57
- readOnly?: boolean;
58
- /** Flag to configure component as mandatory */
59
- required?: boolean;
60
- /** The number of visible text lines for the control */
61
- rows?: number;
62
- /** Size of an input */
63
- size?: "small" | "medium" | "large";
64
- /** Message to be displayed in a Tooltip when the user hovers over the help icon */
65
- tooltipMessage?: string;
66
- /** When true, validation icon will be placed on label instead of being placed on the input */
67
- validationOnLabel?: boolean;
68
- /** The value of the Textbox */
69
- value?: string;
70
- /** Whether to display the character count message in red */
71
- warnOverLimit?: boolean;
72
- /** Overrides the default tooltip position */
73
- tooltipPosition?: "top" | "bottom" | "left" | "right";
74
- /** Aria label for rendered help component */
75
- helpAriaLabel?: string;
76
- }
77
-
78
- declare function Textarea(props: TextareaProps): JSX.Element;
79
-
80
- export { Textarea as OriginalTextarea };
81
- export default Textarea;