@atlaskit/textfield 6.8.3 → 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,21 @@
1
1
  # @atlaskit/textfield
2
2
 
3
+ ## 7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#114073](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114073)
8
+ [`b5b9031ffaa05`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b5b9031ffaa05) -
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/textfield`, 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
+
3
19
  ## 6.8.3
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1,80 @@
1
+
2
+ ._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)}
3
+ ._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)}
4
+ ._19itidpf{border:0}
5
+ ._1tnq1l7b._1tnq1l7b{border-radius:3px}
6
+ ._v564r5cv{transition:background-color .2s ease-in-out,border-color .2s ease-in-out}
7
+ ._189ee4h9{border-width:var(--ds-border-width,1px)}
8
+ ._1dqoglyw{border-style:none}
9
+ ._1dqonqa1{border-style:solid}
10
+ ._1h6d1bqt, ._4cvx1bqt:hover{border-color:var(--ds-border-danger,#e2483d)}
11
+ ._1h6d1elr{border-color:var(--ds-border-input,#8590a2)}
12
+ ._1h6d1j28{border-color:transparent}
13
+ ._1h6dsyzs{border-color:var(--ds-background-disabled,#091e4208)}
14
+ ._11zpv77o[data-compact]{padding-block-end:var(--ds-space-025,2px)}
15
+ ._12ji1r31{outline-color:currentColor}
16
+ ._12y31o36{outline-width:medium}
17
+ ._13xeglyw:invalid{box-shadow:none}
18
+ ._141f12x7[data-compact]{padding-inline-start:var(--ds-space-075,6px)}
19
+ ._14ji12x7:not([data-compact]){padding-block-end:var(--ds-space-075,6px)}
20
+ ._14jiu2gc:not([data-compact]){padding-block-end:var(--ds-space-100,8px)}
21
+ ._16hg1j28._16hg1j28{background-color:transparent}
22
+ ._16jlkb7n{flex-grow:1}
23
+ ._16qs13x5, ._1dbz13x5:hover{box-shadow:var(--_x5k4n9)}
24
+ ._18m915vq{overflow-y:hidden}
25
+ ._1bah1yb4{justify-content:space-between}
26
+ ._1bsb1osq{width:100%}
27
+ ._1e0c1txw{display:flex}
28
+ ._1goxglyw::-ms-clear{display:none}
29
+ ._1idr131l::-ms-input-placeholder{color:var(--ds-text-subtlest,#626f86)}
30
+ ._1idr131l::placeholder{color:var(--ds-text-subtlest,#626f86)}
31
+ ._1kod12x7:not([data-compact]){padding-inline-end:var(--ds-space-075,6px)}
32
+ ._1l02v77o[data-compact]{padding-block-start:var(--ds-space-025,2px)}
33
+ ._1n7e1l2s:placeholder-shown{text-overflow:ellipsis}
34
+ ._1o9zkb7n{flex-shrink:1}
35
+ ._1q511b66{padding-block-start:var(--ds-space-050,4px)}
36
+ ._1q51e4h9{padding-block-start:var(--ds-border-width,1px)}
37
+ ._1qu2glyw{outline-style:none}
38
+ ._1reo15vq{overflow-x:hidden}
39
+ ._1ul9idpf{min-width:0}
40
+ ._3hog1lh4::-ms-input-placeholder:disabled{color:var(--ds-text-disabled,#091e424f)}
41
+ ._3hog1lh4::placeholder:disabled{color:var(--ds-text-disabled,#091e424f)}
42
+ ._4cvr1h6o{align-items:center}
43
+ ._7ba012x7:not([data-compact]){padding-inline-start:var(--ds-space-075,6px)}
44
+ ._80om13gf{cursor:not-allowed}
45
+ ._80om1kdv{cursor:text}
46
+ ._80om1kw7{cursor:inherit}
47
+ ._85i51b66{padding-block-end:var(--ds-space-050,4px)}
48
+ ._85i5e4h9{padding-block-end:var(--ds-border-width,1px)}
49
+ ._bfhk1j28{background-color:transparent}
50
+ ._bfhk1j9a{background-color:var(--ds-background-input,#fff)}
51
+ ._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
52
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
53
+ ._bozgidpf{padding-inline-start:0}
54
+ ._daj712x7[data-compact]{padding-inline-end:var(--ds-space-075,6px)}
55
+ ._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
56
+ ._i0dl1osq{flex-basis:100%}
57
+ ._lcxv1wug{pointer-events:auto}
58
+ ._olc612x7:not([data-compact]){padding-block-start:var(--ds-space-075,6px)}
59
+ ._olc6u2gc:not([data-compact]){padding-block-start:var(--ds-space-100,8px)}
60
+ ._oo9g1lh4{-webkit-text-fill-color:var(--ds-text-disabled,#091e424f)}
61
+ ._s7n4jp4b{vertical-align:top}
62
+ ._slp31hna{word-wrap:break-word}
63
+ ._syaz1fxt{color:var(--ds-text,#172b4d)}
64
+ ._syaz1kw7{color:inherit}
65
+ ._syaz1lh4{color:var(--ds-text-disabled,#091e424f)}
66
+ ._vchhusvi{box-sizing:border-box}
67
+ ._y4ti12x7{padding-inline-end:var(--ds-space-075,6px)}
68
+ ._y4tiidpf{padding-inline-end:0}
69
+ ._ochr1j28._ochr1j28:focus-within{border-color:transparent}
70
+ ._ochr1p6i._ochr1p6i:focus-within{border-color:var(--ds-border-focused,#388bff)}._10j7r01l:focus-within{background-color:var(--ds-background-input-pressed,#fff)}
71
+ ._195e1j28._195e1j28:focus-within{background-color:transparent}
72
+ ._195er01l._195er01l:focus-within{background-color:var(--ds-background-input-pressed,#fff)}
73
+ ._bqht3sij._bqht3sij:focus-within{box-shadow:inset 0 0 0 var(--ds-border-width,1px) transparent}
74
+ ._bqhtq049._bqhtq049:focus-within{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#388bff)}
75
+ ._4cvx1elr:hover{border-color:var(--ds-border-input,#8590a2)}
76
+ ._4cvx1j28:hover{border-color:transparent}
77
+ ._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
78
+ ._irr31j28:hover{background-color:transparent}
79
+ @media screen and (-ms-high-contrast:active){._1fnx18qt{color:GrayText}._6up518qt{border-color:GrayText}._srjtgir2:focus-within{border-color:Highlight}}
80
+ @media (min-width:30rem){._14md1odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}._1srd1b66[data-compact]{padding-block-end:var(--ds-space-050,4px)}._oi9h1b66[data-compact]{padding-block-start:var(--ds-space-050,4px)}._1e3012x7[data-compact]{padding-inline-end:var(--ds-space-075,6px)}._1txv12x7[data-compact]{padding-inline-start:var(--ds-space-075,6px)}._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)}._l9oiu2gc:not([data-compact]){padding-block-end:var(--ds-space-100,8px)}._549yu2gc:not([data-compact]){padding-block-start:var(--ds-space-100,8px)}._1h5w12x7:not([data-compact]){padding-inline-end:var(--ds-space-075,6px)}._124212x7:not([data-compact]){padding-inline-start:var(--ds-space-075,6px)}}
@@ -1,3 +1,4 @@
1
+ /* text-field.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -6,29 +7,75 @@ Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.default = void 0;
10
+ require("./text-field.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");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
19
  var _excluded = ["appearance", "className", "elemAfterInput", "elemBeforeInput", "isCompact", "isDisabled", "isInvalid", "isMonospaced", "isReadOnly", "isRequired", "name", "onBlur", "onChange", "onFocus", "onMouseDown", "placeholder", "testId", "width"];
18
- /**
19
- * @jsxRuntime classic
20
- * @jsx jsx
21
- */
22
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
23
20
  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
21
  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
22
  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
23
  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; }
24
+ var containerMedia = {
25
+ invalid: "_srjtgir2",
26
+ disabled: "_6up518qt"
27
+ };
28
+ var inputMediaDisabled = null;
27
29
  var analyticsParams = {
28
30
  componentName: 'textField',
29
31
  packageName: "@atlaskit/textfield",
30
- packageVersion: "6.8.3"
32
+ packageVersion: "7.0.0"
33
+ };
34
+ var disabledStyle = {
35
+ standard: "_1h6dsyzs _bfhksyzs _syaz1lh4 _80om13gf",
36
+ subtle: "_1h6d1j28 _bfhk1j28 _syaz1lh4 _80om13gf",
37
+ none: "_1h6d1j28 _bfhk1j28 _syaz1lh4 _80om13gf"
38
+ };
39
+ var invalidStyle = null;
40
+ var focusWithinStyle = {
41
+ standard: "_ochr1p6i _195er01l _bqhtq049",
42
+ subtle: "_ochr1p6i _195er01l _bqhtq049",
43
+ none: "_ochr1j28 _195e1j28 _bqht3sij"
44
+ };
45
+ var hoverStyle = {
46
+ standard: "_4cvx1elr _irr31d5g",
47
+ subtle: "_4cvx1elr _irr31d5g",
48
+ none: "_4cvx1j28 _irr31j28"
31
49
  };
50
+ var getContainerTextBgAndBorderColor = {
51
+ standard: "_1h6d1elr _1dqonqa1 _syaz1fxt _80om1kdv _bfhk1j9a _srjtgir2",
52
+ subtle: "_1h6d1j28 _1dqonqa1 _syaz1fxt _80om1kdv _16hg1j28 _srjtgir2",
53
+ none: "_1h6d1j28 _1dqoglyw _syaz1fxt _80om1kdv _16hg1j28 _srjtgir2"
54
+ };
55
+ var widthMap = {
56
+ xsmall: 80,
57
+ small: 160,
58
+ medium: 240,
59
+ large: 320,
60
+ xlarge: 480
61
+ };
62
+ var getMaxWidth = function getMaxWidth(width) {
63
+ return !width ? "100%" : width in widthMap ? "".concat(widthMap[width], "px") : "".concat(+width, "px");
64
+ };
65
+ var containerStyleAppearance = {
66
+ standard: "_1dqonqa1 _1q51e4h9 _85i5e4h9 _bozgidpf _y4tiidpf",
67
+ subtle: "_1dqonqa1 _1q51e4h9 _85i5e4h9 _bozgidpf _y4tiidpf",
68
+ none: "_1dqoglyw"
69
+ };
70
+ var containerStyles = null;
71
+ var inputDisabledStyle = null;
72
+ var inputCompactStyleWithFg = null;
73
+ var inputCompactStyle = null;
74
+ var inputMonospacedStyle = null;
75
+ var inputFontStyleWithFG = null;
76
+ var inputStyleMonospacedWithFg = null;
77
+ var inputStyleNotDataCompactWithFG = null;
78
+ var inputStyle = null;
32
79
 
33
80
  /**
34
81
  * __Textfield__
@@ -103,52 +150,39 @@ var Textfield = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
103
150
  ref(inputElement);
104
151
  }
105
152
  }, [ref]);
106
- var containerStyles = (0, _react.useMemo)(function () {
107
- return (0, _styles.containerStyles)(appearance, width);
108
- }, [appearance, width]);
109
- var inputStyle = (0, _styles.inputStyles)();
110
- return (
111
- /**
112
- * It is not normally acceptable to add click and key handlers to
113
- * non-interactive elements as this is an accessibility anti-pattern.
114
- * However, because this instance is to handle events on all children that
115
- * should be associated with the input, we can add role="presentation" so
116
- * that there are no negative impacts to assistive technologies.
117
- */
118
- (0, _react2.jsx)("div", {
119
- role: "presentation",
120
- "data-disabled": isDisabled ? isDisabled : undefined,
121
- "data-invalid": isInvalid ? isInvalid : undefined,
122
- "data-ds--text-field--container": true,
123
- "data-testid": testId && "".concat(testId, "-container"),
124
- onMouseDown: handleOnMouseDown
125
- // TODO: When removing legacy theming fix this.
126
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
127
- ,
128
- css: containerStyles
129
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
130
- ,
131
- className: className
132
- }, elemBeforeInput, (0, _react2.jsx)("input", (0, _extends2.default)({}, spreadProps, {
133
- "aria-invalid": isInvalid ? isInvalid : undefined
134
- // TODO: When removing legacy theming fix this.
135
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
136
- ,
137
- css: inputStyle,
138
- "data-compact": isCompact ? isCompact : undefined,
139
- "data-ds--text-field--input": true,
140
- "data-monospaced": isMonospaced ? isMonospaced : undefined,
141
- "data-testid": testId,
142
- disabled: isDisabled,
143
- name: name,
144
- onBlur: handleOnBlur,
145
- onChange: onChange,
146
- onFocus: handleOnFocus,
147
- placeholder: placeholder,
148
- readOnly: isReadOnly,
149
- ref: setInputRef,
150
- required: isRequired
151
- })), elemAfterInput)
152
- );
153
+ return /*#__PURE__*/_react.default.createElement("div", {
154
+ role: "presentation",
155
+ "data-disabled": isDisabled ? isDisabled : undefined,
156
+ "data-invalid": isInvalid ? isInvalid : undefined,
157
+ "data-ds--text-field--container": true,
158
+ "data-testid": testId && "".concat(testId, "-container"),
159
+ onMouseDown: handleOnMouseDown,
160
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
161
+ className: (0, _runtime.ax)(["_16jlkb7n _1o9zkb7n _i0dl1osq _11c81oud _1reo15vq _18m915vq _v564r5cv _189ee4h9 _1e0c1txw _vchhusvi _4cvr1h6o _1bah1yb4 _lcxv1wug _s7n4jp4b _slp31hna _1tnq1l7b", getContainerTextBgAndBorderColor[appearance], containerStyleAppearance[appearance], !isDisabled && focusWithinStyle[appearance], !isDisabled && hoverStyle[appearance], isDisabled && containerMedia.disabled, isDisabled && disabledStyle[appearance], isInvalid && containerMedia.invalid, isInvalid && "_1h6d1bqt _4cvx1bqt _16qs13x5 _1dbz13x5 _10j7r01l", className]),
162
+ style: {
163
+ maxWidth: "".concat(getMaxWidth(width)),
164
+ "--_x5k4n9": (0, _runtime.ix)("inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", "var(--ds-border-danger, #E2483D)"))
165
+ }
166
+ }, elemBeforeInput, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, spreadProps, {
167
+ "aria-invalid": isInvalid ? isInvalid : undefined
168
+ // TODO: When removing legacy theming fix this.
169
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
170
+ ,
171
+
172
+ "data-compact": isCompact ? isCompact : undefined,
173
+ "data-ds--text-field--input": true,
174
+ "data-monospaced": isMonospaced ? isMonospaced : undefined,
175
+ "data-testid": testId,
176
+ disabled: isDisabled,
177
+ name: name,
178
+ onBlur: handleOnBlur,
179
+ onChange: onChange,
180
+ onFocus: handleOnFocus,
181
+ placeholder: placeholder,
182
+ readOnly: isReadOnly,
183
+ ref: setInputRef,
184
+ required: isRequired,
185
+ className: (0, _runtime.ax)(["_19itidpf _11c81oud _12ji1r31 _1qu2glyw _12y31o36 _vchhusvi _1bsb1osq _1ul9idpf _bfhk1j28 _syaz1kw7 _80om1kw7 _14jiu2gc _olc6u2gc _1kod12x7 _7ba012x7 _1goxglyw _13xeglyw _1n7e1l2s _1idr131l _3hog1lh4", isMonospaced && "_ect41odn", isCompact && "_85i51b66 _1q511b66 _y4ti12x7 _bozg12x7", isDisabled && "_oo9g1lh4", isDisabled && "_1fnx18qt", !isCompact && (0, _platformFeatureFlags.fg)('platform_design_system_team_safari_input_fix') && "_14ji12x7 _olc612x7 _1kod12x7 _7ba012x7 _l9oiu2gc _549yu2gc _1h5w12x7 _124212x7", (0, _platformFeatureFlags.fg)('platform_design_system_team_safari_input_fix') && "_11c81doa _1tn21oud", isCompact && (0, _platformFeatureFlags.fg)('platform_design_system_team_safari_input_fix') && "_11zpv77o _1l02v77o _daj712x7 _141f12x7 _1srd1b66 _oi9h1b66 _1e3012x7 _1txv12x7", isMonospaced && (0, _platformFeatureFlags.fg)('platform_design_system_team_safari_input_fix') && "_ect41odn _14md1odn"])
186
+ })), elemAfterInput);
153
187
  });
154
188
  var _default = exports.default = Textfield;
@@ -0,0 +1,80 @@
1
+
2
+ ._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)}
3
+ ._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)}
4
+ ._19itidpf{border:0}
5
+ ._1tnq1l7b._1tnq1l7b{border-radius:3px}
6
+ ._v564r5cv{transition:background-color .2s ease-in-out,border-color .2s ease-in-out}
7
+ ._189ee4h9{border-width:var(--ds-border-width,1px)}
8
+ ._1dqoglyw{border-style:none}
9
+ ._1dqonqa1{border-style:solid}
10
+ ._1h6d1bqt, ._4cvx1bqt:hover{border-color:var(--ds-border-danger,#e2483d)}
11
+ ._1h6d1elr{border-color:var(--ds-border-input,#8590a2)}
12
+ ._1h6d1j28{border-color:transparent}
13
+ ._1h6dsyzs{border-color:var(--ds-background-disabled,#091e4208)}
14
+ ._11zpv77o[data-compact]{padding-block-end:var(--ds-space-025,2px)}
15
+ ._12ji1r31{outline-color:currentColor}
16
+ ._12y31o36{outline-width:medium}
17
+ ._13xeglyw:invalid{box-shadow:none}
18
+ ._141f12x7[data-compact]{padding-inline-start:var(--ds-space-075,6px)}
19
+ ._14ji12x7:not([data-compact]){padding-block-end:var(--ds-space-075,6px)}
20
+ ._14jiu2gc:not([data-compact]){padding-block-end:var(--ds-space-100,8px)}
21
+ ._16hg1j28._16hg1j28{background-color:transparent}
22
+ ._16jlkb7n{flex-grow:1}
23
+ ._16qsizbr, ._1dbzizbr:hover{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-danger,#e2483d)}
24
+ ._18m915vq{overflow-y:hidden}
25
+ ._1bah1yb4{justify-content:space-between}
26
+ ._1bsb1osq{width:100%}
27
+ ._1e0c1txw{display:flex}
28
+ ._1goxglyw::-ms-clear{display:none}
29
+ ._1idr131l::-ms-input-placeholder{color:var(--ds-text-subtlest,#626f86)}
30
+ ._1idr131l::placeholder{color:var(--ds-text-subtlest,#626f86)}
31
+ ._1kod12x7:not([data-compact]){padding-inline-end:var(--ds-space-075,6px)}
32
+ ._1l02v77o[data-compact]{padding-block-start:var(--ds-space-025,2px)}
33
+ ._1n7e1l2s:placeholder-shown{text-overflow:ellipsis}
34
+ ._1o9zkb7n{flex-shrink:1}
35
+ ._1q511b66{padding-block-start:var(--ds-space-050,4px)}
36
+ ._1q51e4h9{padding-block-start:var(--ds-border-width,1px)}
37
+ ._1qu2glyw{outline-style:none}
38
+ ._1reo15vq{overflow-x:hidden}
39
+ ._1ul9idpf{min-width:0}
40
+ ._3hog1lh4::-ms-input-placeholder:disabled{color:var(--ds-text-disabled,#091e424f)}
41
+ ._3hog1lh4::placeholder:disabled{color:var(--ds-text-disabled,#091e424f)}
42
+ ._4cvr1h6o{align-items:center}
43
+ ._7ba012x7:not([data-compact]){padding-inline-start:var(--ds-space-075,6px)}
44
+ ._80om13gf{cursor:not-allowed}
45
+ ._80om1kdv{cursor:text}
46
+ ._80om1kw7{cursor:inherit}
47
+ ._85i51b66{padding-block-end:var(--ds-space-050,4px)}
48
+ ._85i5e4h9{padding-block-end:var(--ds-border-width,1px)}
49
+ ._bfhk1j28{background-color:transparent}
50
+ ._bfhk1j9a{background-color:var(--ds-background-input,#fff)}
51
+ ._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
52
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
53
+ ._bozgidpf{padding-inline-start:0}
54
+ ._daj712x7[data-compact]{padding-inline-end:var(--ds-space-075,6px)}
55
+ ._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
56
+ ._i0dl1osq{flex-basis:100%}
57
+ ._lcxv1wug{pointer-events:auto}
58
+ ._olc612x7:not([data-compact]){padding-block-start:var(--ds-space-075,6px)}
59
+ ._olc6u2gc:not([data-compact]){padding-block-start:var(--ds-space-100,8px)}
60
+ ._oo9g1lh4{-webkit-text-fill-color:var(--ds-text-disabled,#091e424f)}
61
+ ._s7n4jp4b{vertical-align:top}
62
+ ._slp31hna{word-wrap:break-word}
63
+ ._syaz1fxt{color:var(--ds-text,#172b4d)}
64
+ ._syaz1kw7{color:inherit}
65
+ ._syaz1lh4{color:var(--ds-text-disabled,#091e424f)}
66
+ ._vchhusvi{box-sizing:border-box}
67
+ ._y4ti12x7{padding-inline-end:var(--ds-space-075,6px)}
68
+ ._y4tiidpf{padding-inline-end:0}
69
+ ._ochr1j28._ochr1j28:focus-within{border-color:transparent}
70
+ ._ochr1p6i._ochr1p6i:focus-within{border-color:var(--ds-border-focused,#388bff)}._10j7r01l:focus-within{background-color:var(--ds-background-input-pressed,#fff)}
71
+ ._195e1j28._195e1j28:focus-within{background-color:transparent}
72
+ ._195er01l._195er01l:focus-within{background-color:var(--ds-background-input-pressed,#fff)}
73
+ ._bqht3sij._bqht3sij:focus-within{box-shadow:inset 0 0 0 var(--ds-border-width,1px) transparent}
74
+ ._bqhtq049._bqhtq049:focus-within{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#388bff)}
75
+ ._4cvx1elr:hover{border-color:var(--ds-border-input,#8590a2)}
76
+ ._4cvx1j28:hover{border-color:transparent}
77
+ ._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
78
+ ._irr31j28:hover{background-color:transparent}
79
+ @media screen and (-ms-high-contrast:active){._1fnx18qt{color:GrayText}._6up518qt{border-color:GrayText}._srjtgir2:focus-within{border-color:Highlight}}
80
+ @media (min-width:30rem){._14md1odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}._1srd1b66[data-compact]{padding-block-end:var(--ds-space-050,4px)}._oi9h1b66[data-compact]{padding-block-start:var(--ds-space-050,4px)}._1e3012x7[data-compact]{padding-inline-end:var(--ds-space-075,6px)}._1txv12x7[data-compact]{padding-inline-start:var(--ds-space-075,6px)}._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)}._l9oiu2gc:not([data-compact]){padding-block-end:var(--ds-space-100,8px)}._549yu2gc:not([data-compact]){padding-block-start:var(--ds-space-100,8px)}._1h5w12x7:not([data-compact]){padding-inline-end:var(--ds-space-075,6px)}._124212x7:not([data-compact]){padding-inline-start:var(--ds-space-075,6px)}}
@@ -1,19 +1,63 @@
1
+ /* text-field.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- import React, { forwardRef, useCallback, useMemo, useRef } from 'react';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
- import { jsx } from '@emotion/react';
3
+ import "./text-field.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import React, { forwardRef, useCallback, useRef } from 'react';
10
6
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
11
- import { containerStyles as getContainerStyles, inputStyles as getInputStyles } from './styles';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ const containerMedia = {
9
+ invalid: "_srjtgir2",
10
+ disabled: "_6up518qt"
11
+ };
12
+ const inputMediaDisabled = null;
12
13
  const analyticsParams = {
13
14
  componentName: 'textField',
14
15
  packageName: "@atlaskit/textfield",
15
- packageVersion: "6.8.3"
16
+ packageVersion: "7.0.0"
17
+ };
18
+ const disabledStyle = {
19
+ standard: "_1h6dsyzs _bfhksyzs _syaz1lh4 _80om13gf",
20
+ subtle: "_1h6d1j28 _bfhk1j28 _syaz1lh4 _80om13gf",
21
+ none: "_1h6d1j28 _bfhk1j28 _syaz1lh4 _80om13gf"
22
+ };
23
+ const invalidStyle = null;
24
+ const focusWithinStyle = {
25
+ standard: "_ochr1p6i _195er01l _bqhtq049",
26
+ subtle: "_ochr1p6i _195er01l _bqhtq049",
27
+ none: "_ochr1j28 _195e1j28 _bqht3sij"
16
28
  };
29
+ const hoverStyle = {
30
+ standard: "_4cvx1elr _irr31d5g",
31
+ subtle: "_4cvx1elr _irr31d5g",
32
+ none: "_4cvx1j28 _irr31j28"
33
+ };
34
+ const getContainerTextBgAndBorderColor = {
35
+ standard: "_1h6d1elr _1dqonqa1 _syaz1fxt _80om1kdv _bfhk1j9a _srjtgir2",
36
+ subtle: "_1h6d1j28 _1dqonqa1 _syaz1fxt _80om1kdv _16hg1j28 _srjtgir2",
37
+ none: "_1h6d1j28 _1dqoglyw _syaz1fxt _80om1kdv _16hg1j28 _srjtgir2"
38
+ };
39
+ const widthMap = {
40
+ xsmall: 80,
41
+ small: 160,
42
+ medium: 240,
43
+ large: 320,
44
+ xlarge: 480
45
+ };
46
+ const getMaxWidth = width => !width ? `100%` : width in widthMap ? `${widthMap[width]}px` : `${+width}px`;
47
+ const containerStyleAppearance = {
48
+ standard: "_1dqonqa1 _1q51e4h9 _85i5e4h9 _bozgidpf _y4tiidpf",
49
+ subtle: "_1dqonqa1 _1q51e4h9 _85i5e4h9 _bozgidpf _y4tiidpf",
50
+ none: "_1dqoglyw"
51
+ };
52
+ const containerStyles = null;
53
+ const inputDisabledStyle = null;
54
+ const inputCompactStyleWithFg = null;
55
+ const inputCompactStyle = null;
56
+ const inputMonospacedStyle = null;
57
+ const inputFontStyleWithFG = null;
58
+ const inputStyleMonospacedWithFg = null;
59
+ const inputStyleNotDataCompactWithFG = null;
60
+ const inputStyle = null;
17
61
 
18
62
  /**
19
63
  * __Textfield__
@@ -85,50 +129,38 @@ const Textfield = /*#__PURE__*/forwardRef((props, ref) => {
85
129
  ref(inputElement);
86
130
  }
87
131
  }, [ref]);
88
- const containerStyles = useMemo(() => getContainerStyles(appearance, width), [appearance, width]);
89
- const inputStyle = getInputStyles();
90
- return (
91
- /**
92
- * It is not normally acceptable to add click and key handlers to
93
- * non-interactive elements as this is an accessibility anti-pattern.
94
- * However, because this instance is to handle events on all children that
95
- * should be associated with the input, we can add role="presentation" so
96
- * that there are no negative impacts to assistive technologies.
97
- */
98
- jsx("div", {
99
- role: "presentation",
100
- "data-disabled": isDisabled ? isDisabled : undefined,
101
- "data-invalid": isInvalid ? isInvalid : undefined,
102
- "data-ds--text-field--container": true,
103
- "data-testid": testId && `${testId}-container`,
104
- onMouseDown: handleOnMouseDown
105
- // TODO: When removing legacy theming fix this.
106
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
107
- ,
108
- css: containerStyles
109
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
110
- ,
111
- className: className
112
- }, elemBeforeInput, jsx("input", _extends({}, spreadProps, {
113
- "aria-invalid": isInvalid ? isInvalid : undefined
114
- // TODO: When removing legacy theming fix this.
115
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
116
- ,
117
- css: inputStyle,
118
- "data-compact": isCompact ? isCompact : undefined,
119
- "data-ds--text-field--input": true,
120
- "data-monospaced": isMonospaced ? isMonospaced : undefined,
121
- "data-testid": testId,
122
- disabled: isDisabled,
123
- name: name,
124
- onBlur: handleOnBlur,
125
- onChange: onChange,
126
- onFocus: handleOnFocus,
127
- placeholder: placeholder,
128
- readOnly: isReadOnly,
129
- ref: setInputRef,
130
- required: isRequired
131
- })), elemAfterInput)
132
- );
132
+ return /*#__PURE__*/React.createElement("div", {
133
+ role: "presentation",
134
+ "data-disabled": isDisabled ? isDisabled : undefined,
135
+ "data-invalid": isInvalid ? isInvalid : undefined,
136
+ "data-ds--text-field--container": true,
137
+ "data-testid": testId && `${testId}-container`,
138
+ onMouseDown: handleOnMouseDown,
139
+ style: {
140
+ maxWidth: `${getMaxWidth(width)}`
141
+ },
142
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
143
+ className: ax(["_16jlkb7n _1o9zkb7n _i0dl1osq _11c81oud _1reo15vq _18m915vq _v564r5cv _189ee4h9 _1e0c1txw _vchhusvi _4cvr1h6o _1bah1yb4 _lcxv1wug _s7n4jp4b _slp31hna _1tnq1l7b", getContainerTextBgAndBorderColor[appearance], containerStyleAppearance[appearance], !isDisabled && focusWithinStyle[appearance], !isDisabled && hoverStyle[appearance], isDisabled && containerMedia.disabled, isDisabled && disabledStyle[appearance], isInvalid && containerMedia.invalid, isInvalid && "_1h6d1bqt _4cvx1bqt _16qsizbr _1dbzizbr _10j7r01l", className])
144
+ }, elemBeforeInput, /*#__PURE__*/React.createElement("input", _extends({}, spreadProps, {
145
+ "aria-invalid": isInvalid ? isInvalid : undefined
146
+ // TODO: When removing legacy theming fix this.
147
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
148
+ ,
149
+
150
+ "data-compact": isCompact ? isCompact : undefined,
151
+ "data-ds--text-field--input": true,
152
+ "data-monospaced": isMonospaced ? isMonospaced : undefined,
153
+ "data-testid": testId,
154
+ disabled: isDisabled,
155
+ name: name,
156
+ onBlur: handleOnBlur,
157
+ onChange: onChange,
158
+ onFocus: handleOnFocus,
159
+ placeholder: placeholder,
160
+ readOnly: isReadOnly,
161
+ ref: setInputRef,
162
+ required: isRequired,
163
+ className: ax(["_19itidpf _11c81oud _12ji1r31 _1qu2glyw _12y31o36 _vchhusvi _1bsb1osq _1ul9idpf _bfhk1j28 _syaz1kw7 _80om1kw7 _14jiu2gc _olc6u2gc _1kod12x7 _7ba012x7 _1goxglyw _13xeglyw _1n7e1l2s _1idr131l _3hog1lh4", isMonospaced && "_ect41odn", isCompact && "_85i51b66 _1q511b66 _y4ti12x7 _bozg12x7", isDisabled && "_oo9g1lh4", isDisabled && "_1fnx18qt", !isCompact && fg('platform_design_system_team_safari_input_fix') && "_14ji12x7 _olc612x7 _1kod12x7 _7ba012x7 _l9oiu2gc _549yu2gc _1h5w12x7 _124212x7", fg('platform_design_system_team_safari_input_fix') && "_11c81doa _1tn21oud", isCompact && fg('platform_design_system_team_safari_input_fix') && "_11zpv77o _1l02v77o _daj712x7 _141f12x7 _1srd1b66 _oi9h1b66 _1e3012x7 _1txv12x7", isMonospaced && fg('platform_design_system_team_safari_input_fix') && "_ect41odn _14md1odn"])
164
+ })), elemAfterInput);
133
165
  });
134
166
  export default Textfield;
@@ -0,0 +1,80 @@
1
+
2
+ ._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)}
3
+ ._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)}
4
+ ._19itidpf{border:0}
5
+ ._1tnq1l7b._1tnq1l7b{border-radius:3px}
6
+ ._v564r5cv{transition:background-color .2s ease-in-out,border-color .2s ease-in-out}
7
+ ._189ee4h9{border-width:var(--ds-border-width,1px)}
8
+ ._1dqoglyw{border-style:none}
9
+ ._1dqonqa1{border-style:solid}
10
+ ._1h6d1bqt, ._4cvx1bqt:hover{border-color:var(--ds-border-danger,#e2483d)}
11
+ ._1h6d1elr{border-color:var(--ds-border-input,#8590a2)}
12
+ ._1h6d1j28{border-color:transparent}
13
+ ._1h6dsyzs{border-color:var(--ds-background-disabled,#091e4208)}
14
+ ._11zpv77o[data-compact]{padding-block-end:var(--ds-space-025,2px)}
15
+ ._12ji1r31{outline-color:currentColor}
16
+ ._12y31o36{outline-width:medium}
17
+ ._13xeglyw:invalid{box-shadow:none}
18
+ ._141f12x7[data-compact]{padding-inline-start:var(--ds-space-075,6px)}
19
+ ._14ji12x7:not([data-compact]){padding-block-end:var(--ds-space-075,6px)}
20
+ ._14jiu2gc:not([data-compact]){padding-block-end:var(--ds-space-100,8px)}
21
+ ._16hg1j28._16hg1j28{background-color:transparent}
22
+ ._16jlkb7n{flex-grow:1}
23
+ ._16qs13x5, ._1dbz13x5:hover{box-shadow:var(--_x5k4n9)}
24
+ ._18m915vq{overflow-y:hidden}
25
+ ._1bah1yb4{justify-content:space-between}
26
+ ._1bsb1osq{width:100%}
27
+ ._1e0c1txw{display:flex}
28
+ ._1goxglyw::-ms-clear{display:none}
29
+ ._1idr131l::-ms-input-placeholder{color:var(--ds-text-subtlest,#626f86)}
30
+ ._1idr131l::placeholder{color:var(--ds-text-subtlest,#626f86)}
31
+ ._1kod12x7:not([data-compact]){padding-inline-end:var(--ds-space-075,6px)}
32
+ ._1l02v77o[data-compact]{padding-block-start:var(--ds-space-025,2px)}
33
+ ._1n7e1l2s:placeholder-shown{text-overflow:ellipsis}
34
+ ._1o9zkb7n{flex-shrink:1}
35
+ ._1q511b66{padding-block-start:var(--ds-space-050,4px)}
36
+ ._1q51e4h9{padding-block-start:var(--ds-border-width,1px)}
37
+ ._1qu2glyw{outline-style:none}
38
+ ._1reo15vq{overflow-x:hidden}
39
+ ._1ul9idpf{min-width:0}
40
+ ._3hog1lh4::-ms-input-placeholder:disabled{color:var(--ds-text-disabled,#091e424f)}
41
+ ._3hog1lh4::placeholder:disabled{color:var(--ds-text-disabled,#091e424f)}
42
+ ._4cvr1h6o{align-items:center}
43
+ ._7ba012x7:not([data-compact]){padding-inline-start:var(--ds-space-075,6px)}
44
+ ._80om13gf{cursor:not-allowed}
45
+ ._80om1kdv{cursor:text}
46
+ ._80om1kw7{cursor:inherit}
47
+ ._85i51b66{padding-block-end:var(--ds-space-050,4px)}
48
+ ._85i5e4h9{padding-block-end:var(--ds-border-width,1px)}
49
+ ._bfhk1j28{background-color:transparent}
50
+ ._bfhk1j9a{background-color:var(--ds-background-input,#fff)}
51
+ ._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
52
+ ._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
53
+ ._bozgidpf{padding-inline-start:0}
54
+ ._daj712x7[data-compact]{padding-inline-end:var(--ds-space-075,6px)}
55
+ ._ect41odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}
56
+ ._i0dl1osq{flex-basis:100%}
57
+ ._lcxv1wug{pointer-events:auto}
58
+ ._olc612x7:not([data-compact]){padding-block-start:var(--ds-space-075,6px)}
59
+ ._olc6u2gc:not([data-compact]){padding-block-start:var(--ds-space-100,8px)}
60
+ ._oo9g1lh4{-webkit-text-fill-color:var(--ds-text-disabled,#091e424f)}
61
+ ._s7n4jp4b{vertical-align:top}
62
+ ._slp31hna{word-wrap:break-word}
63
+ ._syaz1fxt{color:var(--ds-text,#172b4d)}
64
+ ._syaz1kw7{color:inherit}
65
+ ._syaz1lh4{color:var(--ds-text-disabled,#091e424f)}
66
+ ._vchhusvi{box-sizing:border-box}
67
+ ._y4ti12x7{padding-inline-end:var(--ds-space-075,6px)}
68
+ ._y4tiidpf{padding-inline-end:0}
69
+ ._ochr1j28._ochr1j28:focus-within{border-color:transparent}
70
+ ._ochr1p6i._ochr1p6i:focus-within{border-color:var(--ds-border-focused,#388bff)}._10j7r01l:focus-within{background-color:var(--ds-background-input-pressed,#fff)}
71
+ ._195e1j28._195e1j28:focus-within{background-color:transparent}
72
+ ._195er01l._195er01l:focus-within{background-color:var(--ds-background-input-pressed,#fff)}
73
+ ._bqht3sij._bqht3sij:focus-within{box-shadow:inset 0 0 0 var(--ds-border-width,1px) transparent}
74
+ ._bqhtq049._bqhtq049:focus-within{box-shadow:inset 0 0 0 var(--ds-border-width,1px) var(--ds-border-focused,#388bff)}
75
+ ._4cvx1elr:hover{border-color:var(--ds-border-input,#8590a2)}
76
+ ._4cvx1j28:hover{border-color:transparent}
77
+ ._irr31d5g:hover{background-color:var(--ds-background-input-hovered,#f7f8f9)}
78
+ ._irr31j28:hover{background-color:transparent}
79
+ @media screen and (-ms-high-contrast:active){._1fnx18qt{color:GrayText}._6up518qt{border-color:GrayText}._srjtgir2:focus-within{border-color:Highlight}}
80
+ @media (min-width:30rem){._14md1odn{font-family:var(--ds-font-family-code,ui-monospace,Menlo,"Segoe UI Mono","Ubuntu Mono",monospace)}._1srd1b66[data-compact]{padding-block-end:var(--ds-space-050,4px)}._oi9h1b66[data-compact]{padding-block-start:var(--ds-space-050,4px)}._1e3012x7[data-compact]{padding-inline-end:var(--ds-space-075,6px)}._1txv12x7[data-compact]{padding-inline-start:var(--ds-space-075,6px)}._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)}._l9oiu2gc:not([data-compact]){padding-block-end:var(--ds-space-100,8px)}._549yu2gc:not([data-compact]){padding-block-start:var(--ds-space-100,8px)}._1h5w12x7:not([data-compact]){padding-inline-end:var(--ds-space-075,6px)}._124212x7:not([data-compact]){padding-inline-start:var(--ds-space-075,6px)}}