@atlaskit/textfield 5.1.11 → 5.2.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,27 @@
1
1
  # @atlaskit/textfield
2
2
 
3
+ ## 5.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`acf974e717c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/acf974e717c) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 5.1.13
14
+
15
+ ### Patch Changes
16
+
17
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
18
+
19
+ ## 5.1.12
20
+
21
+ ### Patch Changes
22
+
23
+ - [`7c14ea36248`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7c14ea36248) - [ux] Updated input tokens within `@atlaskit/textfield`.
24
+
3
25
  ## 5.1.11
4
26
 
5
27
  ### Patch Changes
@@ -18,8 +18,8 @@ var defaultBackgroundColor = {
18
18
  };
19
19
  exports.defaultBackgroundColor = defaultBackgroundColor;
20
20
  var defaultBackgroundColorFocus = {
21
- light: "var(--ds-surface, ".concat(_colors.N0, ")"),
22
- dark: "var(--ds-surface, ".concat(_colors.DN10, ")")
21
+ light: "var(--ds-background-input-pressed, ".concat(_colors.N0, ")"),
22
+ dark: "var(--ds-background-input-pressed, ".concat(_colors.DN10, ")")
23
23
  };
24
24
  exports.defaultBackgroundColorFocus = defaultBackgroundColorFocus;
25
25
  var defaultBackgroundColorHover = {
@@ -19,7 +19,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
19
19
 
20
20
  var _react = _interopRequireWildcard(require("react"));
21
21
 
22
- var _core = require("@emotion/core");
22
+ var _react2 = require("@emotion/react");
23
23
 
24
24
  var _analyticsNext = require("@atlaskit/analytics-next");
25
25
 
@@ -40,7 +40,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
40
40
  var analyticsParams = {
41
41
  componentName: 'textField',
42
42
  packageName: "@atlaskit/textfield",
43
- packageVersion: "5.1.11"
43
+ packageVersion: "5.2.0"
44
44
  };
45
45
  var Textfield = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
46
46
  var _props$appearance = props.appearance,
@@ -125,7 +125,7 @@ var Textfield = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
125
125
  }, [mode]);
126
126
  return (// We use event bubbling here to listen to any child element mouse down event.
127
127
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
128
- (0, _core.jsx)("div", {
128
+ (0, _react2.jsx)("div", {
129
129
  "data-disabled": isDisabled ? isDisabled : undefined,
130
130
  "data-invalid": isInvalid ? isInvalid : undefined,
131
131
  "data-ds--text-field--container": true,
@@ -135,7 +135,7 @@ var Textfield = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
135
135
  ,
136
136
  css: containerStyles,
137
137
  className: className
138
- }, elemBeforeInput, (0, _core.jsx)("input", (0, _extends2.default)({}, spreadProps, {
138
+ }, elemBeforeInput, (0, _react2.jsx)("input", (0, _extends2.default)({}, spreadProps, {
139
139
  "data-compact": isCompact ? isCompact : undefined,
140
140
  "data-monospaced": isMonospaced ? isMonospaced : undefined,
141
141
  "data-ds--text-field--input": true,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/textfield",
3
- "version": "5.1.11",
3
+ "version": "5.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -8,8 +8,8 @@ export const defaultBackgroundColor = {
8
8
  dark: `var(--ds-background-input, ${DN10})`
9
9
  };
10
10
  export const defaultBackgroundColorFocus = {
11
- light: `var(--ds-surface, ${N0})`,
12
- dark: `var(--ds-surface, ${DN10})`
11
+ light: `var(--ds-background-input-pressed, ${N0})`,
12
+ dark: `var(--ds-background-input-pressed, ${DN10})`
13
13
  };
14
14
  export const defaultBackgroundColorHover = {
15
15
  light: `var(--ds-background-input-hovered, ${N30})`,
@@ -2,14 +2,14 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import React, { forwardRef, memo, useCallback, useMemo, useRef } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { jsx } from '@emotion/react';
6
6
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
7
7
  import { useGlobalTheme } from '@atlaskit/theme/components';
8
8
  import { containerStyles as getContainerStyles, inputStyles as getInputStyles } from './styles';
9
9
  const analyticsParams = {
10
10
  componentName: 'textField',
11
11
  packageName: "@atlaskit/textfield",
12
- packageVersion: "5.1.11"
12
+ packageVersion: "5.2.0"
13
13
  };
14
14
  const Textfield = /*#__PURE__*/forwardRef((props, ref) => {
15
15
  const {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/textfield",
3
- "version": "5.1.11",
3
+ "version": "5.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -8,8 +8,8 @@ export var defaultBackgroundColor = {
8
8
  dark: "var(--ds-background-input, ".concat(DN10, ")")
9
9
  };
10
10
  export var defaultBackgroundColorFocus = {
11
- light: "var(--ds-surface, ".concat(N0, ")"),
12
- dark: "var(--ds-surface, ".concat(DN10, ")")
11
+ light: "var(--ds-background-input-pressed, ".concat(N0, ")"),
12
+ dark: "var(--ds-background-input-pressed, ".concat(DN10, ")")
13
13
  };
14
14
  export var defaultBackgroundColorHover = {
15
15
  light: "var(--ds-background-input-hovered, ".concat(N30, ")"),
@@ -10,14 +10,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
10
10
 
11
11
  /** @jsx jsx */
12
12
  import React, { forwardRef, memo, useCallback, useMemo, useRef } from 'react';
13
- import { jsx } from '@emotion/core';
13
+ import { jsx } from '@emotion/react';
14
14
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
15
15
  import { useGlobalTheme } from '@atlaskit/theme/components';
16
16
  import { containerStyles as getContainerStyles, inputStyles as getInputStyles } from './styles';
17
17
  var analyticsParams = {
18
18
  componentName: 'textField',
19
19
  packageName: "@atlaskit/textfield",
20
- packageVersion: "5.1.11"
20
+ packageVersion: "5.2.0"
21
21
  };
22
22
  var Textfield = /*#__PURE__*/forwardRef(function (props, ref) {
23
23
  var _props$appearance = props.appearance,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/textfield",
3
- "version": "5.1.11",
3
+ "version": "5.2.0",
4
4
  "sideEffects": false
5
5
  }
@@ -7,8 +7,8 @@ export declare const defaultBackgroundColor: {
7
7
  dark: "var(--ds-background-input)";
8
8
  };
9
9
  export declare const defaultBackgroundColorFocus: {
10
- light: "var(--ds-surface)";
11
- dark: "var(--ds-surface)";
10
+ light: "var(--ds-background-input-pressed)";
11
+ dark: "var(--ds-background-input-pressed)";
12
12
  };
13
13
  export declare const defaultBackgroundColorHover: {
14
14
  light: "var(--ds-background-input-hovered)";
@@ -36,7 +36,7 @@ export declare const containerStyles: (appearance: Appearance, mode: ThemeModes,
36
36
  borderColor: "var(--ds-border-danger)";
37
37
  };
38
38
  readonly '&[data-invalid]:focus-within': {
39
- backgroundColor: "var(--ds-surface)";
39
+ backgroundColor: "var(--ds-background-input-pressed)";
40
40
  borderColor: "var(--ds-border-focused)";
41
41
  };
42
42
  readonly '@media screen and (-ms-high-contrast: active)': {
@@ -113,12 +113,12 @@ export declare const textFieldColors: {
113
113
  };
114
114
  backgroundColorFocus: {
115
115
  standard: {
116
- light: "var(--ds-surface)";
117
- dark: "var(--ds-surface)";
116
+ light: "var(--ds-background-input-pressed)";
117
+ dark: "var(--ds-background-input-pressed)";
118
118
  };
119
119
  subtle: {
120
- light: "var(--ds-surface)";
121
- dark: "var(--ds-surface)";
120
+ light: "var(--ds-background-input-pressed)";
121
+ dark: "var(--ds-background-input-pressed)";
122
122
  };
123
123
  none: {
124
124
  light: string;
@@ -179,14 +179,14 @@ export declare const textFieldColors: {
179
179
  light: {
180
180
  backgroundColor: "var(--ds-background-input)";
181
181
  backgroundColorHover: "var(--ds-background-input-hovered)";
182
- backgroundColorFocus: "var(--ds-surface)";
182
+ backgroundColorFocus: "var(--ds-background-input-pressed)";
183
183
  borderColor: "var(--ds-border-danger)";
184
184
  borderColorFocus: "var(--ds-border-focused)";
185
185
  };
186
186
  dark: {
187
187
  backgroundColor: "var(--ds-background-input)";
188
188
  backgroundColorHover: "var(--ds-background-input-hovered)";
189
- backgroundColorFocus: "var(--ds-surface)";
189
+ backgroundColorFocus: "var(--ds-background-input-pressed)";
190
190
  borderColor: "var(--ds-border-danger)";
191
191
  borderColorFocus: "var(--ds-border-focused)";
192
192
  };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlaskit/textfield",
3
- "version": "5.1.11",
3
+ "version": "5.2.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/"
7
7
  },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
9
  "author": "Atlassian Pty Ltd",
10
10
  "license": "Apache-2.0",
11
11
  "main": "dist/cjs/index.js",
@@ -18,7 +18,8 @@
18
18
  "team": "Design System Team",
19
19
  "releaseModel": "scheduled",
20
20
  "website": {
21
- "name": "Text field"
21
+ "name": "Text field",
22
+ "category": "Components"
22
23
  }
23
24
  },
24
25
  "af:exports": {
@@ -26,23 +27,24 @@
26
27
  },
27
28
  "dependencies": {
28
29
  "@atlaskit/analytics-next": "^8.2.0",
29
- "@atlaskit/theme": "^12.1.0",
30
+ "@atlaskit/theme": "^12.2.0",
30
31
  "@atlaskit/tokens": "^0.10.0",
31
32
  "@babel/runtime": "^7.0.0",
32
- "@emotion/core": "^10.0.9"
33
+ "@emotion/react": "^11.7.1"
33
34
  },
34
35
  "peerDependencies": {
35
36
  "react": "^16.8.0"
36
37
  },
37
38
  "devDependencies": {
38
- "@atlaskit/avatar": "^20.5.0",
39
+ "@atlaskit/avatar": "^21.0.0",
39
40
  "@atlaskit/button": "^16.3.0",
40
41
  "@atlaskit/docs": "*",
42
+ "@atlaskit/ds-lib": "^2.0.1",
41
43
  "@atlaskit/form": "^8.5.0",
42
44
  "@atlaskit/icon": "^21.10.0",
43
- "@atlaskit/section-message": "^6.1.0",
45
+ "@atlaskit/section-message": "^6.2.0",
44
46
  "@atlaskit/ssr": "*",
45
- "@atlaskit/toggle": "^12.4.0",
47
+ "@atlaskit/toggle": "^12.5.0",
46
48
  "@atlaskit/visual-regression": "*",
47
49
  "@atlaskit/webdriver-runner": "*",
48
50
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -51,7 +53,7 @@
51
53
  "jscodeshift": "^0.13.0",
52
54
  "react-dom": "^16.8.0",
53
55
  "storybook-addon-performance": "^0.16.0",
54
- "typescript": "4.2.4",
56
+ "typescript": "4.3.5",
55
57
  "wait-for-expect": "^1.2.0"
56
58
  },
57
59
  "keywords": [
@@ -64,6 +66,7 @@
64
66
  "import-structure": "atlassian-conventions"
65
67
  },
66
68
  "@repo/internal": {
69
+ "dom-events": "use-bind-event-listener",
67
70
  "ui-components": "lite-mode",
68
71
  "styling": [
69
72
  "static",
package/report.api.md ADDED
@@ -0,0 +1,200 @@
1
+ ## API Report File for "@atlaskit/textfield"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ import { AllHTMLAttributes } from 'react';
7
+ import { FormEventHandler } from 'react';
8
+ import { default as React_2 } from 'react';
9
+
10
+ export declare type Appearance = 'subtle' | 'standard' | 'none';
11
+
12
+ declare const _default: React_2.NamedExoticComponent<
13
+ TextFieldProps & React_2.RefAttributes<unknown>
14
+ >;
15
+ export default _default;
16
+
17
+ export declare const TextFieldColors: {
18
+ backgroundColor: {
19
+ standard: {
20
+ light: 'var(--ds-background-input)';
21
+ dark: 'var(--ds-background-input)';
22
+ };
23
+ subtle: {
24
+ light: string;
25
+ dark: string;
26
+ };
27
+ none: {
28
+ light: string;
29
+ dark: string;
30
+ };
31
+ };
32
+ backgroundColorFocus: {
33
+ standard: {
34
+ light: 'var(--ds-background-input-pressed)';
35
+ dark: 'var(--ds-background-input-pressed)';
36
+ };
37
+ subtle: {
38
+ light: 'var(--ds-background-input-pressed)';
39
+ dark: 'var(--ds-background-input-pressed)';
40
+ };
41
+ none: {
42
+ light: string;
43
+ dark: string;
44
+ };
45
+ };
46
+ backgroundColorHover: {
47
+ standard: {
48
+ light: 'var(--ds-background-input-hovered)';
49
+ dark: 'var(--ds-background-input-hovered)';
50
+ };
51
+ subtle: {
52
+ light: 'var(--ds-background-neutral-subtle-hovered)';
53
+ dark: 'var(--ds-background-neutral-subtle-hovered)';
54
+ };
55
+ none: {
56
+ light: string;
57
+ dark: string;
58
+ };
59
+ };
60
+ borderColor: {
61
+ standard: {
62
+ light: 'var(--ds-border)';
63
+ dark: 'var(--ds-border)';
64
+ };
65
+ subtle: {
66
+ light: string;
67
+ dark: string;
68
+ };
69
+ none: {
70
+ light: string;
71
+ dark: string;
72
+ };
73
+ };
74
+ borderColorFocus: {
75
+ standard: {
76
+ light: 'var(--ds-border-focused)';
77
+ dark: 'var(--ds-border-focused)';
78
+ };
79
+ subtle: {
80
+ light: 'var(--ds-border-focused)';
81
+ dark: 'var(--ds-border-focused)';
82
+ };
83
+ none: {
84
+ light: string;
85
+ dark: string;
86
+ };
87
+ };
88
+ placeholderTextColor: {
89
+ light: 'var(--ds-text-subtlest)';
90
+ dark: 'var(--ds-text-subtlest)';
91
+ };
92
+ textColor: {
93
+ light: 'var(--ds-text)';
94
+ dark: 'var(--ds-text)';
95
+ };
96
+ invalidRules: {
97
+ light: {
98
+ backgroundColor: 'var(--ds-background-input)';
99
+ backgroundColorHover: 'var(--ds-background-input-hovered)';
100
+ backgroundColorFocus: 'var(--ds-background-input-pressed)';
101
+ borderColor: 'var(--ds-border-danger)';
102
+ borderColorFocus: 'var(--ds-border-focused)';
103
+ };
104
+ dark: {
105
+ backgroundColor: 'var(--ds-background-input)';
106
+ backgroundColorHover: 'var(--ds-background-input-hovered)';
107
+ backgroundColorFocus: 'var(--ds-background-input-pressed)';
108
+ borderColor: 'var(--ds-border-danger)';
109
+ borderColorFocus: 'var(--ds-border-focused)';
110
+ };
111
+ };
112
+ disabledRules: {
113
+ light: {
114
+ backgroundColor: 'var(--ds-background-disabled)';
115
+ backgroundColorHover: 'var(--ds-background-disabled)';
116
+ borderColor: 'var(--ds-background-disabled)';
117
+ textColor: 'var(--ds-text-disabled)';
118
+ };
119
+ dark: {
120
+ backgroundColor: 'var(--ds-background-disabled)';
121
+ backgroundColorHover: 'var(--ds-background-disabled)';
122
+ borderColor: 'var(--ds-background-disabled)';
123
+ textColor: 'var(--ds-text-disabled)';
124
+ };
125
+ };
126
+ };
127
+
128
+ export declare interface TextFieldProps
129
+ extends AllHTMLAttributes<HTMLInputElement> {
130
+ /**
131
+ * Affects the visual style of the text field.
132
+ */
133
+ appearance?: 'standard' | 'none' | 'subtle';
134
+ /**
135
+ * Applies compact styling, making the field smaller.
136
+ */
137
+ isCompact?: boolean;
138
+ /**
139
+ * Sets the field as to appear disabled,
140
+ * users will not be able to interact with the text field.
141
+ */
142
+ isDisabled?: boolean;
143
+ /**
144
+ * Changes the text field to have a border indicating that its value is invalid.
145
+ */
146
+ isInvalid?: boolean;
147
+ /**
148
+ * Sets content text value to appear monospaced.
149
+ */
150
+ isMonospaced?: boolean;
151
+ /**
152
+ * If true, prevents the value of the input from being edited.
153
+ */
154
+ isReadOnly?: boolean;
155
+ /**
156
+ * Set required for form that the field is part of.
157
+ */
158
+ isRequired?: boolean;
159
+ /**
160
+ * Element after input in text field.
161
+ */
162
+ elemAfterInput?: React_2.ReactNode;
163
+ /**
164
+ * Element before input in text field.
165
+ */
166
+ elemBeforeInput?: React_2.ReactNode;
167
+ /**
168
+ * Sets maximum width of input.
169
+ */
170
+ width?: string | number;
171
+ /**
172
+ * Handler called when the mouse down event is triggered on the input element.
173
+ */
174
+ onMouseDown?: React_2.MouseEventHandler<HTMLElement>;
175
+ /**
176
+ * A `testId` prop is provided for specified elements, which is a unique
177
+ * string that appears as a data attribute `data-testid` in the rendered code,
178
+ * serving as a hook for automated tests.
179
+ */
180
+ testId?: string;
181
+ /**
182
+ * Name of the input element.
183
+ */
184
+ name?: string;
185
+ /**
186
+ * Class name to apply to the input element.
187
+ */
188
+ className?: string;
189
+ /**
190
+ * Placeholder text to display in the text field whenever it is empty.
191
+ */
192
+ placeholder?: string;
193
+ /**
194
+ * Handler called when the inputs value changes.
195
+ */
196
+ onChange?: FormEventHandler<HTMLInputElement>;
197
+ }
198
+
199
+ export {};
200
+ ```