@atlaskit/textfield 5.6.7 → 6.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.
@@ -2,107 +2,72 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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) { _defineProperty(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; }
4
4
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
- import { R400 } from '@atlaskit/theme/colors';
5
+ import { B200, N0, N10, N100, N200, N30, N40, N70, N900, R400 } from '@atlaskit/theme/colors';
6
6
  import { codeFontFamily, fontFamily, fontSize as getFontSize,
7
7
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
8
8
  gridSize as getGridSize } from '@atlaskit/theme/constants';
9
- import * as componentTokens from './component-tokens';
10
9
  var fontSize = getFontSize();
11
10
  var gridSize = getGridSize();
12
- var disabledRules = {
13
- light: {
14
- backgroundColor: componentTokens.disabledBackgroundColor.light,
15
- backgroundColorHover: componentTokens.disabledBackgroundColor.light,
16
- borderColor: componentTokens.disabledBackgroundColor.light,
17
- textColor: componentTokens.disabledTextColor.light
18
- },
19
- dark: {
20
- backgroundColor: componentTokens.disabledBackgroundColor.dark,
21
- backgroundColorHover: componentTokens.disabledBackgroundColor.dark,
22
- borderColor: componentTokens.disabledBackgroundColor.dark,
23
- textColor: componentTokens.disabledTextColor.dark
24
- }
25
- };
26
- var invalidRules = {
27
- light: {
28
- // ----
29
- backgroundColor: componentTokens.defaultBackgroundColor.light,
30
- backgroundColorHover: componentTokens.defaultBackgroundColorHover.light,
31
- // ^--- the above values aren't used directly they remain because its exposed by the `textFieldColors` export
32
- backgroundColorFocus: componentTokens.defaultBackgroundColorFocus.light,
33
- borderColor: "var(--ds-border-danger, ".concat(R400, ")"),
34
- borderColorFocus: componentTokens.defaultBorderColorFocus.light
35
- },
36
- dark: {
37
- // ----
38
- backgroundColor: componentTokens.defaultBackgroundColor.dark,
39
- backgroundColorHover: componentTokens.defaultBackgroundColorHover.dark,
40
- // ^--- the above values aren't used directly they remain because its exposed by the `textFieldColors` export
41
- backgroundColorFocus: componentTokens.defaultBackgroundColorFocus.dark,
42
- borderColor: "var(--ds-border-danger, ".concat(R400, ")"),
43
- borderColorFocus: componentTokens.defaultBorderColorFocus.dark
44
- }
45
- };
46
11
  var backgroundColor = {
47
- standard: componentTokens.defaultBackgroundColor,
48
- subtle: componentTokens.transparent,
49
- none: componentTokens.transparent
12
+ standard: "var(--ds-background-input, ".concat(N10, ")"),
13
+ subtle: 'transparent',
14
+ none: 'transparent'
50
15
  };
51
16
  var backgroundColorFocus = {
52
- standard: componentTokens.defaultBackgroundColorFocus,
53
- subtle: componentTokens.defaultBackgroundColorFocus,
54
- none: componentTokens.transparent
17
+ standard: "var(--ds-background-input-pressed, ".concat(N0, ")"),
18
+ subtle: "var(--ds-background-input-pressed, ".concat(N0, ")"),
19
+ none: 'transparent'
55
20
  };
56
21
  var backgroundColorHover = {
57
- standard: componentTokens.defaultBackgroundColorHover,
58
- subtle: componentTokens.defaultBackgroundColorHover,
59
- none: componentTokens.transparent
22
+ standard: "var(--ds-background-input-hovered, ".concat(N30, ")"),
23
+ subtle: "var(--ds-background-input-hovered, ".concat(N30, ")"),
24
+ none: 'transparent'
60
25
  };
61
26
  var borderColor = {
62
- standard: componentTokens.defaultBorderColor,
63
- subtle: componentTokens.transparent,
64
- none: componentTokens.transparent
27
+ standard: "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? N100 : N40, ")"),
28
+ subtle: 'transparent',
29
+ none: 'transparent'
65
30
  };
66
31
  var borderColorFocus = {
67
- standard: componentTokens.defaultBorderColorFocus,
68
- subtle: componentTokens.defaultBorderColorFocus,
69
- none: componentTokens.transparent
32
+ standard: "var(--ds-border-focused, ".concat(B200, ")"),
33
+ subtle: "var(--ds-border-focused, ".concat(B200, ")"),
34
+ none: 'transparent'
70
35
  };
71
36
  var borderColorHover = {
72
- standard: componentTokens.defaultBorderColor,
73
- subtle: componentTokens.subtleBorderColorHover,
74
- none: componentTokens.transparent
37
+ standard: "var(--ds-border-input, ".concat(getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? N100 : N40, ")"),
38
+ subtle: "var(--ds-border-input, transparent)",
39
+ none: 'transparent'
75
40
  };
76
- var getContainerTextBgAndBorderColor = function getContainerTextBgAndBorderColor(appearance, mode) {
41
+ var getContainerTextBgAndBorderColor = function getContainerTextBgAndBorderColor(appearance) {
77
42
  return {
78
- backgroundColor: backgroundColor[appearance][mode],
79
- borderColor: borderColor[appearance][mode],
80
- color: componentTokens.textColor[mode],
43
+ backgroundColor: backgroundColor[appearance],
44
+ borderColor: borderColor[appearance],
45
+ color: "var(--ds-text, ".concat(N900, ")"),
81
46
  cursor: 'text',
82
47
  '&:hover:not([data-disabled])': {
83
- backgroundColor: backgroundColorHover[appearance][mode],
84
- borderColor: borderColorHover[appearance][mode]
48
+ backgroundColor: backgroundColorHover[appearance],
49
+ borderColor: borderColorHover[appearance]
85
50
  },
86
51
  '&:focus-within:not([data-disabled])': {
87
- backgroundColor: backgroundColorFocus[appearance][mode],
88
- borderColor: borderColorFocus[appearance][mode],
89
- boxShadow: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", borderColorFocus[appearance][mode]) : undefined
52
+ backgroundColor: backgroundColorFocus[appearance],
53
+ borderColor: borderColorFocus[appearance],
54
+ boxShadow: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", borderColorFocus[appearance]) : undefined
90
55
  },
91
56
  '&[data-disabled]': _objectSpread({
92
- color: disabledRules[mode].textColor,
57
+ color: "var(--ds-text-disabled, ".concat(N70, ")"),
93
58
  cursor: 'not-allowed'
94
59
  }, appearance === 'standard' && {
95
- backgroundColor: disabledRules[mode].backgroundColor,
96
- borderColor: disabledRules[mode].borderColor
60
+ backgroundColor: "var(--ds-background-disabled, ".concat(N10, ")"),
61
+ borderColor: "var(--ds-background-disabled, ".concat(N10, ")")
97
62
  }),
98
63
  '&[data-invalid], &[data-invalid]:hover': {
99
- borderColor: invalidRules[mode].borderColor,
100
- boxShadow: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", invalidRules[mode].borderColor) : undefined
64
+ borderColor: "var(--ds-border-danger, ".concat(R400, ")"),
65
+ boxShadow: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", "var(--ds-border-danger, ".concat(R400, ")")) : undefined
101
66
  },
102
67
  '&[data-invalid]:focus-within': {
103
- backgroundColor: invalidRules[mode].backgroundColorFocus,
104
- borderColor: invalidRules[mode].borderColorFocus,
105
- boxShadow: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", invalidRules[mode].borderColorFocus) : undefined
68
+ backgroundColor: "var(--ds-background-input-pressed, ".concat(N0, ")"),
69
+ borderColor: "var(--ds-border-focused, ".concat(B200, ")"),
70
+ boxShadow: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? "inset 0 0 0 ".concat("var(--ds-border-width, 1px)", " ", "var(--ds-border-focused, ".concat(B200, ")")) : undefined
106
71
  },
107
72
  '@media screen and (-ms-high-contrast: active)': {
108
73
  '&[data-invalid]:focus-within': {
@@ -127,15 +92,13 @@ var widthMap = {
127
92
  var getMaxWidth = function getMaxWidth(width) {
128
93
  return !width ? "100%" : width in widthMap ? widthMap[width] : +width;
129
94
  };
130
- export var containerStyles = function containerStyles(appearance, mode, width) {
95
+ export var containerStyles = function containerStyles(appearance, width) {
131
96
  return _objectSpread(_objectSpread(_objectSpread({
132
97
  alignItems: 'center'
133
- }, getContainerTextBgAndBorderColor(appearance, mode)), {}, {
98
+ }, getContainerTextBgAndBorderColor(appearance)), {}, {
134
99
  borderRadius: 3,
135
100
  borderWidth: getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') ? "var(--ds-border-width, 1px)" : 2
136
- }, getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') && appearance !== 'none' ?
137
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
138
- {
101
+ }, getBooleanFF('platform.design-system-team.border-checkbox_nyoiu') && appearance !== 'none' ? {
139
102
  padding: "var(--ds-border-width, 1px)".concat(" 0")
140
103
  } : {}), {}, {
141
104
  borderStyle: appearance === 'none' ? 'none' : 'solid',
@@ -152,7 +115,7 @@ export var containerStyles = function containerStyles(appearance, mode, width) {
152
115
  pointerEvents: 'auto'
153
116
  });
154
117
  };
155
- export var inputStyles = function inputStyles(mode) {
118
+ export var inputStyles = function inputStyles() {
156
119
  return {
157
120
  backgroundColor: 'transparent',
158
121
  border: 0,
@@ -180,7 +143,7 @@ export var inputStyles = function inputStyles(mode) {
180
143
  // Safari (WebKit) adds a -webkit-text-fill-color style to disabled inputs
181
144
  // which takes priority over color and makes the text unreadable. Need to
182
145
  // override it with the color we want.
183
- WebkitTextFillColor: disabledRules[mode].textColor
146
+ WebkitTextFillColor: "var(--ds-text-disabled, ".concat(N70, ")")
184
147
  },
185
148
  // Hide the clear indicator on Edge (Windows only)
186
149
  '&::-ms-clear': {
@@ -193,9 +156,9 @@ export var inputStyles = function inputStyles(mode) {
193
156
  textOverflow: 'ellipsis'
194
157
  },
195
158
  '&::placeholder': {
196
- color: componentTokens.placeholderTextColor[mode],
159
+ color: "var(--ds-text-subtlest, ".concat(N200, ")"),
197
160
  '&:disabled': {
198
- color: disabledRules[mode].textColor
161
+ color: "var(--ds-text-disabled, ".concat(N70, ")")
199
162
  }
200
163
  },
201
164
  '@media screen and (-ms-high-contrast: active)': {
@@ -204,18 +167,4 @@ export var inputStyles = function inputStyles(mode) {
204
167
  }
205
168
  }
206
169
  };
207
- };
208
-
209
- // TODO: Remove when removing legacy theming.
210
- export var textFieldColors = {
211
- backgroundColor: backgroundColor,
212
- backgroundColorFocus: backgroundColorFocus,
213
- backgroundColorHover: backgroundColorHover,
214
- borderColor: borderColor,
215
- borderColorFocus: borderColorFocus,
216
- borderColorHover: borderColorHover,
217
- placeholderTextColor: componentTokens.placeholderTextColor,
218
- textColor: componentTokens.textColor,
219
- invalidRules: invalidRules,
220
- disabledRules: disabledRules
221
170
  };
@@ -2,47 +2,47 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _typeof from "@babel/runtime/helpers/typeof";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["appearance", "isCompact", "isDisabled", "isInvalid", "isRequired", "isReadOnly", "isMonospaced", "width", "elemAfterInput", "elemBeforeInput", "testId", "onFocus", "onBlur", "onMouseDown", "className"];
5
+ var _excluded = ["appearance", "className", "elemAfterInput", "elemBeforeInput", "isCompact", "isDisabled", "isInvalid", "isMonospaced", "isReadOnly", "isRequired", "name", "onBlur", "onChange", "onFocus", "onMouseDown", "placeholder", "testId", "width"];
6
6
  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; }
7
7
  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) { _defineProperty(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; }
8
8
  /** @jsx jsx */
9
9
  import React, { forwardRef, memo, useCallback, useMemo, useRef } from 'react';
10
10
  import { jsx } from '@emotion/react';
11
11
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
12
- import { useGlobalTheme } from '@atlaskit/theme/components';
13
12
  import { containerStyles as getContainerStyles, inputStyles as getInputStyles } from './styles';
14
13
  var analyticsParams = {
15
14
  componentName: 'textField',
16
15
  packageName: "@atlaskit/textfield",
17
- packageVersion: "5.6.7"
16
+ packageVersion: "6.0.0"
18
17
  };
19
18
  var Textfield = /*#__PURE__*/forwardRef(function (props, ref) {
20
19
  var _props$appearance = props.appearance,
21
20
  appearance = _props$appearance === void 0 ? 'standard' : _props$appearance,
21
+ className = props.className,
22
+ elemAfterInput = props.elemAfterInput,
23
+ elemBeforeInput = props.elemBeforeInput,
22
24
  _props$isCompact = props.isCompact,
23
25
  isCompact = _props$isCompact === void 0 ? false : _props$isCompact,
24
26
  _props$isDisabled = props.isDisabled,
25
27
  isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
26
28
  _props$isInvalid = props.isInvalid,
27
29
  isInvalid = _props$isInvalid === void 0 ? false : _props$isInvalid,
28
- _props$isRequired = props.isRequired,
29
- isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
30
- _props$isReadOnly = props.isReadOnly,
31
- isReadOnly = _props$isReadOnly === void 0 ? false : _props$isReadOnly,
32
30
  _props$isMonospaced = props.isMonospaced,
33
31
  isMonospaced = _props$isMonospaced === void 0 ? false : _props$isMonospaced,
34
- width = props.width,
35
- elemAfterInput = props.elemAfterInput,
36
- elemBeforeInput = props.elemBeforeInput,
37
- testId = props.testId,
38
- onFocus = props.onFocus,
32
+ _props$isReadOnly = props.isReadOnly,
33
+ isReadOnly = _props$isReadOnly === void 0 ? false : _props$isReadOnly,
34
+ _props$isRequired = props.isRequired,
35
+ isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
36
+ name = props.name,
39
37
  onBlur = props.onBlur,
38
+ onChange = props.onChange,
39
+ onFocus = props.onFocus,
40
40
  onMouseDown = props.onMouseDown,
41
- className = props.className,
41
+ placeholder = props.placeholder,
42
+ testId = props.testId,
43
+ width = props.width,
42
44
  spreadProps = _objectWithoutProperties(props, _excluded);
43
45
  var inputRef = useRef(null);
44
- var _useGlobalTheme = useGlobalTheme(),
45
- mode = _useGlobalTheme.mode;
46
46
  var handleOnFocus = usePlatformLeafEventHandler(_objectSpread({
47
47
  fn: function fn(event) {
48
48
  onFocus && onFocus(event);
@@ -80,15 +80,19 @@ var Textfield = /*#__PURE__*/forwardRef(function (props, ref) {
80
80
  }
81
81
  }, [ref]);
82
82
  var containerStyles = useMemo(function () {
83
- return getContainerStyles(appearance, mode, width);
84
- }, [appearance, mode, width]);
85
- var inputStyle = useMemo(function () {
86
- return getInputStyles(mode);
87
- }, [mode]);
83
+ return getContainerStyles(appearance, width);
84
+ }, [appearance, width]);
85
+ var inputStyle = getInputStyles();
88
86
  return (
89
- // We use event bubbling here to listen to any child element mouse down event.
90
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
87
+ /**
88
+ * It is not normally acceptable to add click and key handlers to
89
+ * non-interactive elements as this is an accessibility anti-pattern.
90
+ * However, because this instance is to handle events on all children that
91
+ * should be associated with the input, we can add role="presentation" so
92
+ * that there are no negative impacts to assistive technologies.
93
+ */
91
94
  jsx("div", {
95
+ role: "presentation",
92
96
  "data-disabled": isDisabled ? isDisabled : undefined,
93
97
  "data-invalid": isInvalid ? isInvalid : undefined,
94
98
  "data-ds--text-field--container": true,
@@ -100,21 +104,24 @@ var Textfield = /*#__PURE__*/forwardRef(function (props, ref) {
100
104
  css: containerStyles,
101
105
  className: className
102
106
  }, elemBeforeInput, jsx("input", _extends({}, spreadProps, {
107
+ "aria-invalid": isInvalid ? isInvalid : undefined
108
+ // TODO: When removing legacy theming fix this.
109
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
110
+ ,
111
+ css: inputStyle,
103
112
  "data-compact": isCompact ? isCompact : undefined,
104
- "data-monospaced": isMonospaced ? isMonospaced : undefined,
105
113
  "data-ds--text-field--input": true,
114
+ "data-monospaced": isMonospaced ? isMonospaced : undefined,
106
115
  "data-testid": testId,
107
- "aria-invalid": isInvalid ? isInvalid : undefined,
108
116
  disabled: isDisabled,
109
- readOnly: isReadOnly,
110
- required: isRequired,
117
+ name: name,
111
118
  onBlur: handleOnBlur,
119
+ onChange: onChange,
112
120
  onFocus: handleOnFocus,
113
- ref: setInputRef
114
- // TODO: When removing legacy theming fix this.
115
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
116
- ,
117
- css: inputStyle
121
+ placeholder: placeholder,
122
+ readOnly: isReadOnly,
123
+ ref: setInputRef,
124
+ required: isRequired
118
125
  })), elemAfterInput)
119
126
  );
120
127
  });
@@ -1,3 +1,2 @@
1
1
  export { default } from './text-field';
2
- export { textFieldColors as TextFieldColors } from './styles';
3
2
  export type { TextfieldProps as TextFieldProps, Appearance } from './types';
@@ -1,6 +1,5 @@
1
- import { ThemeModes } from '@atlaskit/theme/types';
2
1
  import { Appearance } from './types';
3
- export declare const containerStyles: (appearance: Appearance, mode: ThemeModes, width?: string | number) => {
2
+ export declare const containerStyles: (appearance: Appearance, width?: string | number) => {
4
3
  readonly borderStyle: "none" | "solid";
5
4
  readonly boxSizing: "border-box";
6
5
  readonly display: "flex";
@@ -57,7 +56,7 @@ export declare const containerStyles: (appearance: Appearance, mode: ThemeModes,
57
56
  };
58
57
  readonly alignItems: "center";
59
58
  };
60
- export declare const inputStyles: (mode: ThemeModes) => {
59
+ export declare const inputStyles: () => {
61
60
  readonly backgroundColor: "transparent";
62
61
  readonly border: 0;
63
62
  readonly boxSizing: "border-box";
@@ -104,127 +103,3 @@ export declare const inputStyles: (mode: ThemeModes) => {
104
103
  };
105
104
  };
106
105
  };
107
- export declare const textFieldColors: {
108
- backgroundColor: {
109
- standard: {
110
- light: "var(--ds-background-input)";
111
- dark: "var(--ds-background-input)";
112
- };
113
- subtle: {
114
- light: string;
115
- dark: string;
116
- };
117
- none: {
118
- light: string;
119
- dark: string;
120
- };
121
- };
122
- backgroundColorFocus: {
123
- standard: {
124
- light: "var(--ds-background-input-pressed)";
125
- dark: "var(--ds-background-input-pressed)";
126
- };
127
- subtle: {
128
- light: "var(--ds-background-input-pressed)";
129
- dark: "var(--ds-background-input-pressed)";
130
- };
131
- none: {
132
- light: string;
133
- dark: string;
134
- };
135
- };
136
- backgroundColorHover: {
137
- standard: {
138
- light: "var(--ds-background-input-hovered)";
139
- dark: "var(--ds-background-input-hovered)";
140
- };
141
- subtle: {
142
- light: "var(--ds-background-input-hovered)";
143
- dark: "var(--ds-background-input-hovered)";
144
- };
145
- none: {
146
- light: string;
147
- dark: string;
148
- };
149
- };
150
- borderColor: {
151
- standard: {
152
- light: "var(--ds-border-input)";
153
- dark: "var(--ds-border-input)";
154
- };
155
- subtle: {
156
- light: string;
157
- dark: string;
158
- };
159
- none: {
160
- light: string;
161
- dark: string;
162
- };
163
- };
164
- borderColorFocus: {
165
- standard: {
166
- light: "var(--ds-border-focused)";
167
- dark: "var(--ds-border-focused)";
168
- };
169
- subtle: {
170
- light: "var(--ds-border-focused)";
171
- dark: "var(--ds-border-focused)";
172
- };
173
- none: {
174
- light: string;
175
- dark: string;
176
- };
177
- };
178
- borderColorHover: {
179
- standard: {
180
- light: "var(--ds-border-input)";
181
- dark: "var(--ds-border-input)";
182
- };
183
- subtle: {
184
- light: "var(--ds-border-input)";
185
- dark: "var(--ds-border-input)";
186
- };
187
- none: {
188
- light: string;
189
- dark: string;
190
- };
191
- };
192
- placeholderTextColor: {
193
- light: "var(--ds-text-subtlest)";
194
- dark: "var(--ds-text-subtlest)";
195
- };
196
- textColor: {
197
- light: "var(--ds-text)";
198
- dark: "var(--ds-text)";
199
- };
200
- invalidRules: {
201
- light: {
202
- backgroundColor: "var(--ds-background-input)";
203
- backgroundColorHover: "var(--ds-background-input-hovered)";
204
- backgroundColorFocus: "var(--ds-background-input-pressed)";
205
- borderColor: "var(--ds-border-danger)";
206
- borderColorFocus: "var(--ds-border-focused)";
207
- };
208
- dark: {
209
- backgroundColor: "var(--ds-background-input)";
210
- backgroundColorHover: "var(--ds-background-input-hovered)";
211
- backgroundColorFocus: "var(--ds-background-input-pressed)";
212
- borderColor: "var(--ds-border-danger)";
213
- borderColorFocus: "var(--ds-border-focused)";
214
- };
215
- };
216
- disabledRules: {
217
- light: {
218
- backgroundColor: "var(--ds-background-disabled)";
219
- backgroundColorHover: "var(--ds-background-disabled)";
220
- borderColor: "var(--ds-background-disabled)";
221
- textColor: "var(--ds-text-disabled)";
222
- };
223
- dark: {
224
- backgroundColor: "var(--ds-background-disabled)";
225
- backgroundColorHover: "var(--ds-background-disabled)";
226
- borderColor: "var(--ds-background-disabled)";
227
- textColor: "var(--ds-text-disabled)";
228
- };
229
- };
230
- };
@@ -1,3 +1,2 @@
1
1
  export { default } from './text-field';
2
- export { textFieldColors as TextFieldColors } from './styles';
3
2
  export type { TextfieldProps as TextFieldProps, Appearance } from './types';
@@ -1,6 +1,5 @@
1
- import { ThemeModes } from '@atlaskit/theme/types';
2
1
  import { Appearance } from './types';
3
- export declare const containerStyles: (appearance: Appearance, mode: ThemeModes, width?: string | number) => {
2
+ export declare const containerStyles: (appearance: Appearance, width?: string | number) => {
4
3
  readonly borderStyle: "none" | "solid";
5
4
  readonly boxSizing: "border-box";
6
5
  readonly display: "flex";
@@ -57,7 +56,7 @@ export declare const containerStyles: (appearance: Appearance, mode: ThemeModes,
57
56
  };
58
57
  readonly alignItems: "center";
59
58
  };
60
- export declare const inputStyles: (mode: ThemeModes) => {
59
+ export declare const inputStyles: () => {
61
60
  readonly backgroundColor: "transparent";
62
61
  readonly border: 0;
63
62
  readonly boxSizing: "border-box";
@@ -104,127 +103,3 @@ export declare const inputStyles: (mode: ThemeModes) => {
104
103
  };
105
104
  };
106
105
  };
107
- export declare const textFieldColors: {
108
- backgroundColor: {
109
- standard: {
110
- light: "var(--ds-background-input)";
111
- dark: "var(--ds-background-input)";
112
- };
113
- subtle: {
114
- light: string;
115
- dark: string;
116
- };
117
- none: {
118
- light: string;
119
- dark: string;
120
- };
121
- };
122
- backgroundColorFocus: {
123
- standard: {
124
- light: "var(--ds-background-input-pressed)";
125
- dark: "var(--ds-background-input-pressed)";
126
- };
127
- subtle: {
128
- light: "var(--ds-background-input-pressed)";
129
- dark: "var(--ds-background-input-pressed)";
130
- };
131
- none: {
132
- light: string;
133
- dark: string;
134
- };
135
- };
136
- backgroundColorHover: {
137
- standard: {
138
- light: "var(--ds-background-input-hovered)";
139
- dark: "var(--ds-background-input-hovered)";
140
- };
141
- subtle: {
142
- light: "var(--ds-background-input-hovered)";
143
- dark: "var(--ds-background-input-hovered)";
144
- };
145
- none: {
146
- light: string;
147
- dark: string;
148
- };
149
- };
150
- borderColor: {
151
- standard: {
152
- light: "var(--ds-border-input)";
153
- dark: "var(--ds-border-input)";
154
- };
155
- subtle: {
156
- light: string;
157
- dark: string;
158
- };
159
- none: {
160
- light: string;
161
- dark: string;
162
- };
163
- };
164
- borderColorFocus: {
165
- standard: {
166
- light: "var(--ds-border-focused)";
167
- dark: "var(--ds-border-focused)";
168
- };
169
- subtle: {
170
- light: "var(--ds-border-focused)";
171
- dark: "var(--ds-border-focused)";
172
- };
173
- none: {
174
- light: string;
175
- dark: string;
176
- };
177
- };
178
- borderColorHover: {
179
- standard: {
180
- light: "var(--ds-border-input)";
181
- dark: "var(--ds-border-input)";
182
- };
183
- subtle: {
184
- light: "var(--ds-border-input)";
185
- dark: "var(--ds-border-input)";
186
- };
187
- none: {
188
- light: string;
189
- dark: string;
190
- };
191
- };
192
- placeholderTextColor: {
193
- light: "var(--ds-text-subtlest)";
194
- dark: "var(--ds-text-subtlest)";
195
- };
196
- textColor: {
197
- light: "var(--ds-text)";
198
- dark: "var(--ds-text)";
199
- };
200
- invalidRules: {
201
- light: {
202
- backgroundColor: "var(--ds-background-input)";
203
- backgroundColorHover: "var(--ds-background-input-hovered)";
204
- backgroundColorFocus: "var(--ds-background-input-pressed)";
205
- borderColor: "var(--ds-border-danger)";
206
- borderColorFocus: "var(--ds-border-focused)";
207
- };
208
- dark: {
209
- backgroundColor: "var(--ds-background-input)";
210
- backgroundColorHover: "var(--ds-background-input-hovered)";
211
- backgroundColorFocus: "var(--ds-background-input-pressed)";
212
- borderColor: "var(--ds-border-danger)";
213
- borderColorFocus: "var(--ds-border-focused)";
214
- };
215
- };
216
- disabledRules: {
217
- light: {
218
- backgroundColor: "var(--ds-background-disabled)";
219
- backgroundColorHover: "var(--ds-background-disabled)";
220
- borderColor: "var(--ds-background-disabled)";
221
- textColor: "var(--ds-text-disabled)";
222
- };
223
- dark: {
224
- backgroundColor: "var(--ds-background-disabled)";
225
- backgroundColorHover: "var(--ds-background-disabled)";
226
- borderColor: "var(--ds-background-disabled)";
227
- textColor: "var(--ds-text-disabled)";
228
- };
229
- };
230
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/textfield",
3
- "version": "5.6.7",
3
+ "version": "6.0.0",
4
4
  "description": "A text field is an input that allows a user to write or edit text.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/analytics-next": "^9.1.0",
30
30
  "@atlaskit/platform-feature-flags": "^0.2.0",
31
31
  "@atlaskit/theme": "^12.6.0",
32
- "@atlaskit/tokens": "^1.21.0",
32
+ "@atlaskit/tokens": "^1.28.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@emotion/react": "^11.7.1"
35
35
  },
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@af/accessibility-testing": "*",
41
+ "@af/integration-testing": "*",
41
42
  "@af/visual-regression": "*",
42
43
  "@atlaskit/codemod-utils": "^4.2.3",
43
44
  "@atlaskit/ds-lib": "^2.2.0",
@@ -97,4 +98,4 @@
97
98
  },
98
99
  "homepage": "https://atlassian.design/components/textfield/",
99
100
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
100
- }
101
+ }