@atlaskit/textarea 4.4.0 → 4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/textarea
2
2
 
3
+ ## 4.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6612a236510`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6612a236510) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
8
+
9
+ ### Patch Changes
10
+
11
+ - [`32d761cfc1d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/32d761cfc1d) - [ux] Fix bug that prevented consumers from rendering a single line textarea
12
+
3
13
  ## 4.4.0
4
14
 
5
15
  ### Minor Changes
@@ -9,6 +9,8 @@ exports.themeStyles = exports.getBaseStyles = exports.borderWidth = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
+ var _react = require("@emotion/react");
13
+
12
14
  var _constants = require("@atlaskit/theme/constants");
13
15
 
14
16
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -46,7 +48,7 @@ var borderBoxMinHeightCompact = function borderBoxMinHeightCompact(minimumRows,
46
48
  };
47
49
 
48
50
  var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance) {
49
- return _objectSpread({
51
+ return (0, _react.css)(_objectSpread({
50
52
  '&:focus': {
51
53
  backgroundColor: props.backgroundColorFocus,
52
54
  borderColor: props.borderColorFocus
@@ -55,10 +57,12 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance)
55
57
  backgroundColor: props.backgroundColor,
56
58
  borderColor: props.borderColor
57
59
  },
60
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
58
61
  '&[data-invalid]:focus': {
59
62
  backgroundColor: props.invalidRules.backgroundColorFocus,
60
63
  borderColor: props.invalidRules.borderColorFocus
61
64
  },
65
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
62
66
  '&[data-invalid]:not(:focus)': {
63
67
  backgroundColor: props.invalidRules.backgroundColor,
64
68
  borderColor: props.invalidRules.borderColor
@@ -72,96 +76,98 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance)
72
76
  backgroundColor: props.disabledRules.backgroundColor,
73
77
  borderColor: props.disabledRules.borderColor
74
78
  }
75
- } : {});
79
+ } : {}));
76
80
  };
77
81
 
78
82
  var placeholderStyle = function placeholderStyle(placeholderTextColor) {
79
- return {
83
+ return (0, _react.css)({
80
84
  '&::placeholder': {
81
85
  color: placeholderTextColor
82
86
  }
83
- };
87
+ });
84
88
  };
85
89
 
86
90
  var hoverBackgroundAndBorderStyles = function hoverBackgroundAndBorderStyles(props) {
87
- return {
91
+ return (0, _react.css)({
88
92
  '&:hover:not(:read-only):not(:focus)': {
89
93
  backgroundColor: props.backgroundColorHover,
90
94
  borderColor: props.borderColorHover,
91
95
  '&:disabled': {
92
96
  backgroundColor: props.disabledRules.backgroundColorHover
93
97
  },
98
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
94
99
  '&[data-invalid]': {
95
100
  backgroundColor: props.invalidRules.backgroundColorHover
96
101
  }
97
102
  }
98
- };
103
+ });
99
104
  };
100
105
 
101
106
  var resizeStyle = function resizeStyle(resize) {
102
107
  if (resize === 'horizontal' || resize === 'vertical') {
103
- return {
108
+ return (0, _react.css)({
104
109
  resize: resize
105
- };
110
+ });
106
111
  }
107
112
 
108
113
  if (resize === 'auto') {
109
- return {
114
+ return (0, _react.css)({
110
115
  resize: 'both'
111
- };
116
+ });
112
117
  }
113
118
 
114
- return {
119
+ return (0, _react.css)({
115
120
  resize: 'none'
116
- };
121
+ });
117
122
  };
118
123
 
119
124
  var borderStyle = function borderStyle(appearance) {
120
- return {
125
+ return (0, _react.css)({
121
126
  borderStyle: appearance === 'none' ? 'none' : 'solid'
122
- };
127
+ });
123
128
  };
124
129
 
125
130
  var fontFamilyStyle = function fontFamilyStyle(isMonospaced) {
126
- return {
131
+ return (0, _react.css)({
127
132
  fontFamily: isMonospaced ? codeFontFamily : fontFamily
128
- };
133
+ });
129
134
  };
130
135
 
131
136
  var borderPaddingAndHeightStyles = function borderPaddingAndHeightStyles() {
132
137
  var minimumRows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
133
138
  var horizontalPaddingWithoutBorderWidth = horizontalPadding - borderWidth;
134
139
  var borderHeight = borderWidth;
135
- return {
140
+ return (0, _react.css)({
141
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
136
142
  '&[data-compact]': {
143
+ minHeight: borderBoxMinHeightCompact(minimumRows, borderHeight),
137
144
  padding: "".concat(compactVerticalPadding, "px ").concat(horizontalPaddingWithoutBorderWidth, "px"),
138
- lineHeight: lineHeightCompact / fontSize,
139
- minHeight: borderBoxMinHeightCompact(minimumRows, borderHeight)
145
+ lineHeight: lineHeightCompact / fontSize
140
146
  },
141
147
  '&:not([data-compact])': {
148
+ minHeight: borderBoxMinHeight(minimumRows, borderHeight),
142
149
  padding: "".concat(verticalPadding, "px ").concat(horizontalPaddingWithoutBorderWidth, "px"),
143
- lineHeight: lineHeightBase / fontSize,
144
- minHeight: borderBoxMinHeight(minimumRows, borderHeight)
150
+ lineHeight: lineHeightBase / fontSize
145
151
  }
146
- };
152
+ });
147
153
  };
148
154
 
149
- var staticStyles = {
150
- flex: '1 1 100%',
151
- position: 'relative',
152
- borderRadius: borderRadius,
155
+ var staticStyles = (0, _react.css)({
156
+ display: 'block',
153
157
  boxSizing: 'border-box',
154
- overflow: 'auto',
155
- transition: "background-color ".concat(transitionDuration, " ease-in-out,\n border-color ").concat(transitionDuration, " ease-in-out"),
156
- wordWrap: 'break-word',
157
- fontSize: fontSize,
158
- borderWidth: borderWidth,
158
+ width: '100%',
159
+ minWidth: 0,
159
160
  maxWidth: '100%',
160
- display: 'block',
161
161
  margin: 0,
162
- minWidth: 0,
162
+ position: 'relative',
163
+ flex: '1 1 100%',
164
+ borderRadius: borderRadius,
165
+ borderWidth: borderWidth,
166
+ fontSize: fontSize,
163
167
  outline: 'none',
164
- width: '100%',
168
+ overflow: 'auto',
169
+ transition: "background-color ".concat(transitionDuration, " ease-in-out, \n border-color ").concat(transitionDuration, " ease-in-out"),
170
+ wordWrap: 'break-word',
165
171
  '&:disabled': _objectSpread({
166
172
  cursor: 'not-allowed'
167
173
  }, overrideSafariDisabledStyles),
@@ -171,7 +177,7 @@ var staticStyles = {
171
177
  '&:invalid': {
172
178
  boxShadow: 'none'
173
179
  }
174
- };
180
+ });
175
181
 
176
182
  var getBaseStyles = function getBaseStyles(_ref) {
177
183
  var minimumRows = _ref.minimumRows,
@@ -179,20 +185,24 @@ var getBaseStyles = function getBaseStyles(_ref) {
179
185
  appearance = _ref.appearance,
180
186
  isMonospaced = _ref.isMonospaced,
181
187
  maxHeight = _ref.maxHeight;
182
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, staticStyles), borderPaddingAndHeightStyles(minimumRows)), resizeStyle(resize)), borderStyle(appearance)), fontFamilyStyle(isMonospaced)), {}, {
183
- maxHeight: maxHeight
184
- });
188
+ return (// eslint-disable-next-line @repo/internal/styles/no-exported-styles
189
+ (0, _react.css)([staticStyles, borderPaddingAndHeightStyles(minimumRows), resizeStyle(resize), borderStyle(appearance), fontFamilyStyle(isMonospaced), {
190
+ maxHeight: maxHeight
191
+ }])
192
+ );
185
193
  };
186
194
 
187
195
  exports.getBaseStyles = getBaseStyles;
188
196
 
189
197
  var themeStyles = function themeStyles(props, appearance) {
190
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props, appearance)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
191
- color: props.textColor,
192
- '&:disabled': {
193
- color: props.disabledRules.textColor
194
- }
195
- });
198
+ return (// eslint-disable-next-line @repo/internal/styles/no-exported-styles
199
+ (0, _react.css)([bgAndBorderColorStyles(props, appearance), hoverBackgroundAndBorderStyles(props), placeholderStyle(props.placeholderTextColor), {
200
+ color: props.textColor,
201
+ '&:disabled': {
202
+ color: props.disabledRules.textColor
203
+ }
204
+ }])
205
+ );
196
206
  };
197
207
 
198
208
  exports.themeStyles = themeStyles;
@@ -19,11 +19,11 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
19
19
 
20
20
  var _react = _interopRequireWildcard(require("react"));
21
21
 
22
- var _core = require("@emotion/core");
22
+ var _react2 = require("@emotion/react");
23
23
 
24
24
  var _analyticsNext = require("@atlaskit/analytics-next");
25
25
 
26
- var _components = _interopRequireDefault(require("@atlaskit/theme/components"));
26
+ var _components = require("@atlaskit/theme/components");
27
27
 
28
28
  var _styles = require("./styles");
29
29
 
@@ -40,7 +40,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
40
40
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
41
 
42
42
  var packageName = "@atlaskit/textarea";
43
- var packageVersion = "4.4.0";
43
+ var packageVersion = "4.5.0";
44
44
  var analyticsParams = {
45
45
  componentName: 'textArea',
46
46
  packageName: packageName,
@@ -75,7 +75,7 @@ var TextAreaWithTokens = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
75
75
  _props$isMonospaced = props.isMonospaced,
76
76
  isMonospaced = _props$isMonospaced === void 0 ? false : _props$isMonospaced,
77
77
  _props$minimumRows = props.minimumRows,
78
- minimumRows = _props$minimumRows === void 0 ? 1 : _props$minimumRows,
78
+ minimumRows = _props$minimumRows === void 0 ? 2 : _props$minimumRows,
79
79
  theme = props.theme,
80
80
  testId = props.testId,
81
81
  _props$maxHeight = props.maxHeight,
@@ -142,9 +142,9 @@ var TextAreaWithTokens = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
142
142
  maxHeight: maxHeight
143
143
  });
144
144
  }, [minimumRows, resize, appearance, isMonospaced, maxHeight]);
145
- var textAreaStyles = [baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
146
- (0, _styles.themeStyles)(tokens, appearance)];
147
- return (0, _core.jsx)("textarea", (0, _extends2.default)({}, controlProps, {
145
+ var textAreaStyles = (0, _react2.css)([baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
146
+ (0, _styles.themeStyles)(tokens, appearance)]);
147
+ return (0, _react2.jsx)("textarea", (0, _extends2.default)({}, controlProps, {
148
148
  value: value,
149
149
  disabled: isDisabled,
150
150
  readOnly: isReadOnly,
@@ -152,7 +152,9 @@ var TextAreaWithTokens = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
152
152
  ref: getTextAreaRef,
153
153
  onChange: handleOnChange,
154
154
  onBlur: onBlurWithAnalytics,
155
- onFocus: onFocusWithAnalytics // TODO refactor to follow emotion styling rules
155
+ onFocus: onFocusWithAnalytics,
156
+ rows: minimumRows // TODO refactor to follow emotion styling rules
157
+ // see: https://product-fabric.atlassian.net/browse/DSP-6060
156
158
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
157
159
  ,
158
160
  css: textAreaStyles
@@ -169,21 +171,21 @@ var TextAreaWithTokens = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
169
171
  */
170
172
 
171
173
  var TextArea = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function TextArea(props, ref) {
172
- return (0, _core.jsx)(_components.default.Consumer, null, function (_ref) {
173
- var mode = _ref.mode;
174
- return (0, _core.jsx)(_theme.Theme.Provider, {
175
- value: props.theme
176
- }, (0, _core.jsx)(_theme.Theme.Consumer, {
177
- appearance: props.appearance || 'standard',
178
- mode: mode
179
- }, function (tokens) {
180
- return (0, _core.jsx)(TextAreaWithTokens, (0, _extends2.default)({
181
- ref: ref
182
- }, props, {
183
- tokens: tokens
184
- }));
174
+ var _useGlobalTheme = (0, _components.useGlobalTheme)(),
175
+ mode = _useGlobalTheme.mode;
176
+
177
+ return (0, _react2.jsx)(_theme.Theme.Provider, {
178
+ value: props.theme
179
+ }, (0, _react2.jsx)(_theme.Theme.Consumer, {
180
+ appearance: props.appearance || 'standard',
181
+ mode: mode
182
+ }, function (tokens) {
183
+ return (0, _react2.jsx)(TextAreaWithTokens, (0, _extends2.default)({
184
+ ref: ref
185
+ }, props, {
186
+ tokens: tokens
185
187
  }));
186
- });
188
+ }));
187
189
  }));
188
190
  TextArea.displayName = 'TextArea';
189
191
  var _default = TextArea;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/textarea",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+ import { css } from '@emotion/react';
2
3
  import { codeFontFamily as getCodeFontFamily, fontFamily as getFontFamily, fontSize as getFontSize, gridSize } from '@atlaskit/theme/constants';
3
4
  const grid = gridSize();
4
5
  const borderRadius = 3;
@@ -29,7 +30,7 @@ const borderBoxMinHeightCompact = (minimumRows, borderHeight) => {
29
30
  return contentHeightCompact + compactVerticalPadding * 2 + borderHeight * 2;
30
31
  };
31
32
 
32
- const bgAndBorderColorStyles = (props, appearance) => ({
33
+ const bgAndBorderColorStyles = (props, appearance) => css({
33
34
  '&:focus': {
34
35
  backgroundColor: props.backgroundColorFocus,
35
36
  borderColor: props.borderColorFocus
@@ -38,10 +39,12 @@ const bgAndBorderColorStyles = (props, appearance) => ({
38
39
  backgroundColor: props.backgroundColor,
39
40
  borderColor: props.borderColor
40
41
  },
42
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
41
43
  '&[data-invalid]:focus': {
42
44
  backgroundColor: props.invalidRules.backgroundColorFocus,
43
45
  borderColor: props.invalidRules.borderColorFocus
44
46
  },
47
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
45
48
  '&[data-invalid]:not(:focus)': {
46
49
  backgroundColor: props.invalidRules.backgroundColor,
47
50
  borderColor: props.invalidRules.borderColor
@@ -60,87 +63,87 @@ const bgAndBorderColorStyles = (props, appearance) => ({
60
63
  } : {})
61
64
  });
62
65
 
63
- const placeholderStyle = placeholderTextColor => ({
66
+ const placeholderStyle = placeholderTextColor => css({
64
67
  '&::placeholder': {
65
68
  color: placeholderTextColor
66
69
  }
67
70
  });
68
71
 
69
- const hoverBackgroundAndBorderStyles = props => {
70
- return {
71
- '&:hover:not(:read-only):not(:focus)': {
72
- backgroundColor: props.backgroundColorHover,
73
- borderColor: props.borderColorHover,
74
- '&:disabled': {
75
- backgroundColor: props.disabledRules.backgroundColorHover
76
- },
77
- '&[data-invalid]': {
78
- backgroundColor: props.invalidRules.backgroundColorHover
79
- }
72
+ const hoverBackgroundAndBorderStyles = props => css({
73
+ '&:hover:not(:read-only):not(:focus)': {
74
+ backgroundColor: props.backgroundColorHover,
75
+ borderColor: props.borderColorHover,
76
+ '&:disabled': {
77
+ backgroundColor: props.disabledRules.backgroundColorHover
78
+ },
79
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
80
+ '&[data-invalid]': {
81
+ backgroundColor: props.invalidRules.backgroundColorHover
80
82
  }
81
- };
82
- };
83
+ }
84
+ });
83
85
 
84
86
  const resizeStyle = resize => {
85
87
  if (resize === 'horizontal' || resize === 'vertical') {
86
- return {
88
+ return css({
87
89
  resize
88
- };
90
+ });
89
91
  }
90
92
 
91
93
  if (resize === 'auto') {
92
- return {
94
+ return css({
93
95
  resize: 'both'
94
- };
96
+ });
95
97
  }
96
98
 
97
- return {
99
+ return css({
98
100
  resize: 'none'
99
- };
101
+ });
100
102
  };
101
103
 
102
- const borderStyle = appearance => ({
104
+ const borderStyle = appearance => css({
103
105
  borderStyle: appearance === 'none' ? 'none' : 'solid'
104
106
  });
105
107
 
106
- const fontFamilyStyle = isMonospaced => ({
108
+ const fontFamilyStyle = isMonospaced => css({
107
109
  fontFamily: isMonospaced ? codeFontFamily : fontFamily
108
110
  });
109
111
 
110
112
  const borderPaddingAndHeightStyles = (minimumRows = 1) => {
111
113
  const horizontalPaddingWithoutBorderWidth = horizontalPadding - borderWidth;
112
114
  const borderHeight = borderWidth;
113
- return {
115
+ return css({
116
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
114
117
  '&[data-compact]': {
118
+ minHeight: borderBoxMinHeightCompact(minimumRows, borderHeight),
115
119
  padding: `${compactVerticalPadding}px ${horizontalPaddingWithoutBorderWidth}px`,
116
- lineHeight: lineHeightCompact / fontSize,
117
- minHeight: borderBoxMinHeightCompact(minimumRows, borderHeight)
120
+ lineHeight: lineHeightCompact / fontSize
118
121
  },
119
122
  '&:not([data-compact])': {
123
+ minHeight: borderBoxMinHeight(minimumRows, borderHeight),
120
124
  padding: `${verticalPadding}px ${horizontalPaddingWithoutBorderWidth}px`,
121
- lineHeight: lineHeightBase / fontSize,
122
- minHeight: borderBoxMinHeight(minimumRows, borderHeight)
125
+ lineHeight: lineHeightBase / fontSize
123
126
  }
124
- };
127
+ });
125
128
  };
126
129
 
127
- const staticStyles = {
128
- flex: '1 1 100%',
130
+ const staticStyles = css({
131
+ display: 'block',
132
+ boxSizing: 'border-box',
133
+ width: '100%',
134
+ minWidth: 0,
135
+ maxWidth: '100%',
136
+ margin: 0,
129
137
  position: 'relative',
138
+ flex: '1 1 100%',
130
139
  borderRadius: borderRadius,
131
- boxSizing: 'border-box',
140
+ borderWidth: borderWidth,
141
+ fontSize: fontSize,
142
+ outline: 'none',
132
143
  overflow: 'auto',
133
- transition: `background-color ${transitionDuration} ease-in-out,
144
+ transition: `background-color ${transitionDuration} ease-in-out,
134
145
  border-color ${transitionDuration} ease-in-out`,
135
146
  wordWrap: 'break-word',
136
- fontSize,
137
- borderWidth: borderWidth,
138
- maxWidth: '100%',
139
- display: 'block',
140
- margin: 0,
141
- minWidth: 0,
142
- outline: 'none',
143
- width: '100%',
144
147
  '&:disabled': {
145
148
  cursor: 'not-allowed',
146
149
  ...overrideSafariDisabledStyles
@@ -151,27 +154,21 @@ const staticStyles = {
151
154
  '&:invalid': {
152
155
  boxShadow: 'none'
153
156
  }
154
- };
157
+ });
155
158
  export const getBaseStyles = ({
156
159
  minimumRows,
157
160
  resize,
158
161
  appearance,
159
162
  isMonospaced,
160
163
  maxHeight
161
- }) => ({ ...staticStyles,
162
- ...borderPaddingAndHeightStyles(minimumRows),
163
- ...resizeStyle(resize),
164
- ...borderStyle(appearance),
165
- ...fontFamilyStyle(isMonospaced),
164
+ }) => // eslint-disable-next-line @repo/internal/styles/no-exported-styles
165
+ css([staticStyles, borderPaddingAndHeightStyles(minimumRows), resizeStyle(resize), borderStyle(appearance), fontFamilyStyle(isMonospaced), {
166
166
  maxHeight
167
- });
168
- export const themeStyles = (props, appearance) => {
169
- return { ...bgAndBorderColorStyles(props, appearance),
170
- ...hoverBackgroundAndBorderStyles(props),
171
- ...placeholderStyle(props.placeholderTextColor),
172
- color: props.textColor,
173
- '&:disabled': {
174
- color: props.disabledRules.textColor
175
- }
176
- };
177
- };
167
+ }]);
168
+ export const themeStyles = (props, appearance) => // eslint-disable-next-line @repo/internal/styles/no-exported-styles
169
+ css([bgAndBorderColorStyles(props, appearance), hoverBackgroundAndBorderStyles(props), placeholderStyle(props.placeholderTextColor), {
170
+ color: props.textColor,
171
+ '&:disabled': {
172
+ color: props.disabledRules.textColor
173
+ }
174
+ }]);
@@ -2,13 +2,13 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import React, { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/react';
6
6
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
7
- import GlobalTheme from '@atlaskit/theme/components';
7
+ import { useGlobalTheme } from '@atlaskit/theme/components';
8
8
  import { borderWidth, getBaseStyles, themeStyles } from './styles';
9
9
  import { Theme } from './theme';
10
10
  const packageName = "@atlaskit/textarea";
11
- const packageVersion = "4.4.0";
11
+ const packageVersion = "4.5.0";
12
12
  const analyticsParams = {
13
13
  componentName: 'textArea',
14
14
  packageName,
@@ -35,7 +35,7 @@ const TextAreaWithTokens = /*#__PURE__*/forwardRef((props, ref) => {
35
35
  isDisabled = false,
36
36
  isInvalid = false,
37
37
  isMonospaced = false,
38
- minimumRows = 1,
38
+ minimumRows = 2,
39
39
  theme,
40
40
  testId,
41
41
  maxHeight = '50vh',
@@ -102,8 +102,8 @@ const TextAreaWithTokens = /*#__PURE__*/forwardRef((props, ref) => {
102
102
  isMonospaced,
103
103
  maxHeight
104
104
  }), [minimumRows, resize, appearance, isMonospaced, maxHeight]);
105
- const textAreaStyles = [baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
106
- themeStyles(tokens, appearance)];
105
+ const textAreaStyles = css([baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
106
+ themeStyles(tokens, appearance)]);
107
107
  return jsx("textarea", _extends({}, controlProps, {
108
108
  value: value,
109
109
  disabled: isDisabled,
@@ -112,7 +112,9 @@ const TextAreaWithTokens = /*#__PURE__*/forwardRef((props, ref) => {
112
112
  ref: getTextAreaRef,
113
113
  onChange: handleOnChange,
114
114
  onBlur: onBlurWithAnalytics,
115
- onFocus: onFocusWithAnalytics // TODO refactor to follow emotion styling rules
115
+ onFocus: onFocusWithAnalytics,
116
+ rows: minimumRows // TODO refactor to follow emotion styling rules
117
+ // see: https://product-fabric.atlassian.net/browse/DSP-6060
116
118
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
117
119
  ,
118
120
  css: textAreaStyles
@@ -129,9 +131,10 @@ const TextAreaWithTokens = /*#__PURE__*/forwardRef((props, ref) => {
129
131
  */
130
132
 
131
133
  const TextArea = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function TextArea(props, ref) {
132
- return jsx(GlobalTheme.Consumer, null, ({
134
+ const {
133
135
  mode
134
- }) => jsx(Theme.Provider, {
136
+ } = useGlobalTheme();
137
+ return jsx(Theme.Provider, {
135
138
  value: props.theme
136
139
  }, jsx(Theme.Consumer, {
137
140
  appearance: props.appearance || 'standard',
@@ -140,7 +143,7 @@ const TextArea = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function TextArea(pr
140
143
  ref: ref
141
144
  }, props, {
142
145
  tokens: tokens
143
- })))));
146
+ }))));
144
147
  }));
145
148
  TextArea.displayName = 'TextArea';
146
149
  export default TextArea;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/textarea",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
6
 
7
7
  /** @jsx jsx */
8
+ import { css } from '@emotion/react';
8
9
  import { codeFontFamily as getCodeFontFamily, fontFamily as getFontFamily, fontSize as getFontSize, gridSize } from '@atlaskit/theme/constants';
9
10
  var grid = gridSize();
10
11
  var borderRadius = 3;
@@ -36,7 +37,7 @@ var borderBoxMinHeightCompact = function borderBoxMinHeightCompact(minimumRows,
36
37
  };
37
38
 
38
39
  var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance) {
39
- return _objectSpread({
40
+ return css(_objectSpread({
40
41
  '&:focus': {
41
42
  backgroundColor: props.backgroundColorFocus,
42
43
  borderColor: props.borderColorFocus
@@ -45,10 +46,12 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance)
45
46
  backgroundColor: props.backgroundColor,
46
47
  borderColor: props.borderColor
47
48
  },
49
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
48
50
  '&[data-invalid]:focus': {
49
51
  backgroundColor: props.invalidRules.backgroundColorFocus,
50
52
  borderColor: props.invalidRules.borderColorFocus
51
53
  },
54
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
52
55
  '&[data-invalid]:not(:focus)': {
53
56
  backgroundColor: props.invalidRules.backgroundColor,
54
57
  borderColor: props.invalidRules.borderColor
@@ -62,96 +65,98 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance)
62
65
  backgroundColor: props.disabledRules.backgroundColor,
63
66
  borderColor: props.disabledRules.borderColor
64
67
  }
65
- } : {});
68
+ } : {}));
66
69
  };
67
70
 
68
71
  var placeholderStyle = function placeholderStyle(placeholderTextColor) {
69
- return {
72
+ return css({
70
73
  '&::placeholder': {
71
74
  color: placeholderTextColor
72
75
  }
73
- };
76
+ });
74
77
  };
75
78
 
76
79
  var hoverBackgroundAndBorderStyles = function hoverBackgroundAndBorderStyles(props) {
77
- return {
80
+ return css({
78
81
  '&:hover:not(:read-only):not(:focus)': {
79
82
  backgroundColor: props.backgroundColorHover,
80
83
  borderColor: props.borderColorHover,
81
84
  '&:disabled': {
82
85
  backgroundColor: props.disabledRules.backgroundColorHover
83
86
  },
87
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
84
88
  '&[data-invalid]': {
85
89
  backgroundColor: props.invalidRules.backgroundColorHover
86
90
  }
87
91
  }
88
- };
92
+ });
89
93
  };
90
94
 
91
95
  var resizeStyle = function resizeStyle(resize) {
92
96
  if (resize === 'horizontal' || resize === 'vertical') {
93
- return {
97
+ return css({
94
98
  resize: resize
95
- };
99
+ });
96
100
  }
97
101
 
98
102
  if (resize === 'auto') {
99
- return {
103
+ return css({
100
104
  resize: 'both'
101
- };
105
+ });
102
106
  }
103
107
 
104
- return {
108
+ return css({
105
109
  resize: 'none'
106
- };
110
+ });
107
111
  };
108
112
 
109
113
  var borderStyle = function borderStyle(appearance) {
110
- return {
114
+ return css({
111
115
  borderStyle: appearance === 'none' ? 'none' : 'solid'
112
- };
116
+ });
113
117
  };
114
118
 
115
119
  var fontFamilyStyle = function fontFamilyStyle(isMonospaced) {
116
- return {
120
+ return css({
117
121
  fontFamily: isMonospaced ? codeFontFamily : fontFamily
118
- };
122
+ });
119
123
  };
120
124
 
121
125
  var borderPaddingAndHeightStyles = function borderPaddingAndHeightStyles() {
122
126
  var minimumRows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
123
127
  var horizontalPaddingWithoutBorderWidth = horizontalPadding - borderWidth;
124
128
  var borderHeight = borderWidth;
125
- return {
129
+ return css({
130
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
126
131
  '&[data-compact]': {
132
+ minHeight: borderBoxMinHeightCompact(minimumRows, borderHeight),
127
133
  padding: "".concat(compactVerticalPadding, "px ").concat(horizontalPaddingWithoutBorderWidth, "px"),
128
- lineHeight: lineHeightCompact / fontSize,
129
- minHeight: borderBoxMinHeightCompact(minimumRows, borderHeight)
134
+ lineHeight: lineHeightCompact / fontSize
130
135
  },
131
136
  '&:not([data-compact])': {
137
+ minHeight: borderBoxMinHeight(minimumRows, borderHeight),
132
138
  padding: "".concat(verticalPadding, "px ").concat(horizontalPaddingWithoutBorderWidth, "px"),
133
- lineHeight: lineHeightBase / fontSize,
134
- minHeight: borderBoxMinHeight(minimumRows, borderHeight)
139
+ lineHeight: lineHeightBase / fontSize
135
140
  }
136
- };
141
+ });
137
142
  };
138
143
 
139
- var staticStyles = {
140
- flex: '1 1 100%',
141
- position: 'relative',
142
- borderRadius: borderRadius,
144
+ var staticStyles = css({
145
+ display: 'block',
143
146
  boxSizing: 'border-box',
144
- overflow: 'auto',
145
- transition: "background-color ".concat(transitionDuration, " ease-in-out,\n border-color ").concat(transitionDuration, " ease-in-out"),
146
- wordWrap: 'break-word',
147
- fontSize: fontSize,
148
- borderWidth: borderWidth,
147
+ width: '100%',
148
+ minWidth: 0,
149
149
  maxWidth: '100%',
150
- display: 'block',
151
150
  margin: 0,
152
- minWidth: 0,
151
+ position: 'relative',
152
+ flex: '1 1 100%',
153
+ borderRadius: borderRadius,
154
+ borderWidth: borderWidth,
155
+ fontSize: fontSize,
153
156
  outline: 'none',
154
- width: '100%',
157
+ overflow: 'auto',
158
+ transition: "background-color ".concat(transitionDuration, " ease-in-out, \n border-color ").concat(transitionDuration, " ease-in-out"),
159
+ wordWrap: 'break-word',
155
160
  '&:disabled': _objectSpread({
156
161
  cursor: 'not-allowed'
157
162
  }, overrideSafariDisabledStyles),
@@ -161,22 +166,26 @@ var staticStyles = {
161
166
  '&:invalid': {
162
167
  boxShadow: 'none'
163
168
  }
164
- };
169
+ });
165
170
  export var getBaseStyles = function getBaseStyles(_ref) {
166
171
  var minimumRows = _ref.minimumRows,
167
172
  resize = _ref.resize,
168
173
  appearance = _ref.appearance,
169
174
  isMonospaced = _ref.isMonospaced,
170
175
  maxHeight = _ref.maxHeight;
171
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, staticStyles), borderPaddingAndHeightStyles(minimumRows)), resizeStyle(resize)), borderStyle(appearance)), fontFamilyStyle(isMonospaced)), {}, {
172
- maxHeight: maxHeight
173
- });
176
+ return (// eslint-disable-next-line @repo/internal/styles/no-exported-styles
177
+ css([staticStyles, borderPaddingAndHeightStyles(minimumRows), resizeStyle(resize), borderStyle(appearance), fontFamilyStyle(isMonospaced), {
178
+ maxHeight: maxHeight
179
+ }])
180
+ );
174
181
  };
175
182
  export var themeStyles = function themeStyles(props, appearance) {
176
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props, appearance)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
177
- color: props.textColor,
178
- '&:disabled': {
179
- color: props.disabledRules.textColor
180
- }
181
- });
183
+ return (// eslint-disable-next-line @repo/internal/styles/no-exported-styles
184
+ css([bgAndBorderColorStyles(props, appearance), hoverBackgroundAndBorderStyles(props), placeholderStyle(props.placeholderTextColor), {
185
+ color: props.textColor,
186
+ '&:disabled': {
187
+ color: props.disabledRules.textColor
188
+ }
189
+ }])
190
+ );
182
191
  };
@@ -10,13 +10,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
10
10
 
11
11
  /** @jsx jsx */
12
12
  import React, { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
13
- import { jsx } from '@emotion/core';
13
+ import { css, jsx } from '@emotion/react';
14
14
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
15
- import GlobalTheme from '@atlaskit/theme/components';
15
+ import { useGlobalTheme } from '@atlaskit/theme/components';
16
16
  import { borderWidth, getBaseStyles, themeStyles } from './styles';
17
17
  import { Theme } from './theme';
18
18
  var packageName = "@atlaskit/textarea";
19
- var packageVersion = "4.4.0";
19
+ var packageVersion = "4.5.0";
20
20
  var analyticsParams = {
21
21
  componentName: 'textArea',
22
22
  packageName: packageName,
@@ -52,7 +52,7 @@ var TextAreaWithTokens = /*#__PURE__*/forwardRef(function (props, ref) {
52
52
  _props$isMonospaced = props.isMonospaced,
53
53
  isMonospaced = _props$isMonospaced === void 0 ? false : _props$isMonospaced,
54
54
  _props$minimumRows = props.minimumRows,
55
- minimumRows = _props$minimumRows === void 0 ? 1 : _props$minimumRows,
55
+ minimumRows = _props$minimumRows === void 0 ? 2 : _props$minimumRows,
56
56
  theme = props.theme,
57
57
  testId = props.testId,
58
58
  _props$maxHeight = props.maxHeight,
@@ -120,8 +120,8 @@ var TextAreaWithTokens = /*#__PURE__*/forwardRef(function (props, ref) {
120
120
  maxHeight: maxHeight
121
121
  });
122
122
  }, [minimumRows, resize, appearance, isMonospaced, maxHeight]);
123
- var textAreaStyles = [baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
124
- themeStyles(tokens, appearance)];
123
+ var textAreaStyles = css([baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
124
+ themeStyles(tokens, appearance)]);
125
125
  return jsx("textarea", _extends({}, controlProps, {
126
126
  value: value,
127
127
  disabled: isDisabled,
@@ -130,7 +130,9 @@ var TextAreaWithTokens = /*#__PURE__*/forwardRef(function (props, ref) {
130
130
  ref: getTextAreaRef,
131
131
  onChange: handleOnChange,
132
132
  onBlur: onBlurWithAnalytics,
133
- onFocus: onFocusWithAnalytics // TODO refactor to follow emotion styling rules
133
+ onFocus: onFocusWithAnalytics,
134
+ rows: minimumRows // TODO refactor to follow emotion styling rules
135
+ // see: https://product-fabric.atlassian.net/browse/DSP-6060
134
136
  // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
135
137
  ,
136
138
  css: textAreaStyles
@@ -147,21 +149,21 @@ var TextAreaWithTokens = /*#__PURE__*/forwardRef(function (props, ref) {
147
149
  */
148
150
 
149
151
  var TextArea = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function TextArea(props, ref) {
150
- return jsx(GlobalTheme.Consumer, null, function (_ref) {
151
- var mode = _ref.mode;
152
- return jsx(Theme.Provider, {
153
- value: props.theme
154
- }, jsx(Theme.Consumer, {
155
- appearance: props.appearance || 'standard',
156
- mode: mode
157
- }, function (tokens) {
158
- return jsx(TextAreaWithTokens, _extends({
159
- ref: ref
160
- }, props, {
161
- tokens: tokens
162
- }));
152
+ var _useGlobalTheme = useGlobalTheme(),
153
+ mode = _useGlobalTheme.mode;
154
+
155
+ return jsx(Theme.Provider, {
156
+ value: props.theme
157
+ }, jsx(Theme.Consumer, {
158
+ appearance: props.appearance || 'standard',
159
+ mode: mode
160
+ }, function (tokens) {
161
+ return jsx(TextAreaWithTokens, _extends({
162
+ ref: ref
163
+ }, props, {
164
+ tokens: tokens
163
165
  }));
164
- });
166
+ }));
165
167
  }));
166
168
  TextArea.displayName = 'TextArea';
167
169
  export default TextArea;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/textarea",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,3 @@
1
- /** @jsx jsx */
2
- import { CSSObject } from '@emotion/core';
3
1
  import { ThemeTokens } from './theme';
4
2
  import { TextAreaProps } from './types';
5
3
  export interface StyleProps {
@@ -10,5 +8,5 @@ export interface StyleProps {
10
8
  maxHeight: string;
11
9
  }
12
10
  export declare const borderWidth = 2;
13
- export declare const getBaseStyles: ({ minimumRows, resize, appearance, isMonospaced, maxHeight, }: StyleProps) => CSSObject;
14
- export declare const themeStyles: (props: ThemeTokens, appearance: TextAreaProps['appearance']) => CSSObject;
11
+ export declare const getBaseStyles: ({ minimumRows, resize, appearance, isMonospaced, maxHeight, }: StyleProps) => import("@emotion/react").SerializedStyles;
12
+ export declare const themeStyles: (props: ThemeTokens, appearance: TextAreaProps['appearance']) => import("@emotion/react").SerializedStyles;
@@ -10,5 +10,5 @@ import { TextAreaProps } from './types';
10
10
  * - [Code](https://atlassian.design/components/textarea/code)
11
11
  * - [Usage](https://atlassian.design/components/textarea/usage)
12
12
  */
13
- declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "isCompact" | "isDisabled" | "isReadOnly" | "isRequired" | "isInvalid" | "minimumRows" | "maxHeight" | "value" | "defaultValue" | "name" | "placeholder" | "onBlur" | "onChange" | "onFocus" | "isMonospaced" | "resize" | "spellCheck" | "theme" | "testId" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "form" | "maxLength" | "minLength" | "readOnly" | "rows" | "wrap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "createAnalyticsEvent"> & React.RefAttributes<HTMLTextAreaElement>>>;
13
+ declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "isCompact" | "isDisabled" | "isReadOnly" | "isRequired" | "isInvalid" | "minimumRows" | "maxHeight" | "value" | "defaultValue" | "name" | "placeholder" | "onBlur" | "onChange" | "onFocus" | "isMonospaced" | "resize" | "spellCheck" | "theme" | "testId" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "form" | "maxLength" | "minLength" | "readOnly" | "rows" | "wrap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "createAnalyticsEvent"> & React.RefAttributes<HTMLTextAreaElement>>>;
14
14
  export default TextArea;
@@ -1,5 +1,3 @@
1
- /** @jsx jsx */
2
- import { CSSObject } from '@emotion/core';
3
1
  import { ThemeTokens } from './theme';
4
2
  import { TextAreaProps } from './types';
5
3
  export interface StyleProps {
@@ -10,5 +8,5 @@ export interface StyleProps {
10
8
  maxHeight: string;
11
9
  }
12
10
  export declare const borderWidth = 2;
13
- export declare const getBaseStyles: ({ minimumRows, resize, appearance, isMonospaced, maxHeight, }: StyleProps) => CSSObject;
14
- export declare const themeStyles: (props: ThemeTokens, appearance: TextAreaProps['appearance']) => CSSObject;
11
+ export declare const getBaseStyles: ({ minimumRows, resize, appearance, isMonospaced, maxHeight, }: StyleProps) => import("@emotion/react").SerializedStyles;
12
+ export declare const themeStyles: (props: ThemeTokens, appearance: TextAreaProps['appearance']) => import("@emotion/react").SerializedStyles;
@@ -10,5 +10,5 @@ import { TextAreaProps } from './types';
10
10
  * - [Code](https://atlassian.design/components/textarea/code)
11
11
  * - [Usage](https://atlassian.design/components/textarea/usage)
12
12
  */
13
- declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "isCompact" | "isDisabled" | "isReadOnly" | "isRequired" | "isInvalid" | "minimumRows" | "maxHeight" | "value" | "defaultValue" | "name" | "placeholder" | "onBlur" | "onChange" | "onFocus" | "isMonospaced" | "resize" | "spellCheck" | "theme" | "testId" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "form" | "maxLength" | "minLength" | "readOnly" | "rows" | "wrap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "createAnalyticsEvent"> & React.RefAttributes<HTMLTextAreaElement>>>;
13
+ declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "isCompact" | "isDisabled" | "isReadOnly" | "isRequired" | "isInvalid" | "minimumRows" | "maxHeight" | "value" | "defaultValue" | "name" | "placeholder" | "onBlur" | "onChange" | "onFocus" | "isMonospaced" | "resize" | "spellCheck" | "theme" | "testId" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "form" | "maxLength" | "minLength" | "readOnly" | "rows" | "wrap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "createAnalyticsEvent"> & React.RefAttributes<HTMLTextAreaElement>>>;
14
14
  export default TextArea;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/textarea",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "A text area lets users enter long form text which spans over multiple lines.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/theme": "^12.2.0",
43
43
  "@atlaskit/tokens": "^0.10.0",
44
44
  "@babel/runtime": "^7.0.0",
45
- "@emotion/core": "^10.0.9"
45
+ "@emotion/react": "^11.7.1"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": "^16.8.0"
@@ -51,8 +51,8 @@
51
51
  "@atlaskit/button": "^16.3.0",
52
52
  "@atlaskit/docs": "*",
53
53
  "@atlaskit/ds-lib": "^2.1.0",
54
- "@atlaskit/form": "^8.5.0",
55
- "@atlaskit/section-message": "^6.2.0",
54
+ "@atlaskit/form": "^8.6.0",
55
+ "@atlaskit/section-message": "^6.3.0",
56
56
  "@atlaskit/ssr": "*",
57
57
  "@atlaskit/visual-regression": "*",
58
58
  "@atlaskit/webdriver-runner": "*",
package/report.api.md CHANGED
@@ -1,6 +1,8 @@
1
- ## API Report File for "@atlaskit/textarea"
1
+ ## API Report File for "@atlaskit/textarea".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  /// <reference types="react" />
@@ -20,35 +22,65 @@ declare interface OwnProps extends WithAnalyticsEventsProps {
20
22
  * none prevents all field styling.
21
23
  */
22
24
  appearance?: 'standard' | 'subtle' | 'none';
23
- /** Set whether the fields should expand to fill available horizontal space. */
25
+ /**
26
+ * Set whether the fields should expand to fill available horizontal space.
27
+ */
24
28
  isCompact?: boolean;
25
- /** Sets the field as uneditable, with a changed hover state. */
29
+ /**
30
+ * Sets the field as uneditable, with a changed hover state.
31
+ */
26
32
  isDisabled?: boolean;
27
- /** If true, prevents the value of the input from being edited. */
33
+ /**
34
+ * If true, prevents the value of the input from being edited.
35
+ */
28
36
  isReadOnly?: boolean;
29
- /** Set required for form that the field is part of. */
37
+ /**
38
+ * Set required for form that the field is part of.
39
+ */
30
40
  isRequired?: boolean;
31
- /** Sets styling to indicate that the input is invalid. */
41
+ /**
42
+ * Sets styling to indicate that the input is invalid.
43
+ */
32
44
  isInvalid?: boolean;
33
- /** The minimum number of rows of text to display */
45
+ /**
46
+ * The minimum number of rows of text to display
47
+ */
34
48
  minimumRows?: number;
35
- /** The maxheight of the textarea */
49
+ /**
50
+ * The maxheight of the textarea
51
+ */
36
52
  maxHeight?: string;
37
- /** The value of the text-area. */
53
+ /**
54
+ * The value of the text-area.
55
+ */
38
56
  value?: string;
39
- /** The default value of the textarea */
57
+ /**
58
+ * The default value of the textarea
59
+ */
40
60
  defaultValue?: string;
41
- /** Name of the input form control */
61
+ /**
62
+ * Name of the input form control
63
+ */
42
64
  name?: string;
43
- /** The placeholder within the textarea */
65
+ /**
66
+ * The placeholder within the textarea
67
+ */
44
68
  placeholder?: string;
45
- /** Handler to be called when the input is blurred */
69
+ /**
70
+ * Handler to be called when the input is blurred
71
+ */
46
72
  onBlur?: React_2.FocusEventHandler<HTMLTextAreaElement>;
47
- /** Handler to be called when the input changes. */
73
+ /**
74
+ * Handler to be called when the input changes.
75
+ */
48
76
  onChange?: React_2.ChangeEventHandler<HTMLTextAreaElement>;
49
- /** Handler to be called when the input is focused */
77
+ /**
78
+ * Handler to be called when the input is focused
79
+ */
50
80
  onFocus?: React_2.FocusEventHandler<HTMLTextAreaElement>;
51
- /** Sets content text value to monospace */
81
+ /**
82
+ * Sets content text value to monospace
83
+ */
52
84
  isMonospaced?: boolean;
53
85
  /**
54
86
  * Enables the resizing of the textarea:
@@ -70,21 +102,23 @@ declare interface OwnProps extends WithAnalyticsEventsProps {
70
102
  /**
71
103
  * A `testId` prop is provided for specified elements, which is a unique
72
104
  * string that appears as a data attribute `data-testid` in the rendered code,
73
- * serving as a hook for automated tests */
105
+ * serving as a hook for automated tests
106
+ */
74
107
  testId?: string;
75
108
  }
76
109
 
77
- declare type Props = Combine<
78
- Omit<
79
- React_2.TextareaHTMLAttributes<HTMLTextAreaElement>,
80
- 'disabled' | 'required' | 'readonly'
81
- >,
82
- OwnProps
83
- >;
84
-
110
+ /**
111
+ * __Text area__
112
+ *
113
+ * A text area lets users enter long form text which spans over multiple lines.
114
+ *
115
+ * - [Examples](https://atlassian.design/components/textarea/examples)
116
+ * - [Code](https://atlassian.design/components/textarea/code)
117
+ * - [Usage](https://atlassian.design/components/textarea/usage)
118
+ */
85
119
  declare const TextArea: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
86
120
  Pick<
87
- Props,
121
+ TextAreaProps,
88
122
  | 'appearance'
89
123
  | 'color'
90
124
  | 'maxHeight'
@@ -355,7 +389,6 @@ declare const TextArea: React_2.MemoExoticComponent<React_2.ForwardRefExoticComp
355
389
  | 'onAnimationIterationCapture'
356
390
  | 'onTransitionEnd'
357
391
  | 'onTransitionEndCapture'
358
- | 'css'
359
392
  | 'isCompact'
360
393
  | 'isDisabled'
361
394
  | 'isReadOnly'
@@ -369,6 +402,19 @@ declare const TextArea: React_2.MemoExoticComponent<React_2.ForwardRefExoticComp
369
402
  >>;
370
403
  export default TextArea;
371
404
 
405
+ declare type TextAreaProps = Combine<
406
+ Omit<
407
+ React_2.TextareaHTMLAttributes<HTMLTextAreaElement>,
408
+ 'disabled' | 'required' | 'readonly'
409
+ >,
410
+ OwnProps
411
+ >;
412
+
413
+ /**
414
+ * @deprecated
415
+ * Component-level theming is deprecated in the design system.
416
+ * Components should respect the global theme.
417
+ */
372
418
  export declare const Theme: {
373
419
  Consumer: ComponentType<
374
420
  {
@@ -386,9 +432,18 @@ export declare type ThemeAppearance = 'standard' | 'subtle' | 'none';
386
432
 
387
433
  export declare type ThemeProps = {
388
434
  appearance: ThemeAppearance;
435
+ /**
436
+ * @deprecated
437
+ * Mode is deprecated and will be deleted in the future.
438
+ */
389
439
  mode: 'dark' | 'light';
390
440
  };
391
441
 
442
+ /**
443
+ * @deprecated
444
+ * Component-level theming is deprecated in the design system.
445
+ * Components should respect the global theme.
446
+ */
392
447
  export declare type ThemeTokens = {
393
448
  borderColor: string;
394
449
  borderColorFocus: string;
@@ -414,6 +469,11 @@ export declare type ThemeTokens = {
414
469
  placeholderTextColor: string;
415
470
  };
416
471
 
472
+ /**
473
+ * @deprecated
474
+ * Component-level theming is deprecated in the design system.
475
+ * Components should respect the global theme.
476
+ */
417
477
  export declare const themeTokens: {
418
478
  borderColor: {
419
479
  standard: {
@@ -445,8 +505,8 @@ export declare const themeTokens: {
445
505
  };
446
506
  backgroundColor: {
447
507
  standard: {
448
- light: 'var(--ds-background-neutral)';
449
- dark: 'var(--ds-background-neutral)';
508
+ light: 'var(--ds-background-input)';
509
+ dark: 'var(--ds-background-input)';
450
510
  };
451
511
  subtle: {
452
512
  light: string;
@@ -477,8 +537,8 @@ export declare const themeTokens: {
477
537
  dark: 'var(--ds-background-input-hovered)';
478
538
  };
479
539
  subtle: {
480
- light: 'var(--ds-background-neutral-subtle-hovered)';
481
- dark: 'var(--ds-background-neutral-subtle-hovered)';
540
+ light: 'var(--ds-background-input-hovered)';
541
+ dark: 'var(--ds-background-input-hovered)';
482
542
  };
483
543
  none: {
484
544
  light: string;
@@ -507,14 +567,14 @@ export declare const themeTokens: {
507
567
  light: {
508
568
  borderColor: 'var(--ds-border-danger)';
509
569
  borderColorFocus: 'var(--ds-border-focused)';
510
- backgroundColor: 'var(--ds-background-neutral)';
570
+ backgroundColor: 'var(--ds-background-input)';
511
571
  backgroundColorFocus: 'var(--ds-background-input-pressed)';
512
572
  backgroundColorHover: 'var(--ds-background-input-hovered)';
513
573
  };
514
574
  dark: {
515
575
  borderColor: 'var(--ds-border-danger)';
516
576
  borderColorFocus: 'var(--ds-border-focused)';
517
- backgroundColor: 'var(--ds-background-neutral)';
577
+ backgroundColor: 'var(--ds-background-input)';
518
578
  backgroundColorFocus: 'var(--ds-background-input-pressed)';
519
579
  backgroundColorHover: 'var(--ds-background-input-hovered)';
520
580
  };