@atlaskit/textarea 5.8.2 → 7.0.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,46 @@
1
1
  # @atlaskit/textarea
2
2
 
3
+ ## 7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#113290](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113290)
8
+ [`a8634aba15b6a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a8634aba15b6a) -
9
+ Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
10
+ the rest of the Atlaskit techstack, and support React 18 Streaming SSR. Please note, in order to
11
+ use this version of `@atlaskit/textarea`, you will need to ensure that your bundler is configured
12
+ to handle `.css` imports correctly.
13
+
14
+ Most bundlers come with built-in support for `.css` imports, so you may not need to do anything.
15
+ If you are using a different bundler, please refer to the documentation for that bundler to
16
+ understand how to handle `.css` imports. For more information on the migration, please refer to
17
+ [RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
18
+
19
+ Removed `styles.tsx` and `component-tokens.tsx` and their entry points
20
+ `@atlaskit/textarea/component-tokens` and `@atlaskit/textarea/styles` from `package.json`
21
+
22
+ ## 6.0.0
23
+
24
+ ### Major Changes
25
+
26
+ - [#95577](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95577)
27
+ [`ad478a9dbc399`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ad478a9dbc399) -
28
+ Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
29
+ the rest of the Atlaskit techstack, and support React 18 Streaming SSR. Please note, in order to
30
+ use this version of `@atlaskit/textarea`, you will need to ensure that your bundler is configured
31
+ to handle `.css` imports correctly.
32
+
33
+ Most bundlers come with built-in support for `.css` imports, so you may not need to do anything.
34
+ If you are using a different bundler, please refer to the documentation for that bundler to
35
+ understand how to handle `.css` imports. For more information on the migration, please refer to
36
+ [RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
37
+
38
+ Removed styles.tsx and component-tokens.tsx and their entry points from package.json
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies
43
+
3
44
  ## 5.8.2
4
45
 
5
46
  ### Patch Changes
@@ -0,0 +1,88 @@
1
+ ._11c81doa{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._2rko1sit{border-radius:var(--ds-border-radius,3px)}
4
+ ._v5641gs0{transition:var(--_19uzta9)}
5
+ ._153gksl0[data-invalid]:not(:focus){border-color:var(--_1u9fbts)}
6
+ ._189ee4h9{border-width:var(--ds-border-width,1px)}
7
+ ._19wt1elr:hover:not(:read-only):not(:focus){border-color:var(--ds-border-input,#8590a2)}
8
+ ._19wt1j28:hover:not(:read-only):not(:focus){border-color:transparent}
9
+ ._1bqs13gt:disabled:not(:focus){border-color:var(--ds-border-disabled,#091e420f)}
10
+ ._1dqoglyw{border-style:none}
11
+ ._1dqonqa1{border-style:solid}
12
+ ._1fraksl0:hover:not(:read-only):not(:focus)[data-invalid]{border-color:var(--_1u9fbts)}
13
+ ._kp821elr:not(:focus){border-color:var(--ds-border-input,#8590a2)}
14
+ ._kp821j28:not(:focus){border-color:transparent}
15
+ ._12ji1r31{outline-color:currentColor}
16
+ ._12y31o36{outline-width:medium}
17
+ ._12ym18uv:hover:not(:read-only):not(:focus){background-color:initial}
18
+ ._12ym1d5g:hover:not(:read-only):not(:focus){background-color:var(--ds-background-input-hovered,#f7f8f9)}
19
+ ._13xeglyw:invalid{box-shadow:none}
20
+ ._14zg1e08{resize:horizontal}
21
+ ._14zg1e54{resize:vertical}
22
+ ._14zg1hrf{resize:both}
23
+ ._14zgglyw{resize:none}
24
+ ._16jlkb7n{flex-grow:1}
25
+ ._16lw1cn1:not([data-compact]){min-height:var(--_n9nqvh)}
26
+ ._17km12x7:not([data-compact]){padding-left:var(--ds-space-075,6px)}
27
+ ._17km1v6z:not([data-compact]){padding-left:7px}
28
+ ._18m91wug{overflow-y:auto}
29
+ ._18u0idpf{margin-left:0}
30
+ ._19k01ouc:hover:not(:read-only):not(:focus):disabled{background-color:var(--_r5pknd)}
31
+ ._19pkidpf{margin-top:0}
32
+ ._19qkv77o[data-compact]{padding-top:var(--ds-space-025,2px)}
33
+ ._1a2sh9qi[data-invalid]:not(:focus){box-shadow:var(--_1l1juom)}
34
+ ._1a4912x7:not([data-compact]){padding-bottom:var(--ds-space-075,6px)}
35
+ ._1bsb1osq{width:100%}
36
+ ._1dbiv77o[data-compact]{padding-bottom:var(--ds-space-025,2px)}
37
+ ._1e0c1ule{display:block}
38
+ ._1etu12x7[data-compact]{padding-left:var(--ds-space-075,6px)}
39
+ ._1etu1v6z[data-compact]{padding-left:7px}
40
+ ._1goxglyw::-ms-clear{display:none}
41
+ ._1idrpsu8::-ms-input-placeholder{color:var(--_vrm7dk)}
42
+ ._1idrpsu8::placeholder{color:var(--_vrm7dk)}
43
+ ._1itd12x7:not([data-compact]){padding-top:var(--ds-space-075,6px)}
44
+ ._1lephxcb:disabled::-ms-input-placeholder{color:var(--_dnrmjm)}
45
+ ._1lephxcb:disabled::placeholder{color:var(--_dnrmjm)}
46
+ ._1ltx18uv:not(:focus){background-color:initial}
47
+ ._1ltx1j9a:not(:focus){background-color:var(--ds-background-input,#fff)}
48
+ ._1n388sxn:not([data-compact]){line-height:1.4285714285714286}
49
+ ._1o9zkb7n{flex-shrink:1}
50
+ ._1qu2glyw{outline-style:none}
51
+ ._1reo1wug{overflow-x:auto}
52
+ ._1ul9idpf{min-width:0}
53
+ ._2hwxidpf{margin-right:0}
54
+ ._6zpvh9qi:hover:not(:read-only):not(:focus)[data-invalid]{box-shadow:var(--_1l1juom)}
55
+ ._cfjqkb7n:disabled{-webkit-opacity:1}
56
+ ._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
57
+ ._ect41sbm{font-family:var(--ds-font-family-body,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
58
+ ._i0dl1osq{flex-basis:100%}
59
+ ._ibjd12ci:hover:not(:read-only):not(:focus)[data-invalid]{background-color:var(--_1z08gfx)}
60
+ ._j5dh13gf:disabled{cursor:not-allowed}
61
+ ._k3o7n7od:disabled{-webkit-text-fill-color:unset}
62
+ ._kqswh2mm{position:relative}
63
+ ._nmhq1fiz[data-compact]{line-height:1.1428571428571428}
64
+ ._otyridpf{margin-bottom:0}
65
+ ._p12f1osq{max-width:100%}
66
+ ._slp31hna{word-wrap:break-word}
67
+ ._syazovqm{color:var(--_5xk3r4)}
68
+ ._usy41kd8[data-invalid]:not(:focus){background-color:var(--_4mkb4g)}
69
+ ._uzq71d1b[data-compact]{min-height:var(--_dqsusn)}
70
+ ._vbqbhxcb:disabled{color:var(--_dnrmjm)}
71
+ ._vchhusvi{box-sizing:border-box}
72
+ ._wg6012x7:not([data-compact]){padding-right:var(--ds-space-075,6px)}
73
+ ._wg601v6z:not([data-compact]){padding-right:7px}
74
+ ._z1pvsyzs:disabled:not(:focus){background-color:var(--ds-background-disabled,#091e4208)}
75
+ ._zedr12x7[data-compact]{padding-right:var(--ds-space-075,6px)}
76
+ ._zedr1v6z[data-compact]{padding-right:7px}
77
+ ._186j1p6i:disabled:focus{border-color:var(--ds-border-focused,#388bff)}
78
+ ._1luh3zdg[data-invalid]:focus{border-color:var(--_xjqa3d)}
79
+ ._858u1j28:focus{border-color:transparent}
80
+ ._858u1p6i:focus{border-color:var(--ds-border-focused,#388bff)}
81
+ ._1vj0119y[data-invalid]:focus{box-shadow:var(--_1n75f5r)}
82
+ ._7ehi3sij:focus{box-shadow:inset 0 0 0 var(--ds-border-width,1px) transparent}
83
+ ._7ehiq049:focus{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#388bff)}
84
+ ._jomr18uv:focus{background-color:initial}
85
+ ._jomrr01l:focus{background-color:var(--ds-background-input-pressed,#fff)}
86
+ ._ndzbkwt5[data-invalid]:focus{background-color:var(--_t0vtv2)}
87
+ ._qu18syzs:disabled:focus{background-color:var(--ds-background-disabled,#091e4208)}
88
+ @media (min-width:30rem){._1tn21oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}._14mdudxr{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)!important}}
@@ -1,3 +1,4 @@
1
+ /* text-area.tsx generated by @compiled/babel-plugin v0.36.0 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -6,35 +7,56 @@ Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.default = void 0;
10
+ require("./text-area.compiled.css");
11
+ var _runtime = require("@compiled/react/runtime");
9
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
13
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
15
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
16
  var _react = _interopRequireWildcard(require("react"));
14
- var _react2 = require("@emotion/react");
15
17
  var _analyticsNext = require("@atlaskit/analytics-next");
16
- var _styles = require("./styles");
17
- var _excluded = ["resize", "appearance", "isCompact", "isRequired", "isReadOnly", "isDisabled", "isInvalid", "isMonospaced", "minimumRows", "testId", "maxHeight", "onBlur", "onFocus", "onChange", "value"];
18
- /**
19
- * @jsxRuntime classic
20
- * @jsx jsx
21
- */
22
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
+ var _colors = require("@atlaskit/theme/colors");
20
+ var _excluded = ["resize", "appearance", "isCompact", "isRequired", "isReadOnly", "isDisabled", "isInvalid", "isMonospaced", "minimumRows", "testId", "maxHeight", "onBlur", "onFocus", "onChange", "value", "style"];
23
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
24
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
26
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
27
25
  var packageName = "@atlaskit/textarea";
28
- var packageVersion = "5.8.2";
26
+ var packageVersion = "7.0.0";
29
27
  var analyticsParams = {
30
28
  componentName: 'textArea',
31
29
  packageName: packageName,
32
30
  packageVersion: packageVersion
33
31
  };
32
+ var lineHeightBase = 20;
33
+ var lineHeightCompact = 16;
34
+ var compactVerticalPadding = 2;
35
+ var verticalPadding = 6;
36
+ var transitionDuration = '0.2s';
37
+ var borderWidth = 2;
38
+ var baseStyles = null;
39
+ var appearanceStyles = {
40
+ standard: "_1dqonqa1 _kp821elr _1ltx1j9a _1bqs13gt _z1pvsyzs _19wt1elr _12ym1d5g _19qkv77o _1dbiv77o _1etu1v6z _zedr1v6z _1itd12x7 _1a4912x7 _17km1v6z _wg601v6z _858u1p6i _jomrr01l _7ehiq049 _186j1p6i _qu18syzs",
41
+ subtle: "_1dqonqa1 _kp821j28 _1ltx18uv _19wt1elr _12ym1d5g _19qkv77o _1dbiv77o _1etu1v6z _zedr1v6z _1itd12x7 _1a4912x7 _wg601v6z _17km1v6z _858u1p6i _jomrr01l _7ehiq049",
42
+ none: "_1dqoglyw _kp821j28 _1ltx18uv _19wt1j28 _12ym18uv _19qkv77o _zedr12x7 _1dbiv77o _1etu12x7 _1itd12x7 _wg6012x7 _1a4912x7 _17km12x7 _858u1j28 _jomr18uv _7ehi3sij"
43
+ };
44
+ var fontStyles = {
45
+ default: "_ect41sbm",
46
+ monospace: "_ect41odn _1tn21oud _14mdudxr",
47
+ large: "_11c81doa _1tn21oud"
48
+ };
49
+ var resizeStyles = {
50
+ horizontal: "_14zg1e08",
51
+ vertical: "_14zg1e54",
52
+ auto: "_14zg1hrf",
53
+ smart: "_14zgglyw",
54
+ none: "_14zgglyw"
55
+ };
34
56
  var setSmartHeight = function setSmartHeight(el) {
35
57
  // Always reset height to auto before calculating new height
36
58
  el.style.height = 'auto';
37
- var borderHeight = _styles.borderWidth;
59
+ var borderHeight = borderWidth;
38
60
  var paddingBoxHeight = el.scrollHeight;
39
61
  var borderBoxHeight = paddingBoxHeight + borderHeight * 2;
40
62
  el.style.height = "".concat(borderBoxHeight, "px");
@@ -66,7 +88,11 @@ var InnerTextArea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
66
88
  onFocus = props.onFocus,
67
89
  onChange = props.onChange,
68
90
  value = props.value,
91
+ style = props.style,
69
92
  rest = (0, _objectWithoutProperties2.default)(props, _excluded);
93
+ var borderHeight = (0, _react.useMemo)(function () {
94
+ return appearance === 'none' ? 2 : 1;
95
+ }, [appearance]);
70
96
  (0, _react.useEffect)(function () {
71
97
  var el = ourRef.current;
72
98
  if (resize === 'smart' && el) {
@@ -107,19 +133,8 @@ var InnerTextArea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
107
133
  'data-compact': isCompact ? isCompact : undefined,
108
134
  'data-testid': testId ? testId : undefined
109
135
  };
110
- var baseStyles = (0, _react.useMemo)(function () {
111
- return (0, _styles.getBaseStyles)({
112
- minimumRows: minimumRows,
113
- resize: resize,
114
- appearance: appearance,
115
- isMonospaced: isMonospaced,
116
- maxHeight: maxHeight
117
- });
118
- }, [minimumRows, resize, appearance, isMonospaced, maxHeight]);
119
-
120
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-array-arguments, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
121
- var textAreaStyles = (0, _react2.css)([baseStyles, (0, _styles.dynamicStyles)(appearance)]);
122
- return (0, _react2.jsx)("textarea", (0, _extends2.default)({}, controlProps, {
136
+ var compactMinHeightStyles = null;
137
+ return /*#__PURE__*/_react.default.createElement("textarea", (0, _extends2.default)({}, controlProps, {
123
138
  value: value,
124
139
  disabled: isDisabled,
125
140
  readOnly: isReadOnly,
@@ -129,12 +144,26 @@ var InnerTextArea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
129
144
  onBlur: onBlurWithAnalytics,
130
145
  onFocus: onFocusWithAnalytics,
131
146
  rows: minimumRows
132
- // TODO refactor to follow emotion styling rules
133
- // see: https://product-fabric.atlassian.net/browse/DSP-6060
134
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
135
- ,
136
- css: textAreaStyles
137
- }, rest));
147
+ }, rest, {
148
+ className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _16jlkb7n _1o9zkb7n _i0dl1osq _2rko1sit _11c81oud _12ji1r31 _1qu2glyw _12y31o36 _1reo1wug _18m91wug _v5641gs0 _189ee4h9 _1e0c1ule _vchhusvi _1bsb1osq _1ul9idpf _p12f1osq _kqswh2mm _syazovqm _slp31hna _153gksl0 _usy41kd8 _1a2sh9qi _vbqbhxcb _j5dh13gf _cfjqkb7n _k3o7n7od _1goxglyw _13xeglyw _1fraksl0 _ibjd12ci _6zpvh9qi _19k01ouc _1idrpsu8 _1lephxcb _nmhq1fiz _1n388sxn _1luh3zdg _ndzbkwt5 _1vj0119y", appearanceStyles[appearance], (0, _platformFeatureFlags.fg)('platform_design_system_team_safari_input_fix') && fontStyles['large'], fontStyles[isMonospaced ? 'monospace' : 'default'], resizeStyles[resize], "_uzq71d1b _16lw1cn1"]),
149
+ style: _objectSpread(_objectSpread({}, style), {}, {
150
+ maxHeight: maxHeight,
151
+ "--_5xk3r4": (0, _runtime.ix)("var(--ds-text, ".concat(_colors.N900, ")")),
152
+ "--_19uzta9": (0, _runtime.ix)("background-color ".concat(transitionDuration, " ease-in-out,\n border-color ").concat(transitionDuration, " ease-in-out")),
153
+ "--_dnrmjm": (0, _runtime.ix)("var(--ds-text-disabled, ".concat(_colors.N70, ")")),
154
+ "--_t0vtv2": (0, _runtime.ix)("var(--ds-background-input-pressed, ".concat(_colors.N0, ")")),
155
+ "--_xjqa3d": (0, _runtime.ix)("var(--ds-border-focused, ".concat(_colors.B200, ")")),
156
+ "--_1n75f5r": (0, _runtime.ix)("inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", "var(--ds-border-focused, ".concat(_colors.B200, ")"))),
157
+ "--_4mkb4g": (0, _runtime.ix)("var(--ds-background-input, ".concat(_colors.N10, ")")),
158
+ "--_1u9fbts": (0, _runtime.ix)("var(--ds-border-danger, ".concat(_colors.R400, ")")),
159
+ "--_1l1juom": (0, _runtime.ix)("inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", "var(--ds-border-danger, ".concat(_colors.R400, ")"))),
160
+ "--_r5pknd": (0, _runtime.ix)("var(--ds-background-disabled, ".concat(_colors.N20, ")")),
161
+ "--_1z08gfx": (0, _runtime.ix)("var(--ds-background-input-hovered, ".concat(_colors.N30, ")")),
162
+ "--_vrm7dk": (0, _runtime.ix)("var(--ds-text-subtlest, ".concat(_colors.N200, ")")),
163
+ "--_dqsusn": (0, _runtime.ix)("".concat(lineHeightCompact * minimumRows + compactVerticalPadding * 2 + borderHeight * 2, "px")),
164
+ "--_n9nqvh": (0, _runtime.ix)("".concat(lineHeightBase * minimumRows + verticalPadding * 2 + borderHeight * 2, "px"))
165
+ })
166
+ }));
138
167
  });
139
168
 
140
169
  /**
@@ -147,7 +176,7 @@ var InnerTextArea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
147
176
  * - [Usage](https://atlassian.design/components/textarea/usage)
148
177
  */
149
178
  var TextArea = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function TextArea(props, ref) {
150
- return (0, _react2.jsx)(InnerTextArea, (0, _extends2.default)({
179
+ return /*#__PURE__*/_react.default.createElement(InnerTextArea, (0, _extends2.default)({
151
180
  ref: ref
152
181
  }, props));
153
182
  }));
@@ -0,0 +1,88 @@
1
+ ._11c81doa{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._2rko1sit{border-radius:var(--ds-border-radius,3px)}
4
+ ._v564r5cv{transition:background-color .2s ease-in-out,border-color .2s ease-in-out}
5
+ ._153g78r2[data-invalid]:not(:focus){border-color:var(--ds-border-danger,#de350b)}
6
+ ._189ee4h9{border-width:var(--ds-border-width,1px)}
7
+ ._19wt1elr:hover:not(:read-only):not(:focus){border-color:var(--ds-border-input,#8590a2)}
8
+ ._19wt1j28:hover:not(:read-only):not(:focus){border-color:transparent}
9
+ ._1bqs13gt:disabled:not(:focus){border-color:var(--ds-border-disabled,#091e420f)}
10
+ ._1dqoglyw{border-style:none}
11
+ ._1dqonqa1{border-style:solid}
12
+ ._1fra78r2:hover:not(:read-only):not(:focus)[data-invalid]{border-color:var(--ds-border-danger,#de350b)}
13
+ ._kp821elr:not(:focus){border-color:var(--ds-border-input,#8590a2)}
14
+ ._kp821j28:not(:focus){border-color:transparent}
15
+ ._12ji1r31{outline-color:currentColor}
16
+ ._12y31o36{outline-width:medium}
17
+ ._12ym18uv:hover:not(:read-only):not(:focus){background-color:initial}
18
+ ._12ym1d5g:hover:not(:read-only):not(:focus){background-color:var(--ds-background-input-hovered,#f7f8f9)}
19
+ ._13xeglyw:invalid{box-shadow:none}
20
+ ._14zg1e08{resize:horizontal}
21
+ ._14zg1e54{resize:vertical}
22
+ ._14zg1hrf{resize:both}
23
+ ._14zgglyw{resize:none}
24
+ ._16jlkb7n{flex-grow:1}
25
+ ._16lwuel1:not([data-compact]){min-height:var(--_eorxnz)}
26
+ ._17km12x7:not([data-compact]){padding-left:var(--ds-space-075,6px)}
27
+ ._17km1v6z:not([data-compact]){padding-left:7px}
28
+ ._18m91wug{overflow-y:auto}
29
+ ._18u0idpf{margin-left:0}
30
+ ._19k01y1w:hover:not(:read-only):not(:focus):disabled{background-color:var(--ds-background-disabled,#f4f5f7)}
31
+ ._19pkidpf{margin-top:0}
32
+ ._19qkv77o[data-compact]{padding-top:var(--ds-space-025,2px)}
33
+ ._1a2sr6rt[data-invalid]:not(:focus){box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-danger,#de350b)}
34
+ ._1a4912x7:not([data-compact]){padding-bottom:var(--ds-space-075,6px)}
35
+ ._1bsb1osq{width:100%}
36
+ ._1dbiv77o[data-compact]{padding-bottom:var(--ds-space-025,2px)}
37
+ ._1e0c1ule{display:block}
38
+ ._1etu12x7[data-compact]{padding-left:var(--ds-space-075,6px)}
39
+ ._1etu1v6z[data-compact]{padding-left:7px}
40
+ ._1goxglyw::-ms-clear{display:none}
41
+ ._1idr1wmz::-ms-input-placeholder{color:var(--ds-text-subtlest,#6b778c)}
42
+ ._1idr1wmz::placeholder{color:var(--ds-text-subtlest,#6b778c)}
43
+ ._1itd12x7:not([data-compact]){padding-top:var(--ds-space-075,6px)}
44
+ ._1lep9jg2:disabled::-ms-input-placeholder{color:var(--ds-text-disabled,#a5adba)}
45
+ ._1lep9jg2:disabled::placeholder{color:var(--ds-text-disabled,#a5adba)}
46
+ ._1ltx18uv:not(:focus){background-color:initial}
47
+ ._1ltx1j9a:not(:focus){background-color:var(--ds-background-input,#fff)}
48
+ ._1n388sxn:not([data-compact]){line-height:1.4285714285714286}
49
+ ._1o9zkb7n{flex-shrink:1}
50
+ ._1qu2glyw{outline-style:none}
51
+ ._1reo1wug{overflow-x:auto}
52
+ ._1ul9idpf{min-width:0}
53
+ ._2hwxidpf{margin-right:0}
54
+ ._6zpvr6rt:hover:not(:read-only):not(:focus)[data-invalid]{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-danger,#de350b)}
55
+ ._cfjqkb7n:disabled{-webkit-opacity:1}
56
+ ._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
57
+ ._ect41sbm{font-family:var(--ds-font-family-body,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
58
+ ._i0dl1osq{flex-basis:100%}
59
+ ._ibjd10ko:hover:not(:read-only):not(:focus)[data-invalid]{background-color:var(--ds-background-input-hovered,#ebecf0)}
60
+ ._j5dh13gf:disabled{cursor:not-allowed}
61
+ ._k3o7n7od:disabled{-webkit-text-fill-color:unset}
62
+ ._kqswh2mm{position:relative}
63
+ ._nmhq1fiz[data-compact]{line-height:1.1428571428571428}
64
+ ._otyridpf{margin-bottom:0}
65
+ ._p12f1osq{max-width:100%}
66
+ ._slp31hna{word-wrap:break-word}
67
+ ._syazj3m3{color:var(--ds-text,#091e42)}
68
+ ._usy4mag2[data-invalid]:not(:focus){background-color:var(--ds-background-input,#fafbfc)}
69
+ ._uzq71i7i[data-compact]{min-height:var(--_6ny3x7)}
70
+ ._vbqb9jg2:disabled{color:var(--ds-text-disabled,#a5adba)}
71
+ ._vchhusvi{box-sizing:border-box}
72
+ ._wg6012x7:not([data-compact]){padding-right:var(--ds-space-075,6px)}
73
+ ._wg601v6z:not([data-compact]){padding-right:7px}
74
+ ._z1pvsyzs:disabled:not(:focus){background-color:var(--ds-background-disabled,#091e4208)}
75
+ ._zedr12x7[data-compact]{padding-right:var(--ds-space-075,6px)}
76
+ ._zedr1v6z[data-compact]{padding-right:7px}
77
+ ._186j1p6i:disabled:focus{border-color:var(--ds-border-focused,#388bff)}
78
+ ._1luh194a[data-invalid]:focus{border-color:var(--ds-border-focused,#2684ff)}
79
+ ._858u1j28:focus{border-color:transparent}
80
+ ._858u1p6i:focus{border-color:var(--ds-border-focused,#388bff)}
81
+ ._1vj01cu8[data-invalid]:focus{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#2684ff)}
82
+ ._7ehi3sij:focus{box-shadow:inset 0 0 0 var(--ds-border-width,1px) transparent}
83
+ ._7ehiq049:focus{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#388bff)}
84
+ ._jomr18uv:focus{background-color:initial}
85
+ ._jomrr01l:focus{background-color:var(--ds-background-input-pressed,#fff)}
86
+ ._ndzbr01l[data-invalid]:focus{background-color:var(--ds-background-input-pressed,#fff)}
87
+ ._qu18syzs:disabled:focus{background-color:var(--ds-background-disabled,#091e4208)}
88
+ @media (min-width:30rem){._1tn21oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}._14mdudxr{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)!important}}
@@ -1,21 +1,42 @@
1
+ /* text-area.tsx generated by @compiled/babel-plugin v0.36.0 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
3
+ import "./text-area.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
6
5
  import React, { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
- import { css, jsx } from '@emotion/react';
10
6
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
11
- import { borderWidth, dynamicStyles, getBaseStyles } from './styles';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { B200, N0, N10, N20, N200, N30, N70, N900, R400 } from '@atlaskit/theme/colors';
12
9
  const packageName = "@atlaskit/textarea";
13
- const packageVersion = "5.8.2";
10
+ const packageVersion = "7.0.0";
14
11
  const analyticsParams = {
15
12
  componentName: 'textArea',
16
13
  packageName,
17
14
  packageVersion
18
15
  };
16
+ const lineHeightBase = 20;
17
+ const lineHeightCompact = 16;
18
+ const compactVerticalPadding = 2;
19
+ const verticalPadding = 6;
20
+ const transitionDuration = '0.2s';
21
+ const borderWidth = 2;
22
+ const baseStyles = null;
23
+ const appearanceStyles = {
24
+ standard: "_1dqonqa1 _kp821elr _1ltx1j9a _1bqs13gt _z1pvsyzs _19wt1elr _12ym1d5g _19qkv77o _1dbiv77o _1etu1v6z _zedr1v6z _1itd12x7 _1a4912x7 _17km1v6z _wg601v6z _858u1p6i _jomrr01l _7ehiq049 _186j1p6i _qu18syzs",
25
+ subtle: "_1dqonqa1 _kp821j28 _1ltx18uv _19wt1elr _12ym1d5g _19qkv77o _1dbiv77o _1etu1v6z _zedr1v6z _1itd12x7 _1a4912x7 _wg601v6z _17km1v6z _858u1p6i _jomrr01l _7ehiq049",
26
+ none: "_1dqoglyw _kp821j28 _1ltx18uv _19wt1j28 _12ym18uv _19qkv77o _zedr12x7 _1dbiv77o _1etu12x7 _1itd12x7 _wg6012x7 _1a4912x7 _17km12x7 _858u1j28 _jomr18uv _7ehi3sij"
27
+ };
28
+ const fontStyles = {
29
+ default: "_ect41sbm",
30
+ monospace: "_ect41odn _1tn21oud _14mdudxr",
31
+ large: "_11c81doa _1tn21oud"
32
+ };
33
+ const resizeStyles = {
34
+ horizontal: "_14zg1e08",
35
+ vertical: "_14zg1e54",
36
+ auto: "_14zg1hrf",
37
+ smart: "_14zgglyw",
38
+ none: "_14zgglyw"
39
+ };
19
40
  const setSmartHeight = el => {
20
41
  // Always reset height to auto before calculating new height
21
42
  el.style.height = 'auto';
@@ -42,8 +63,10 @@ const InnerTextArea = /*#__PURE__*/forwardRef((props, ref) => {
42
63
  onFocus,
43
64
  onChange,
44
65
  value,
66
+ style,
45
67
  ...rest
46
68
  } = props;
69
+ const borderHeight = useMemo(() => appearance === 'none' ? 2 : 1, [appearance]);
47
70
  useEffect(() => {
48
71
  const el = ourRef.current;
49
72
  if (resize === 'smart' && el) {
@@ -86,17 +109,8 @@ const InnerTextArea = /*#__PURE__*/forwardRef((props, ref) => {
86
109
  'data-compact': isCompact ? isCompact : undefined,
87
110
  'data-testid': testId ? testId : undefined
88
111
  };
89
- const baseStyles = useMemo(() => getBaseStyles({
90
- minimumRows,
91
- resize,
92
- appearance,
93
- isMonospaced,
94
- maxHeight
95
- }), [minimumRows, resize, appearance, isMonospaced, maxHeight]);
96
-
97
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-array-arguments, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
98
- const textAreaStyles = css([baseStyles, dynamicStyles(appearance)]);
99
- return jsx("textarea", _extends({}, controlProps, {
112
+ const compactMinHeightStyles = null;
113
+ return /*#__PURE__*/React.createElement("textarea", _extends({}, controlProps, {
100
114
  value: value,
101
115
  disabled: isDisabled,
102
116
  readOnly: isReadOnly,
@@ -106,12 +120,16 @@ const InnerTextArea = /*#__PURE__*/forwardRef((props, ref) => {
106
120
  onBlur: onBlurWithAnalytics,
107
121
  onFocus: onFocusWithAnalytics,
108
122
  rows: minimumRows
109
- // TODO refactor to follow emotion styling rules
110
- // see: https://product-fabric.atlassian.net/browse/DSP-6060
111
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
112
- ,
113
- css: textAreaStyles
114
- }, rest));
123
+ }, rest, {
124
+ className: ax(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _16jlkb7n _1o9zkb7n _i0dl1osq _2rko1sit _11c81oud _12ji1r31 _1qu2glyw _12y31o36 _1reo1wug _18m91wug _v564r5cv _189ee4h9 _1e0c1ule _vchhusvi _1bsb1osq _1ul9idpf _p12f1osq _kqswh2mm _syazj3m3 _slp31hna _153g78r2 _usy4mag2 _1a2sr6rt _vbqb9jg2 _j5dh13gf _cfjqkb7n _k3o7n7od _1goxglyw _13xeglyw _1fra78r2 _ibjd10ko _6zpvr6rt _19k01y1w _1idr1wmz _1lep9jg2 _nmhq1fiz _1n388sxn _1luh194a _ndzbr01l _1vj01cu8", appearanceStyles[appearance], fg('platform_design_system_team_safari_input_fix') && fontStyles['large'], fontStyles[isMonospaced ? 'monospace' : 'default'], resizeStyles[resize], "_uzq71i7i _16lwuel1"]),
125
+ style: {
126
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
127
+ ...style,
128
+ maxHeight,
129
+ "--_6ny3x7": ix(lineHeightCompact * minimumRows + compactVerticalPadding * 2 + borderHeight * 2, "px"),
130
+ "--_eorxnz": ix(lineHeightBase * minimumRows + verticalPadding * 2 + borderHeight * 2, "px")
131
+ }
132
+ }));
115
133
  });
116
134
 
117
135
  /**
@@ -124,7 +142,7 @@ const InnerTextArea = /*#__PURE__*/forwardRef((props, ref) => {
124
142
  * - [Usage](https://atlassian.design/components/textarea/usage)
125
143
  */
126
144
  const TextArea = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function TextArea(props, ref) {
127
- return jsx(InnerTextArea, _extends({
145
+ return /*#__PURE__*/React.createElement(InnerTextArea, _extends({
128
146
  ref: ref
129
147
  }, props));
130
148
  }));
@@ -0,0 +1,88 @@
1
+ ._11c81doa{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._2rko1sit{border-radius:var(--ds-border-radius,3px)}
4
+ ._v5641gs0{transition:var(--_19uzta9)}
5
+ ._153gksl0[data-invalid]:not(:focus){border-color:var(--_1u9fbts)}
6
+ ._189ee4h9{border-width:var(--ds-border-width,1px)}
7
+ ._19wt1elr:hover:not(:read-only):not(:focus){border-color:var(--ds-border-input,#8590a2)}
8
+ ._19wt1j28:hover:not(:read-only):not(:focus){border-color:transparent}
9
+ ._1bqs13gt:disabled:not(:focus){border-color:var(--ds-border-disabled,#091e420f)}
10
+ ._1dqoglyw{border-style:none}
11
+ ._1dqonqa1{border-style:solid}
12
+ ._1fraksl0:hover:not(:read-only):not(:focus)[data-invalid]{border-color:var(--_1u9fbts)}
13
+ ._kp821elr:not(:focus){border-color:var(--ds-border-input,#8590a2)}
14
+ ._kp821j28:not(:focus){border-color:transparent}
15
+ ._12ji1r31{outline-color:currentColor}
16
+ ._12y31o36{outline-width:medium}
17
+ ._12ym18uv:hover:not(:read-only):not(:focus){background-color:initial}
18
+ ._12ym1d5g:hover:not(:read-only):not(:focus){background-color:var(--ds-background-input-hovered,#f7f8f9)}
19
+ ._13xeglyw:invalid{box-shadow:none}
20
+ ._14zg1e08{resize:horizontal}
21
+ ._14zg1e54{resize:vertical}
22
+ ._14zg1hrf{resize:both}
23
+ ._14zgglyw{resize:none}
24
+ ._16jlkb7n{flex-grow:1}
25
+ ._16lw1cn1:not([data-compact]){min-height:var(--_n9nqvh)}
26
+ ._17km12x7:not([data-compact]){padding-left:var(--ds-space-075,6px)}
27
+ ._17km1v6z:not([data-compact]){padding-left:7px}
28
+ ._18m91wug{overflow-y:auto}
29
+ ._18u0idpf{margin-left:0}
30
+ ._19k01ouc:hover:not(:read-only):not(:focus):disabled{background-color:var(--_r5pknd)}
31
+ ._19pkidpf{margin-top:0}
32
+ ._19qkv77o[data-compact]{padding-top:var(--ds-space-025,2px)}
33
+ ._1a2sh9qi[data-invalid]:not(:focus){box-shadow:var(--_1l1juom)}
34
+ ._1a4912x7:not([data-compact]){padding-bottom:var(--ds-space-075,6px)}
35
+ ._1bsb1osq{width:100%}
36
+ ._1dbiv77o[data-compact]{padding-bottom:var(--ds-space-025,2px)}
37
+ ._1e0c1ule{display:block}
38
+ ._1etu12x7[data-compact]{padding-left:var(--ds-space-075,6px)}
39
+ ._1etu1v6z[data-compact]{padding-left:7px}
40
+ ._1goxglyw::-ms-clear{display:none}
41
+ ._1idrpsu8::-ms-input-placeholder{color:var(--_vrm7dk)}
42
+ ._1idrpsu8::placeholder{color:var(--_vrm7dk)}
43
+ ._1itd12x7:not([data-compact]){padding-top:var(--ds-space-075,6px)}
44
+ ._1lephxcb:disabled::-ms-input-placeholder{color:var(--_dnrmjm)}
45
+ ._1lephxcb:disabled::placeholder{color:var(--_dnrmjm)}
46
+ ._1ltx18uv:not(:focus){background-color:initial}
47
+ ._1ltx1j9a:not(:focus){background-color:var(--ds-background-input,#fff)}
48
+ ._1n388sxn:not([data-compact]){line-height:1.4285714285714286}
49
+ ._1o9zkb7n{flex-shrink:1}
50
+ ._1qu2glyw{outline-style:none}
51
+ ._1reo1wug{overflow-x:auto}
52
+ ._1ul9idpf{min-width:0}
53
+ ._2hwxidpf{margin-right:0}
54
+ ._6zpvh9qi:hover:not(:read-only):not(:focus)[data-invalid]{box-shadow:var(--_1l1juom)}
55
+ ._cfjqkb7n:disabled{-webkit-opacity:1}
56
+ ._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
57
+ ._ect41sbm{font-family:var(--ds-font-family-body,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
58
+ ._i0dl1osq{flex-basis:100%}
59
+ ._ibjd12ci:hover:not(:read-only):not(:focus)[data-invalid]{background-color:var(--_1z08gfx)}
60
+ ._j5dh13gf:disabled{cursor:not-allowed}
61
+ ._k3o7n7od:disabled{-webkit-text-fill-color:unset}
62
+ ._kqswh2mm{position:relative}
63
+ ._nmhq1fiz[data-compact]{line-height:1.1428571428571428}
64
+ ._otyridpf{margin-bottom:0}
65
+ ._p12f1osq{max-width:100%}
66
+ ._slp31hna{word-wrap:break-word}
67
+ ._syazovqm{color:var(--_5xk3r4)}
68
+ ._usy41kd8[data-invalid]:not(:focus){background-color:var(--_4mkb4g)}
69
+ ._uzq71d1b[data-compact]{min-height:var(--_dqsusn)}
70
+ ._vbqbhxcb:disabled{color:var(--_dnrmjm)}
71
+ ._vchhusvi{box-sizing:border-box}
72
+ ._wg6012x7:not([data-compact]){padding-right:var(--ds-space-075,6px)}
73
+ ._wg601v6z:not([data-compact]){padding-right:7px}
74
+ ._z1pvsyzs:disabled:not(:focus){background-color:var(--ds-background-disabled,#091e4208)}
75
+ ._zedr12x7[data-compact]{padding-right:var(--ds-space-075,6px)}
76
+ ._zedr1v6z[data-compact]{padding-right:7px}
77
+ ._186j1p6i:disabled:focus{border-color:var(--ds-border-focused,#388bff)}
78
+ ._1luh3zdg[data-invalid]:focus{border-color:var(--_xjqa3d)}
79
+ ._858u1j28:focus{border-color:transparent}
80
+ ._858u1p6i:focus{border-color:var(--ds-border-focused,#388bff)}
81
+ ._1vj0119y[data-invalid]:focus{box-shadow:var(--_1n75f5r)}
82
+ ._7ehi3sij:focus{box-shadow:inset 0 0 0 var(--ds-border-width,1px) transparent}
83
+ ._7ehiq049:focus{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#388bff)}
84
+ ._jomr18uv:focus{background-color:initial}
85
+ ._jomrr01l:focus{background-color:var(--ds-background-input-pressed,#fff)}
86
+ ._ndzbkwt5[data-invalid]:focus{background-color:var(--_t0vtv2)}
87
+ ._qu18syzs:disabled:focus{background-color:var(--ds-background-disabled,#091e4208)}
88
+ @media (min-width:30rem){._1tn21oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}._14mdudxr{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)!important}}